Last week, I explained that I am now able to publish motor speed commands from our lab’s logic controller to gazebo to make the quadcopter models fly. Although the model did not perform as expected, I can now look further into how to create and edit models and worlds in Gazebo, with the help of RotorS plugins, to achieve a more accurate experiments.

Pictured below is the rqt graph of the system when I am running the Gazebo simulator. The following are descriptions of the files that are most important to run the simulation:
- World file:
- Loaded once gazebo is started
- Responsible for simulating the environmental factors such as gravity, wind, and lighting.
- Plugins are attached by defining them inside of the world file. The plugin used in the world file currently is called ros_gazebo_interface, which converts gazebo messages to ROS messages, and publishes telemetry and mocap messages.
- Multiple plugins can be attached to a world file. For example, RotorS has a plugin to simulate wind that can be added to world files.
- Model file:
- Loaded after world
- Visual representation of objects in the simulation. These can be created and defined while running gazebo or through .xacro files. In order to create a model, a mesh must first be created for the model by using either a .stl or .dae file. Then, the parameters (i.e. mass and inertia) and boundaries for the model are defined with .xacro or .sdf files. The current simulation uses the mesh from a .dae file and a .xacro file.
- Plugins can also be attached to model files by defining inside the model file. The plugins used in the current simulation are the motor_model_plugin and imu_plugin (I will need to look further into what these plugins do).
- RotorS has plugins for other sensors such as lidar.
- Hiperlab Controller file:
- Takes in radio messages from quad_mocap_rates_controller
- Subscribes to sensors messages from Gazebo to run the code every 1 second
- Initiates the Run function from QuadcopterLogic.
- Publishes the vector from the function that calculates motor speeds to a ROS topic that is converted into a Gazebo message for actuators
I will be working towards importing a .stl file of a crazyfly into Gazebo and creating a .xacro file that matches the crazyfly parameters in the QuadConstants file so Gazebo mimics the lab’s current ROS simulator accuratley. I will also speak with Xiangyu and Junseok to begin the thought process of how to simulate the sensors that they are working with in Gazebo.