ENPM808X - Abhishekh Reddy Munnangi, 119399002
- Ubuntu Jammy (22.04)
- ROS2 Humble Hawksbill (Even base installation is sufficient)
- Git
rclcpp
- ROS2 C++ Client Libraryturtlebot3*
- Collection of packages for simulating Turtlebot 3 in Gazebostd_msgs
- Standard Messages Librarygeometry_msgs
- Geometry Messages Librarysensor_msgs
- Sensor Messages Libraryros2launch
- ROS2 Launch Library for Launch file support
- The following section assumes that you have an existing ROS2 workspace. If not, see how to create one.
The root directory of this repository are contents of a ROS2 package. Hence,
this needs to be cloned to a folder in the src/
directory of a ROS2 project
workspace.
<Your ROS2 Workspace>/
├── build/
├── install/
├── log/
└── src/
└── gazebo_exercise/ <-- Repository clones to this folder
└── <Repository contents>
Workspace directory tree with this repository contents in it
Run this command in the src/
directory of your ROS2 workspace
git clone https://github.com/armgits/808x-gazebo-exercise.git gazebo_exercise
Before the next step: For the first time, ensure that the package dependencies are installed. Run these commands from the root workspace directory.
rosdep init && rosdep update
rosdep install --from-paths src -y --ignore-src
Build the package in the root directory of your ROS2 workspace.
colcon build --packages-select gazebo_exercise
Source the freshly built package
source install/setup.bash
THe launch file in this package relies on the existing launch scripts from the Turtlebot 3 package, so this step is fairly straightforward.
ros2 launch gazebo_exercise exercise_launch.py
For more information on the argumnets, run
ros2 launch gazebo_exercise exercise_launch.py --show-args
Note: There could be a lot more arguments (including a previously existing rosbag record argument) in addition to the rosbag record argument from the Turtlebot 3 lanch file.
Appending the record_bag:=True
parameter to the launch command enables recording
all the message activity to a rosbag in the current working directory (Directory
in the terminal where the launch command is executed). This option is disabled
by default.
ros2 launch gazebo_exercise exercise_launch.py record_bag:=True
Recording stops when the Gazebo simulation is terminated.
In the directory the previously discussed launch command is executed and the bag file is saved to run:
ros2 bag info output_bag/
In a similar fashion as the previous step:
ros2 bag play output_bag/
Note: Gazebo should not be running in this step.