ENPM808X - Abhishekh Reddy Munnangi, 119399002
- Ubuntu Jammy (22.04)
- ROS2 Humble Hawksbill (Even base installation is sufficient)
- Git
rclcpp
- ROS2 C++ Client Librarystd_msgs
- Standard Messages Librarystd_srvs
- Standard Services Libraryros2launch
- ROS2 Launch Library for Launch file supporttf2
- Package API for working with reference frames and transformationstf2_ros
- Command line tools for using the tf2 packageament_cmake_gtest
- GTest for testing the package
-
Frames PDF, rosbag outputs are in the results folder, this folder has been reorganized in this release
-
Screenshots of the
rqt_console
GUI showing log messages are in theresults/
folder. -
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/
└── beginner_tutorials/ <-- 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/beginner_tutorials.git beginner_tutorials
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 beginner_tutorials
Source the freshly built package
source install/setup.bash
GTest test case has been added in this homework to test the first_astronaut
node.
colcon test --packages-select beginner_tutorials
Detailed outputs could be found in the build/beginner_tutorials/Testing
and
build/beginner_tutorials/test_results
folders.
In this exercise, the nodes could either be started individually or together using a launch file.
Start the first_astronaut
node in the first terminal
ros2 run beginner_tutorials talker
Start the second_astronaut
node in a new, second terminal
ros2 run beginner_tutorials listener
Note: You might need to source the package in the new terminal as well before running the above command
Hit Crtl + C
in both the terminals to stop the nodes.
Launch file unifies the above steps into a single line command for convenience.
Both the nodes could be launched together with the desired parameters as arguments, creating the perfect meme template.
ros2 launch beginner_tutorials launch.py record_bag:=<Your option> realization:=<Your text> dramatic_end:=<Your option>
Entry format for arguments:
record_bag:=
True/False
realization:=
"double quotes"
dramatic_end:=
true/false
To learn more about the launch arguments, use this command
ros2 launch beginner_tutorials launch.py --show-args
Note: The recorded rosbag will be saved to the current working directory. i.e. The directory in which the launch file is executed in the terminal.
Use the record_bag
launch argument in the launch command which accepts a
boolean value of True
or False
to record the message activity to a rosbag.
Two frames world
and its child frame talk
are broadcasted using a
StaticTransformBroadcaster
from the tf2
package. They can be checked and viewed
while at least the first_astronaut
node is running.
Read the stamped transform messages
ros2 run tf2_ros tf2_echo world talk
View the frames in a PDF (File is saved in a similar fashion as recording rosbag)
ros2 run tf2_tools view_frames
See the documentaion for more information.
This ROS2 package is a template for the "Always has been" meme.