This guide walks you through setting up, installing, and running the packages in this workspace.
- Ubuntu 22.04 or 24.04
- ROS 2 Jazzy or Humble
- Gazebo Sim Ionic or Harmonic
cd jordan_workshop/scripts
./install_ros2_jazzy.sh
cd jordan_workshop/scripts
./install_gazebo_sim_harmonic.sh
To automatically set up the workspace and install all required dependencies, run:
cd jordan_workshop/scripts
./setup.sh
Clone the repository from GitHub:
git clone https://github.com/khaledgabr77/jordan_workshop
Navigate to the workspace and build the project:
colcon build
source install/setup.bash
Set the necessary environment variable so that Gazebo (Ignition/GZ) can locate the simulation resources:
export GZ_SIM_RESOURCE_PATH=$GZ_SIM_RESOURCE_PATH:~/jordan_workshop/src
Note: Replace
~/jordan_workshop/src
with the absolute path to thesrc
directory of your workspace if it's located elsewhere.
Below are instructions for launching simulations and running various ROS 2 nodes in this workspace.
There are multiple launch files available, each providing different configurations for the Petra Robot:
-
SDF Simulation:
ros2 launch petra_robot petra_sim.launch.py
-
URDF Simulation:
ros2 launch petra_robot petra_urdf.launch.py
Note: There are several URDF launch files available in the
petra_robot
package, such aspetra_urdf_v1.launch.py
,petra_urdf_v3.launch.py
, and so on. Each file provides a different robot configuration. -
SLAM Simulation:
ros2 launch petra_robot mapping.launch.py
-
Localization Simulation:
ros2 launch petra_robot localization.launch.py
-
Navigation Simulation:
ros2 launch petra_robot navigation.launch.py
Use the following commands to run publisher and subscriber nodes from the C++ and Python pub/sub packages:
-
C++ (
cpp_pub_sub_pkg
):ros2 run cpp_pub_sub_pkg publisher_hello_ros ros2 run cpp_pub_sub_pkg subscriber_hello_ros
-
Python (
py_pub_sub_pkg
):ros2 run py_pub_sub_pkg publisher_hello_ros ros2 run py_pub_sub_pkg subscriber_hello_ros
The py_service_pkg
package includes a client and server:
ros2 run py_service_pkg py_service_server
ros2 run py_service_pkg py_service_client
Note: The
cpp_interface_pkg
contains the custom service definition (srv
message) used by the service nodes.
Several launch files are provided to simplify running multiple nodes simultaneously or to configure simulations.
-
C++ Publisher/Subscriber:
ros2 launch cpp_pub_sub_pkg cpp_pub_sub.launch.py
-
Turtlesim Launch (C++):
ros2 launch cpp_launch_pkg cpp_launch_file.launch.py
-
Turtlesim Launch (Python):
ros2 launch py_launch_pkg my_first_launch_file.launch.py
-
Turtlesim Remapping:
ros2 launch py_launch_pkg remapping_turtle.launch.py
To run Python nodes that use parameters (in the py_parameters_pkg
):
-
Parameter Nodes:
ros2 run py_parameters_pkg my_parameter ros2 run py_parameters_pkg py_param
-
Launch File with Parameters:
ros2 launch py_parameters_pkg publisher_param.launch.py
To work with TF2 (transforms) using py_tf2_pkg
:
-
Static Broadcaster:
ros2 run py_tf2_pkg static_broadcaster.py
-
Static Listener:
ros2 run py_tf2_pkg tf_listener.py
-
Dynamic Broadcaster:
ros2 run py_tf2_pkg dynamic_transform_broadcaster.py
-
Pose Estimation (turtle2 w.r.t. turtle1):
ros2 run py_tf2_pkg turtle_tf2_pose.py
-
Turtle Follower:
ros2 run py_tf2_pkg turtle_tf2_follower.py
To start the Mogi Trajectory Server:
ros2 run mogi_trajectory_server mogi_trajectory_server
To launch the Yahboomcar simulation in yahboomcar_description
:
ros2 launch yahboomcar_description robot_sim.launch.py
- Ensure all dependencies are installed correctly before running any simulations.
- For questions, contributions, or further details, visit the GitHub repository.
This project is licensed under the MIT License.
For questions or suggestions, please open a GitHub Issue or reach out via email at [email protected].
Happy Coding and Simulating!