Gazebo Harmonic¶
Physics simulation with Gazebo.
Installation¶
sudo apt install ros-jazzy-gz-*
Usage¶
Launch¶
ros2 launch ocs2_arm_controller demo.launch.py hardware:=gz
Parameters¶
Parameter |
Values |
Description |
|---|---|---|
|
|
Use Gazebo backend |
|
World file path |
Custom world |
|
|
No GUI |
Features¶
Physics¶
Rigid body dynamics
Contact simulation
Joint dynamics
Sensors¶
Camera simulation
Depth sensors
Force-torque
Worlds¶
Default world includes ground plane. Custom worlds:
ros2 launch ocs2_arm_controller demo.launch.py hardware:=gz world:=custom.sdf
Integration¶
ros2_control Bridge¶
gz_ros2_control bridges Gazebo physics to ROS 2:
<ros2_control name="GazeboSystem" type="system">
<hardware>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</hardware>
</ros2_control>
Topics¶
Gazebo publishes ROS 2 topics:
/joint_states— Joint feedback/clock— Simulation timeSensor topics as configured
Debugging¶
Check Gazebo Status¶
gz topic -l
View Simulation¶
gz gui
Slow Simulation¶
If simulation runs slow:
Reduce world complexity
Use headless mode
Check GPU acceleration