Action | Operation | Instruction |
---|---|---|
MODE | ||
Enter Selection mode (default mode) | Esc | press "Esc" for Select (model) mode |
Enter Rotate mode | r | press "r" for Rotate (model) mode |
Enter Translate mode | t | press "t" for Translate (model) mode |
Pause / unpause | Space | press the space bar to pause / unpause |
MANIPULATING MODELS | ||
Rotate model | r | press "r" for Rotate mode; click a model & rotate it using markers |
Translate model | t | press "t" for Translate mode; click a model & translate it using markers |
Constrain along axis | x/y/z | hold key while manipulating a model to constrain movement along that axis |
Snap when rotating | Ctrl + drag | hold Ctrl while rotating a model to rotate in customizable increments (default is 45° but can be changed from Tranform Control GUI) |
Snap when translating | Ctrl + drag | hold Ctrl while translating a model to move in customizable increments (default is 1m but can be changed from Tranform Control GUI) |
Align to world frame | Shift | hold Shift while manipulating a model to temporarily align axis its to the world frame |
MAIN WINDOW | ||
Save Config | Ctrl + s | hold Ctrl and press "s" to save the current window configuration |
Save Config As | Ctrl + Shift + s | hold Ctrl and Shift, and press "s" to save the current window configuration to a designated location |
Load Config | Ctrl + o | hold Ctrl and press "o" to load a window configuration |
Close | Ctrl + q | hold Ctrl and press "q" to shut down Gazebo |
Search Menu | / | press "/" to open the search menu for plugins |
├── CMakeLists.txt
+ ├── package.xml
+ ├── src
+ └── ...
+
+
+* `ros_gz_example_bringup` - holds launch files and high level utilities, communication bridge between ROS and Gazebo. Any robot or hardware specific configurations go here.
+
+ ├── config + │ ├── ros_gz_example_bridge.yaml + │ └── diff_drive.rviz + ├── launch + └── diff_drive.launch.py ++ +* `ros_gz_example_description` - holds the SDF description of the simulated system and any other [simulation assets](#accessing-simulation-assets). + +
├── hooks + │ └── ros_gz_example_description.dsv.in + ├── models + ├── diff_drive + ├── model.config + └── model.sdf ++ +* `ros_gz_example_gazebo` - holds Gazebo specific code and configurations. Namely this is where user-defined worlds and custom system plugins end up. + +
├── include + │ └── ros_gz_example_gazebo + │ ├── BasicSystem.hh + │ └── FullSystem.hh + ├── src + │ ├── BasicSystem.cc + │ └── FullSystem.cc + ├── worlds + └── diff_drive.sdf ++ +## Accessing Simulation Assets + +Simulation assets include your models or robot descriptions in URDF or SDF, meshes and materials files to help visualize different parts of the robot and finally compiling all these elements in a simulated world SDF. Gazebo offers a few different mechanisms for locating those, initializing it's search on `GZ_SIM_RESOURCE_PATH` environment variable, see gz-sim API on [finding resources](https://gazebosim.org/api/sim/8/resources.html) for more details. + +There is a difference in how ROS and Gazebo resolves URIs, that the ROS side can handle `package://` URIs, but by default SDFormat only supports `model://`. Now `libsdformat` can convert `package://` to `model://` URIs. So existing simulation assets can be loaded by "installing" the models directory and exporting the model paths to your environment. + +This can be automated using colcon environment hooks (shell scripts provided by a ROS package) in a [DSV file](https://colcon.readthedocs.io/en/released/developer/environment.html?highlight=dsv#dsv-files). Whenever you source the setup file in a workspace these environment hooks are also being sourced. See an [example](https://github.com/gazebosim/ros_gz_project_template/blob/main/ros_gz_example_gazebo/hooks/ros_gz_example_gazebo.dsv.in) of prepending the model share path to `GZ_SIM_RESOURCE_PATH` which enables Gazebo to load models from a ROS package using the `model://` URI. + +## Development + +1. Choose a ROS and Gazebo [combination](ros_installation) + + Note: If you're using a specific and unsupported Gazebo version with ROS 2, you might need to set the `GZ_VERSION` environment variable, for example: + + ```bash + export GZ_VERSION=ionic + ``` + +2. Install dependencies + + ```bash + cd ~/project_ws + source /opt/ros/