🤖
Introduction to ROS2 and Robotics
  • Introduction
  • ROS2
    • Index
    • IDE and CMake Setup
      • How to add additional include search path
    • ROS2 Building Blocks
      • ROS Workspace and Package Layout
      • Launch File
      • tf2
      • Quality of Service
      • Configurations
        • Rviz Configuration
      • Built-in Types
        • Built-in Message Type
    • ROS Architecture
      • Intra-process Communication
    • Navigation and Planning
      • Navigation Stack and Concepts
      • Navigation2 Implementation Overview
        • 🏗️Cost Map
        • Obstacle Avoidance and DWB Controller
      • DWB Controller
      • Page 5
    • How to launch the Nav2 stack
    • ROS2 Control
      • Online Resources
      • Overview of Codebase
    • 🍳Cookbook
      • Useful Commands
      • How to specify parameters
      • How to build the workspace
      • 🏗️How to publish message to a topic from command line?
      • How to inspect service and make a service call
      • How to properly terminate ROS and Gazebo
      • How to add and remove models in Gazebo simulation dynamically
      • 🚧How to spin nodes
    • 🛒Tutorials
      • Services and Communication between ROS2 and Gazebo
      • Subscription and Message Filters Demo
      • Executor and Spin Explained
      • Lifecycle Node Demo
      • Robotic Arm Demo
      • ⚒️Multiple Robotic Arms Simulation Demo
      • 🚧Introduction to xacro
    • Page
    • 🍺Tech Blog
      • Difference between URDF and SDF and how to convert
  • Gazebo
    • Index
    • Terminology
    • GUI
    • World Frame and Axis
    • Cookbook
    • Page 1
  • Programming in Robotics
    • C++
      • CMake
    • Python
    • Rust
  • Mathematics in Robotics
    • Linear Algebra
    • Matrix Properties
    • Probability
      • Expectation-Maximization Algorithm
    • Multivariable Function and Derivatives
  • Physics in Robotics
  • Control of Dynamic Systems
    • Dynamic Response and Transfer Function
    • Block Diagram
    • PID Controller
  • Robot Modeling and Control
    • Rotation and Homogeneous Transformation
  • Probabilistic Robotics
    • Bayes Filter
    • Kalman Filter
    • Particle Filter
    • Discrete Bayes Filter
    • Motion Model
    • Perception Model
    • Localization
    • SLAM
  • Miscellany
  • Concept Index
    • Quaternions
Powered by GitBook
On this page
  • How are the model files resolved?
  • Where are the Gazebo plugins installed on Ubuntu?
  1. Gazebo

Cookbook

We use Gazebo version Fortress in our local experiment but the linked documentation may involve a different version of Gazebo.

How are the model files resolved?

For large world, it's impossible to store all the model definition in the .sdf world file. Instead, models are commonly stored in a subdirectory models. For example, in the aws-robomaker-bookstore-world, we have the following project structure

~/workspace/gazebo-projects/aws-robomaker-bookstore-world$ tree -L 1
.
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── docs
├── launch
├── LICENSE
├── maps
├── models
├── my_note.txt
├── package.xml
├── README.md
├── routes
└── worlds

And the models directory looks like the following:

~/workspace/gazebo-projects/aws-robomaker-bookstore-world/models$ tree -L 2 | head -n 15
.
├── aws_robomaker_retail_AirConditionerC_01
│   ├── materials
│   ├── meshes
│   ├── model.config
│   └── model.sdf
├── aws_robomaker_retail_Bicycle_01
│   ├── materials
│   ├── meshes
│   ├── model.config
│   └── model.sdf

These models are reference in the world file. For instance:

<model name="AirConditionerC_01_001">
    <include>
        <uri>model://aws_robomaker_retail_AirConditionerC_01</uri>
    </include>
    <pose frame="">7.458202 1.422453 3.290944 0 -0 -1.564217</pose>
</model>
  • GAZEBO_MODEL_PATH: colon-separated set of directories where Gazebo will search for models

  • GAZEBO_RESOURCE_PATH: colon-separated set of directories where Gazebo will search for other resources such as world and media files.

  • GAZEBO_MASTER_URI: URI of the Gazebo master. This specifies the IP and port where the server will be started and tells the clients where to connect to.

  • GAZEBO_PLUGIN_PATH: colon-separated set of directories where Gazebo will search for the plugin shared libraries at runtime.

  • GAZEBO_MODEL_DATABASE_URI: URI of the online model database where Gazebo will download models from.

Where are the Gazebo plugins installed on Ubuntu?

  • Check the environment variable IGN_GAZEBO_SYSTEM_PLUGIN_PATH

  • Check directory similar to /usr/lib/x86_64-linux-gnu/gazebo-7.0/plugins

PreviousWorld Frame and AxisNextPage 1

Last updated 1 year ago

As we can see, the model path is a relative path. Therefore, when launching the Gazebo, we need to set the model path. Depending on the Gazebo version, there may be many environment variables available. According to the , we have the following variables:

For Gazebo Fortress, we need to set the variable IGN_GAZEBO_RESOURCE_PATH to the models directory. This variable is documented on this , Models, Lights, actors section.

documentation
page