Skip to content

Gazebo Simulation Setup

XuRobotics edited this page Feb 16, 2022 · 50 revisions

Gazebo Simulation Setup

Building and installing the autonomy stack:

Build from source

Using docker

Important parameter files you should modify according to your purpose:

catkin_ws/src/kr_autonomous_flight/autonomy_core/control/control_launch/config/trackers_mp.yaml

catkin_ws/src/kr_autonomous_flight/autonomy_core/map_plan/map_plan_launch/config/mapper.yaml

Using our example environment:

A video tutorial: TODO

Change the take-off position (optional):

Open this file catkin_ws/src/kr_autonomous_flight/autonomy_sim/gazebo_sim/gazebo_utils/launch/full_sim.launch, and change the x, y, and z positions:

<arg name="x" default="-10"/>
<arg name="y" default="-10"/>
<arg name="z" default="1.0"/>     

Finally, execute the following command:

source catkin_ws/devel/setup.bash
roslaunch gazebo_utils full_sim.launch

Using your own environment:

Specify your environment:

catkin_ws/src/mrsl_quadrotor/mrsl_quadrotor_launch/launch/spawn.launch

Change the value of "world_name" in the following line

<arg name="world_name" value="$(find mrsl_quadrotor_description)/worlds/$(arg world).world"/>

to point to the Gazebo world file of your own, i.e.,

<arg name="world_name" value="PATH_TO_YOUR_WORLD_FILE/YOUR_FILE_NAME.world"/>

Further customization:

You can also make further changes, e.g. use different robots, refer to the following files for details: catkin_ws/src/kr_autonomous_flight/autonomy_sim/gazebo_sim/gazebo_utils/launch/simulation.launch catkin_ws/src/mrsl_quadrotor/mrsl_quadrotor_launch/launch/spawn.launch catkin_ws/src/mrsl_quadrotor/mrsl_quadrotor_launch/launch/gazebo.launch

Be careful: only the default robot falcon4_os1_XXX have well-tuned gains, once you change the robot, you need to re-tune controller gains, by changing the following file catkin_ws/src/kr_autonomous_flight/autonomy_sim/gazebo_sim/gazebo_utils/config/falcon4_os1_so3_gains.yaml

The explanation of the parameters in the controller gains YAML file can be found here: https://github.com/KumarRobotics/kr_autonomous_flight/wiki/so3_control_config

Clone this wiki locally