Contributors: Ferdinando Dionisio, Vittorio Lisi, Giovanni Gabriele Imbimbo, Emanuele Cifelli
This guide provides step-by-step instructions for working with the robotics package. It covers Gazebo simulation, navigation tasks, mapping and localization, and vision-based navigation. Follow these instructions to ensure a successful setup and operation.
Navigate to the src directory of your ROS2 workspace and execute:
cd src
git clone https://github.com/ferd-bot/RL_24_Homework_4_Robotics.git .Important:
The above command (git clone with a dot .) works only if the target directory is empty. If it's not, you can:
- Remove all files in the directory:
rm -rf * - Alternatively, clone the repository without the dot and manually move the contents of the
RL_24_Homework_4_Roboticsfolder into thesrcdirectory.
Navigate to your ROS2 workspace, clean previous builds, and rebuild:
cd ~/ros2_ws
rm -rf build/ install/ log/
colcon build
source install/setup.bashLaunch the Gazebo simulation environment:
ros2 launch rl_fra2mo_description gazebo_fra2mo.launch.pyStart autonomous exploration by launching:
ros2 launch rl_fra2mo_description fra2mo_explore.launch.pyThis will activate the autonomous exploration node and, after a brief delay, Rviz will open with the "explore.rviz" configuration. Once the robot completes the exploration, run the waypoint-following script:
ros2 run rl_fra2mo_description follow_waypoints.py-
Waypoints:
The waypoints are specified in thenew_goals.yamlfile located in theconfigdirectory.
To use the waypoints from point 2 of Homework, replacenew_goals.yamlwithgoals.yamlin the script. -
Environment:
The navigation operates in theleonardo_race_field_new.sdfworld with themappa_mondo_1.pgmmap.
For vision-based navigation using AMCL, follow these steps:
-
Start the Gazebo simulation:
ros2 launch rl_fra2mo_description gazebo_fra2mo.launch.py
-
Launch the vision-based navigation node, which includes AMCL, RViz, and SLAM-based localization:
ros2 launch rl_fra2mo_description fra2mo_navigation_vision.launch.py
-
Once all nodes are active, start the task script for approaching an obstacle, detecting a marker, and returning to the initial position (for Aruco TF publish, check "Aruco TF Frame":
ros2 run rl_fra2mo_description task.py
-
To visualize Aruco marker detection, open
rqtin another terminal and subscribe to the/aruco_detect/resulttopic:rqt
To visualize transformation frames during the simulation:
-
While running the
task.pyscript, publish and print the Aruco pose using:ros2 run rl_fra2mo_description aruco_tf
This command publishes the Aruco pose in the global frame.
-
To read the tag pose relative to the camera:
ros2 topic echo /aruco_detect/pose
Note: These topics can be monitored while running the task.py script during the Aruco detection task. This allows you to observe transformations and validate marker tracking dynamically within the simulation.
-
Multiple Terminals:
Run each command or node in a separate terminal after sourcing the workspace:source install/setup.bash -
Video Demonstrations:
-
Troubleshooting:
- Ensure all required nodes are running.
- Check terminal outputs for error messages.
By following these instructions, you can perform advanced robotics tasks such as simulation, autonomous navigation, exploration, and vision-based control for Homework 4.