based on turtlesim, local path planning, AMR, 2d
- Get package (insert your
workspace
)
cd {workspace}/src
git clone https://github.com/cobaal/multi-amr-lpp-sim.git
- Build (insert your
workspace
)
apt install nlohmann-json3-dev
cd {workspace}
colcon build
colcon build --allow-overriding turtlesim
source install/setup.bash
- In
.bashrc
file (insert yourworkspace
)
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export FASTRTPS_DEFAULT_PROFILES_FILE={workspace}/src/profiles.xml
export WAYPOINTS_PATH={workspace}/src/multi-amr-lpp-sim/turtlesim/data/waypoints.json
- Make your global path (
workspace
/src/multi-amr-lpp-sim/turtlesim/data/waypoints.json)
{
"turtle1": [
{ "x": 1.0, "y": 1.0, "theta": 0.0 },
{ "x": 1.0, "y": 2.0, "theta": 0.0 },
{ "x": 2.0, "y": 2.0, "theta": 0.0 },
{ "x": 2.0, "y": 1.0, "theta": 0.0 },
{ "x": 3.0, "y": 1.0, "theta": 0.0 },
{ "x": 3.0, "y": 3.0, "theta": 0.0 },
{ "x": 4.0, "y": 2.0, "theta": 0.0 },
{ "x": 4.0, "y": 4.0, "theta": 0.0 },
{ "x": 5.0, "y": 4.0, "theta": 0.0 },
{ "x": 5.0, "y": 5.0, "theta": 0.0 },
{ "x": 3.0, "y": 5.0, "theta": 0.0 },
{ "x": 3.0, "y": 7.0, "theta": 0.0 },
{ "x": 4.0, "y": 7.0, "theta": 0.0 },
{ "x": 5.0, "y": 8.0, "theta": 0.0 },
{ "x": 6.0, "y": 8.0, "theta": 0.0 },
{ "x": 6.0, "y": 5.0, "theta": 0.0 },
{ "x": 7.0, "y": 5.0, "theta": 0.0 },
{ "x": 8.0, "y": 4.0, "theta": 0.0 },
{ "x": 9.0, "y": 4.0, "theta": 0.0 },
{ "x": 9.0, "y": 5.0, "theta": 0.0 },
{ "x": 10.0, "y": 5.0, "theta": 0.0 },
{ "x": 10.0, "y": 7.0, "theta": 0.0 },
{ "x": 11.0, "y": 7.0, "theta": 0.0 },
{ "x": 11.0, "y": 8.0, "theta": 0.0 },
{ "x": 12.0, "y": 8.0, "theta": 0.0 },
{ "x": 12.0, "y": 10.0, "theta": 0.0 },
{ "x": 10.0, "y": 10.0, "theta": 0.0 },
{ "x": 9.0, "y": 9.0, "theta": 0.0 },
{ "x": 9.0, "y": 8.0, "theta": 0.0 },
{ "x": 8.0, "y": 8.0, "theta": 0.0 },
{ "x": 8.0, "y": 9.0, "theta": 0.0 }
],
"turtle2": [
{ "x": 1.0, "y": 1.0, "theta": 0.0 },
{ "x": 1.0, "y": 2.0, "theta": 0.0 },
{ "x": 2.0, "y": 2.0, "theta": 0.0 },
{ "x": 2.0, "y": 1.0, "theta": 0.0 },
{ "x": 3.0, "y": 1.0, "theta": 0.0 },
{ "x": 3.0, "y": 3.0, "theta": 0.0 },
{ "x": 4.0, "y": 2.0, "theta": 0.0 },
{ "x": 4.0, "y": 4.0, "theta": 0.0 },
{ "x": 5.0, "y": 4.0, "theta": 0.0 },
{ "x": 5.0, "y": 5.0, "theta": 0.0 },
{ "x": 3.0, "y": 5.0, "theta": 0.0 },
{ "x": 3.0, "y": 7.0, "theta": 0.0 },
{ "x": 4.0, "y": 7.0, "theta": 0.0 },
{ "x": 5.0, "y": 8.0, "theta": 0.0 },
{ "x": 6.0, "y": 8.0, "theta": 0.0 },
{ "x": 6.0, "y": 5.0, "theta": 0.0 },
{ "x": 7.0, "y": 5.0, "theta": 0.0 },
{ "x": 8.0, "y": 4.0, "theta": 0.0 },
{ "x": 9.0, "y": 4.0, "theta": 0.0 },
{ "x": 9.0, "y": 5.0, "theta": 0.0 },
{ "x": 10.0, "y": 5.0, "theta": 0.0 },
{ "x": 10.0, "y": 7.0, "theta": 0.0 },
{ "x": 11.0, "y": 7.0, "theta": 0.0 },
{ "x": 11.0, "y": 8.0, "theta": 0.0 },
{ "x": 12.0, "y": 8.0, "theta": 0.0 },
{ "x": 12.0, "y": 10.0, "theta": 0.0 },
{ "x": 10.0, "y": 10.0, "theta": 0.0 },
{ "x": 9.0, "y": 9.0, "theta": 0.0 },
{ "x": 9.0, "y": 8.0, "theta": 0.0 },
{ "x": 8.0, "y": 8.0, "theta": 0.0 },
{ "x": 8.0, "y": 9.0, "theta": 0.0 }
],
...
}
- Simulator
ros2 run turtlesim turtlesim_node
- Controller
% SUBSCRIBER
ros2 run turtlesim local_path_planner {number: 1, 2, ...}