### Start Gazebo with a Sample World Source: https://github.com/gazebosim/docs/blob/master/rotary/GUI_tutorial.md Launches the Gazebo simulator with the 'shapes.sdf' world. Ensure Rotary is installed. ```bash gz sim shapes.sdf ``` -------------------------------- ### Source Workspace Setup Script (bash) Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Source the setup script for the bash shell to make the installed Gazebo binaries available in the current terminal session. This is required every time a new terminal is opened. ```bash . ~/workspace/install/setup.bash ``` -------------------------------- ### Add Gazebo Repositories and Install Source: https://github.com/gazebosim/docs/blob/master/rotary/install_ubuntu.md Adds the Gazebo nightly and stable repositories and installs the gz-rotary metapackage. ```bash sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-nightly $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-nightly.list > /dev/null sudo apt-get update sudo apt-get install gz-rotary ``` -------------------------------- ### Install gz_tools_vendor for gz command Source: https://github.com/gazebosim/docs/blob/master/common/ros2_gz_vendor_pkgs.md To use the `gz` command-line tool, ensure the `gz_tools_vendor` package is installed. Source the ROS setup file to add the `gz` command to your PATH. ```bash # Source the ROS setup file source /opt/ros/${ROS_DISTRO}/setup.bash ``` -------------------------------- ### Install General Dependencies Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Install a comprehensive list of general dependencies required for building Gazebo Libraries using Homebrew. ```bash brew install assimp boost bullet cli11 cmake cppzmq dartsim doxygen eigen fcl ffmpeg flann freeimage freetype gdal gflags google-benchmark ipopt jsoncpp libccd libyaml libzzip libzip nlopt ode open-scene-graph ossp-uuid ogre1.9 ogre2.3 pkg-config protobuf qt@6 qwt rapidjson ruby tbb tinyxml2 urdfdom zeromq ``` -------------------------------- ### Install Rotary on Ubuntu Source: https://github.com/gazebosim/docs/blob/master/rotary/rotary.md Installs prerequisite tools for adding the Gazebo nightly repository and then installs the Rotary metapackage. ```bash sudo apt-get update sudo apt-get install curl lsb-release gnupg ``` ```bash sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-nightly $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-nightly.list > /dev/null sudo apt-get update ``` ```bash sudo apt-get install gz-rotary ``` -------------------------------- ### Set up Python Virtual Environment and Install vcstool/colcon Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Create a Python virtual environment for installing vcstool and colcon. This isolates the dependencies for these tools. ```bash python3 -m venv $HOME/vcs_colcon_installation . $HOME/vcs_colcon_installation/bin/activate pip3 install vcstool colcon-common-extensions ``` -------------------------------- ### Source Workspace Setup Script (zsh) Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Source the setup script for the zsh shell to make the installed Gazebo binaries available in the current terminal session. This is required every time a new terminal is opened. ```zsh . ~/workspace/install/setup.zsh ``` -------------------------------- ### Install Generic Tools on Ubuntu Source: https://github.com/gazebosim/docs/blob/master/rotary/install_ubuntu_src.md Installs essential tools required for source compilation and dependency management on Ubuntu systems. ```bash sudo apt update && sudo apt install -y python3-pip python3-venv lsb-release gnupg curl git ``` -------------------------------- ### Install Necessary Tools Source: https://github.com/gazebosim/docs/blob/master/rotary/install_ubuntu.md Installs essential tools like curl, lsb-release, and gnupg required for package management. ```bash sudo apt-get update sudo apt-get install curl lsb-release gnupg ``` -------------------------------- ### Install Default Gazebo/ROS Pairing Source: https://github.com/gazebosim/docs/blob/master/common/ros_installation.md Installs the recommended version of Gazebo and ros_gz for your ROS installation. Replace ${ROS_DISTRO} with your ROS distribution (e.g., humble, rolling, noetic). ```bash sudo apt-get install ros-${ROS_DISTRO}-ros-gz ``` -------------------------------- ### Install Dependencies with Pixi Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md Install all project dependencies defined in the pixi.toml file. This command should be run from within the Pixi project directory. ```bash pixi install ``` -------------------------------- ### Install release.py Dependencies Source: https://github.com/gazebosim/docs/blob/master/common/release_instructions.md Install the necessary dependencies for the `release.py` script using a Python virtual environment and pip. Ensure you are in the `release-tools` directory. ```bash # you can change .releasepy_venv by any directory of your preference python3 -m venv ~/.releasepy_venv . ~/.releasepy_venv/bin/activate cd pip install . ``` -------------------------------- ### Example Package Structure: ros_gz_example_bringup Source: https://github.com/gazebosim/docs/blob/master/rotary/ros_gz_project_template_guide.md This package contains launch files and utilities for communication between ROS and Gazebo, including robot or hardware-specific configurations. ```text ├── config │   ├── ros_gz_example_bridge.yaml │   └── diff_drive.rviz ├── launch └── diff_drive.launch.py ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/gazebosim/docs/blob/master/README.md Installs the necessary Python packages for building the Gazebo documentation from the requirements.txt file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Serve Built Documentation Locally Source: https://github.com/gazebosim/docs/blob/master/README.md Starts an HTTP server to preview the built documentation locally on port 8000, serving files from the '.build' directory. ```bash python3 -m http.server 8000 -d .build ``` -------------------------------- ### Start Gazebo with an empty world Source: https://github.com/gazebosim/docs/blob/master/rotary/Model_insertion_fuel.md This command starts a Gazebo simulation with an empty world, serving as a prerequisite for adding models. ```bash gz sim empty.sdf ``` -------------------------------- ### Example Package Structure: ros_gz_example_gazebo Source: https://github.com/gazebosim/docs/blob/master/rotary/ros_gz_project_template_guide.md This package contains Gazebo-specific code and configurations, including user-defined worlds and custom system plugins. ```text ├── include │   └── ros_gz_example_gazebo │   ├── BasicSystem.hh │   └── FullSystem.hh ├── src │   ├── BasicSystem.cc │   └── FullSystem.cc ├── worlds    └── diff_drive.sdf ``` -------------------------------- ### Check Installed Gazebo Versions Source: https://github.com/gazebosim/docs/blob/master/rotary/GUI_tutorial.md Lists all installed versions of Gazebo on your system. Useful for verifying installations. ```bash gz sim --versions ``` -------------------------------- ### Example Package Structure: ros_gz_example_application Source: https://github.com/gazebosim/docs/blob/master/rotary/ros_gz_project_template_guide.md This package holds ROS 2 specific code and configurations for control, planning, and high-level algorithms. ```text ├── CMakeLists.txt ├── package.xml ├── src └── ... ``` -------------------------------- ### Example Package Structure: ros_gz_example_description Source: https://github.com/gazebosim/docs/blob/master/rotary/ros_gz_project_template_guide.md This package stores the SDF description of the simulated system and other simulation assets like models and meshes. ```text ├── hooks │   └── ros_gz_example_description.dsv.in ├── models    ├── diff_drive       ├── model.config       └── model.sdf ``` -------------------------------- ### Launch ROS 2 and Gazebo Bridge Source: https://github.com/gazebosim/docs/blob/master/rotary/ros2_integration.md Use this command to start the ROS 2 and Gazebo bridge with a specified configuration file. ```bash ros2 launch ros_gz_bridge ros_gz_bridge.launch.py bridge_name:=ros_gz_bridge config_file:= ``` -------------------------------- ### Install Dependencies from Source Workspace Source: https://github.com/gazebosim/docs/blob/master/rotary/install_ubuntu_src.md Installs all required dependencies for the Gazebo collection from a workspace containing the source code on Ubuntu. ```bash cd ~/workspace/src sudo apt -y install \ $(sort -u $(find . -iname 'packages-'`lsb_release -cs`'.apt' -o -iname 'packages.apt' | grep -v '/\.git/') | sed '/gz||sdf/d' | tr '\n' ' ') ``` -------------------------------- ### Import ros_gz_project_template Workspace Source: https://github.com/gazebosim/docs/blob/master/rotary/ros_gz_project_template_guide.md Clone the ros_gz_project_template using vcs to start a new project. ```bash vcs import --input https://raw.githubusercontent.com/gazebosim/ros_gz_project_template/main/template_workspace.yaml ``` -------------------------------- ### Create Prerelease for gz-cmake3 Source: https://github.com/gazebosim/docs/blob/master/common/release_instructions.md Example of bumping gz-cmake3 to a prerelease version. This command uploads the prerelease to the repository. ```bash cd gz-cmake3 git checkout gz-cmake3 ~/release-tools/release.py gz-cmake3 3.0.0~pre1 --upload-to-repo prerelease ``` -------------------------------- ### Install Server-Only Package Source: https://github.com/gazebosim/docs/blob/master/rotary/install_ubuntu.md Installs the gz-sim-server package for headless environments, which includes only the simulation server without GUI dependencies. ```bash sudo apt-get install gz-sim-server ``` -------------------------------- ### Install Ogre Dependency (XQuartz) Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Install XQuartz, which is a dependency for Ogre. This is done using Homebrew Cask. ```bash brew install --cask xquartz ``` -------------------------------- ### Add PPA and Install Gazebo11 Source: https://github.com/gazebosim/docs/blob/master/common/install_gz11_side_by_side.md Use these commands to add the Open Robotics PPA for Gazebo11 with a separate gz tool package and install or upgrade Gazebo11. This is necessary before installing new Gazebo versions to ensure side-by-side compatibility. ```bash sudo add-apt-repository ppa:openrobotics/gazebo11-gz-cli sudo apt update sudo apt-get install gazebo11 ``` -------------------------------- ### Launch Gazebo Server Only Source: https://github.com/gazebosim/docs/blob/master/rotary/ros2_launch_gazebo.md Use this command to start only the Gazebo server without the GUI, loading an empty world. ```bash ros2 launch ros_gz_sim gz_server.launch.py world_sdf_file:=empty.sdf ``` -------------------------------- ### Install launch, models, params, rviz, urdf, worlds directories Source: https://github.com/gazebosim/docs/blob/master/common/migrating_gazebo_classic_ros2_packages.md This CMake install command ensures that necessary directories for launch files, models, parameters, RViz configurations, URDF descriptions, and Gazebo worlds are installed to the correct share directory of the ROS 2 package. ```cmake install(DIRECTORY launch models params rviz urdf worlds DESTINATION share/${PROJECT_NAME}/ ) ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Install the necessary command-line developer tools for building software on macOS. This is a requirement for building Gazebo Libraries. ```bash xcode-select --install ``` -------------------------------- ### Launch Gazebo Server Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Launch the Gazebo server in one terminal. This command starts the simulation engine. ```bash # launch server in one terminal gz sim -v 4 shapes.sdf -s ``` -------------------------------- ### Install Clang-Tidy for Additional Code Checks Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md Install clang-tidy and its development dependencies for more comprehensive code analysis. This step is optional but recommended for thorough checks. ```bash sudo apt-get install clang-tidy-6.0 libclang-6.0-dev python-yaml ``` -------------------------------- ### Install Gazebo Harmonic with ROS 2 Humble Source: https://github.com/gazebosim/docs/blob/master/common/ros_installation.md Installs Gazebo Harmonic and ROS 2 Humble using non-official binary packages from packages.osrfoundation.org. This is for advanced users needing a Gazebo version not officially supported by the ROS distro. ```bash apt-get install ros-humble-ros-gzharmonic ``` -------------------------------- ### Install ROS 2 and Gazebo Dependencies Source: https://github.com/gazebosim/docs/blob/master/rotary/ros_gz_project_template_guide.md Installs necessary dependencies for a ROS 2 project. Ensure you are in your project workspace and have sourced your ROS 2 distribution. ```bash cd ~/project_ws source /opt/ros//setup.bash sudo rosdep init rosdep update rosdep install --from-paths src --ignore-src -r -i -y --rosdistro ``` -------------------------------- ### Execute Gazebo Launch File Source: https://github.com/gazebosim/docs/blob/master/rotary/sensors.md Command to run a Gazebo launch file, which starts the simulation and the lidar node. ```sh gz launch sensor_launch.gzlaunch ``` -------------------------------- ### Install Dependencies with rosdep Source: https://github.com/gazebosim/docs/blob/master/common/migrating_gazebo_classic_ros2_packages.md Install package dependencies for the cloned `turtlebot3_simulations` package using `rosdep`. Ensure `rosdep init` has been run if this is the first time using `rosdep`. ```bash sudo rosdep init # only needed if using rosdep rosdep install --from-paths . -i -y ``` -------------------------------- ### Install New Gazebo Dependencies Source: https://github.com/gazebosim/docs/blob/master/common/migrating_gazebo_classic_ros2_packages.md After updating package.xml, use this command to automatically install the necessary Gazebo version and its dependencies. This command is typically run from the root of your workspace. ```bash rosdep install --from-paths . -i -y ``` -------------------------------- ### Create Nightly Build for gz-cmake3 Source: https://github.com/gazebosim/docs/blob/master/common/release_instructions.md Example of creating a nightly build for gz-cmake3 from the main branch. This command uploads the nightly build to the repository. ```bash # Example gz-cmake3 nightly from main branch ~/release-tools/release.py gz-cmake3 3.0.0~pre1 --upload-to-repo nightly --nightly-src-branch main ``` -------------------------------- ### Launch Gazebo GUI Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Launch the Gazebo graphical user interface in a separate terminal. Remember to source the workspace setup script before launching. ```bash # launch gui in a separate terminal # remember to source the workspace setup script gz sim -v 4 -g ``` -------------------------------- ### Template Function Get Example Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md A template function returning a data type can use a stand-alone `Get`. ```cpp public: template T Get(); ``` -------------------------------- ### Accessor Function Naming (No 'Get') Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md Accessor functions should be named like nouns, not starting with 'Get'. Use patterns like 'NounByName' or 'NounById' for disambiguation if necessary. ```cpp public: ::ServerConfig ServerConfig() const; ModelByName(const std::string& _name); gazebo::Entity Entity() const; ``` -------------------------------- ### Create Workspace and Source Directories Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md Create a workspace directory for building Gazebo and a 'src' subdirectory to hold the source code. Navigate into the workspace directory. ```bash mkdir gz-ws cd gz-ws mkdir src ``` -------------------------------- ### Build Gazebo Libraries with Merge Install Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Compile all Gazebo libraries using colcon with the --merge-install option. This is the standard build command after dependencies are met. ```bash colcon build --merge-install ``` -------------------------------- ### Mutator Naming Convention (Not Allowed) Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md Member functions that provide write access to protected data must start with `Set`. This example shows an incorrect naming convention. ```cpp public: void ServerConfig(::ServerConfig &_config); ``` -------------------------------- ### Install Colcon Sanitizer Reports Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md Install the colcon-sanitizer-reports package for enhanced sanitizer reporting. ```bash git clone https://github.com/colcon/colcon-sanitizer-reports.git cd colcon-sanitizer-reports sudo python3 setup.py install ``` -------------------------------- ### Install Colcon Sanitizer Mixins Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md Install and update colcon mixins for sanitizer support. ```bash pip3 install colcon-mixin colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon mixin update default ``` -------------------------------- ### Source Workspace and Activate Pixi Environment (Windows) Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md Use these commands to set up a new terminal session for using the Gazebo workspace. This involves navigating to the Gazebo directory, activating the Pixi shell, and running the appropriate setup script for CMD or PowerShell. ```bash # CMD cd gazebo pixi shell call gz-ws\install\setup.bat ``` ```powershell # PowerShell cd gazebo pixi shell .\gz-ws\install\setup.ps1 ``` -------------------------------- ### Build All Gazebo Documentation Versions Source: https://github.com/gazebosim/docs/blob/master/README.md Executes the build script to generate documentation for all Gazebo release versions. ```bash python3 build_multiversion.py ``` -------------------------------- ### Launch Gazebo Server and GUI Separately Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md Launch the Gazebo server and GUI in separate terminals after ensuring both terminals have the workspace sourced, the Pixi shell activated, and QT environment variables set. ```bash # Launch server in one terminal gz sim -s # In separate terminal, launch gui gz sim -g ``` -------------------------------- ### Launch RViz Demo with Gazebo Source: https://github.com/gazebosim/docs/blob/master/rotary/ros2_integration.md Launch a ROS 2 demo that integrates with Gazebo and RViz for visualization. Ensure RViz is enabled. ```bash ros2 launch ros_gz_sim_demos sdf_parser.launch.py rviz:=True ``` -------------------------------- ### Install Rotary on macOS (Homebrew) Source: https://github.com/gazebosim/docs/blob/master/rotary/rotary.md Adds the OSRF simulation tap and installs the main Rotary metapackage or individual Rotary libraries. ```bash brew tap osrf/simulation brew install gz-rotary ``` ```bash brew install gz-rotary-math gz-rotary-sim ``` -------------------------------- ### Install Dependencies using Rosdep Source: https://github.com/gazebosim/docs/blob/master/rotary/install_ubuntu_src.md Installs dependencies using rosdep, skipping specified keys that may not be available or require manual handling. ```bash cd ~/workspace/src rosdep install -i --from-path . -y \ --skip-keys "DART libogre-dev libogre-next-2.3-dev" ``` -------------------------------- ### Spawn Model using ros_gz_sim Launch File Source: https://github.com/gazebosim/docs/blob/master/rotary/ros2_spawn_model.md Use this command to spawn a new model into an existing Gazebo simulation via the `gz_spawn_model.launch.py` script provided by `ros_gz_sim`. It accepts parameters like world, file path, entity name, and pose. ```bash ros2 launch ros_gz_sim gz_spawn_model.launch.py world:=empty file:=$(ros2 pkg prefix --share ros_gz_sim_demos)/models/vehicle/model.sdf entity_name:=my_vehicle x:=5.0 y:=5.0 z:=0.5 ``` -------------------------------- ### Launch Gazebo Simulation Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md After sourcing the workspace, you can launch the Gazebo simulator with verbose output. ```bash gz sim --verbose ``` -------------------------------- ### Custom XML Launch File for Gazebo Server Source: https://github.com/gazebosim/docs/blob/master/rotary/ros2_launch_gazebo.md This XML launch file demonstrates how to use the custom tag to launch Gazebo server with configurable world SDF file and other parameters. ```xml ``` -------------------------------- ### Install Python 3 from Homebrew Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Install the latest version of Python 3 using the Homebrew package manager. Rotary is compatible with Python 3. ```bash brew install python3 ``` -------------------------------- ### Run Tests Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md Execute all tests for the project by running 'make test' in the build directory. This process may take some time. ```bash make test ``` -------------------------------- ### Configure Gazebo GUI client launch with ros_gz_sim Source: https://github.com/gazebosim/docs/blob/master/common/migrating_gazebo_classic_ros2_packages.md Launch the Gazebo GUI client using 'gz_sim.launch.py' by setting the 'gz_args' to '-g' for GUI mode. Ensure correct spacing for arguments. ```python gzclient_cmd = IncludeLaunchDescription( PythonLaunchDescriptionSource( os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') ), launch_arguments={'gz_args': '-g -v4 '}.items() ) ``` -------------------------------- ### Download Pixi Configuration Files Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md Download the necessary Pixi configuration files for Gazebo. Ensure you are in the directory where you want to create your Pixi project. ```bash mkdir gazebo cd gazebo curl.exe -L -O https://raw.githubusercontent.com/gazebo-tooling/release-tools/refs/heads/master/conda/envs/noble_like/pixi.toml curl.exe -L -O https://raw.githubusercontent.com/gazebo-tooling/release-tools/refs/heads/master/conda/envs/noble_like/pixi.lock ``` -------------------------------- ### Remove Source-Based Install Workspace Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md To uninstall a source-based Gazebo installation and free up disk space, delete the workspace directory. Ensure you replace `` with your actual workspace directory name (e.g., `gz-ws`). ```bash rmdir /s /q # gz-ws was used as workspace_name in this document ``` -------------------------------- ### Build All Gazebo Libraries Source: https://github.com/gazebosim/docs/blob/master/rotary/install_windows_src.md Build all Gazebo libraries and their dependencies. This command disables testing and SWIG, merges the install space, and builds up to gz-sim and gz-tools. Ensure you are in a Visual Studio Developer shell and have activated the Pixi shell. ```bash colcon build --cmake-args -DBUILD_TESTING=OFF -DSKIP_SWIG=ON --merge-install --packages-up-to gz-sim gz-tools ``` -------------------------------- ### Uninstall Gazebo Rotary Source: https://github.com/gazebosim/docs/blob/master/rotary/install_ubuntu.md Removes the Gazebo Rotary metapackage and any automatically installed dependencies. ```bash sudo apt remove gz-rotary && sudo apt autoremove ``` -------------------------------- ### Variable Naming Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md Variables must start with a lowercase letter and capitalize subsequent words. ```cpp int myVariable; std::string myStringVariable; ``` -------------------------------- ### Configure Gazebo Server launch with ros_gz_sim Source: https://github.com/gazebosim/docs/blob/master/common/migrating_gazebo_classic_ros2_packages.md Use the 'gz_sim.launch.py' from 'ros_gz_sim' to launch the Gazebo server. The 'gz_args' argument accepts flags like '-r' (run), '-s' (server only), and '-v4' (verbosity). Ensure proper spacing in the 'gz_args' list when using Python string formatting or LaunchConfiguration. ```python gzserver_cmd = IncludeLaunchDescription( PythonLaunchDescriptionSource( os.path.join(ros_gz_sim, 'launch', 'gz_sim.launch.py') ), launch_arguments={'gz_args': ['-r -s -v4 ', world], 'on_exit_shutdown': 'true'}.items() ) ``` -------------------------------- ### Set up Visual Studio Command Prompt (CMD) Source: https://github.com/gazebosim/docs/blob/master/rotary/troubleshooting.md When compiling Gazebo on Windows, ensure the Visual Studio environment variables are set correctly. This command configures the prompt for x86_amd64 compilation. ```batch "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 ``` -------------------------------- ### Call GetEntitiesStates Service Source: https://github.com/gazebosim/docs/blob/master/rotary/ros2_sim_interfaces.md Use this service to get the states of multiple entities, with optional filtering. ```bash ros2 service call /gzserver/get_entities_states simulation_interfaces/srv/GetEntitiesStates "{filters: {filter: ''}}" ``` -------------------------------- ### Import Gazebo Sources with vcstool Source: https://github.com/gazebosim/docs/blob/master/rotary/install_osx_src.md Use vcstool to automatically retrieve all the Gazebo libraries sources from their respective repositories based on the provided YAML file. ```bash vcs import < collection-rotary.yaml ``` -------------------------------- ### Function Parameters Start with Underscore Source: https://github.com/gazebosim/docs/blob/master/common/contributing.md All function parameters must be prefixed with an underscore to distinguish them from local variables. ```cpp void MyClass::MyFunction(int _parameter) { // ... } ``` -------------------------------- ### Gazebo Launch File Source: https://github.com/gazebosim/docs/blob/master/rotary/sensors.md XML configuration file to launch Gazebo simulation and the lidar_node simultaneously. ```xml gz sim sensor_tutorial.sdf ./build/lidar_node ``` -------------------------------- ### Launch Gazebo World Source: https://github.com/gazebosim/docs/blob/master/rotary/sensors.md Launches a Gazebo world with the specified SDF file. This command is used to start the simulation. ```bash gz sim sensor_tutorial.sdf ``` -------------------------------- ### Listen to ROS 2 Topic Source: https://github.com/gazebosim/docs/blob/master/rotary/ros2_integration.md Start a ROS 2 listener to monitor messages published on a specific topic. ```bash ros2 topic echo /keyboard/keypress ``` -------------------------------- ### Build with Internal URDF on macOS Source: https://github.com/gazebosim/docs/blob/master/rotary/troubleshooting.md If 'urdf_model.h' is not found on macOS, install 'urdfdom' and 'urdfdom_headers', then rebuild with the internal URDF version. ```bash brew install urdfdom urdfdom_headers ``` ```bash colcon build --cmake-args -DUSE_INTERNAL_URDF=ON --merge-install ```