Wednesday, November 21, 2018

Start Gazebo and PX4 SITL separately

  • Terminal 1
make posix_sitl_default gazebo no_sim=1

  • Terminal 2
# PX4 gazebo plugins export GAZEBO_PLUGIN_PATH=${GAZEBO_PLUGIN_PATH}:/home/user/px4/Firmware/build/posix_sitl_default/build_gazebo export GAZEBO_MODEL_PATH=${GAZEBO_MODEL_PATH}:/home/user/px4/Firmware/Tools/sitl_gazebo/models # add iris model into warehouse world #run gazebo --verbose /home/user/px4/Firmware/Tools/sitl_gazebo/worlds/warehouse.world

Add iris into warehouse.world

<?xml version="1.0" ?> <sdf version="1.5"> <world name="default"> <!-- A global light source --> <include> <uri>model://sun</uri> </include> <!-- A ground plane --> <include> <uri>model://ground_plane</uri> </include> <include> <uri>model://asphalt_plane</uri> </include> <!--add iris model for example --> <include> <uri>model://iris</uri> <pose>1.01 0.98 0.83 0 0 1.14</pose> </include>

Note

Try to add model with gz command, the model add into the world model list but not visible

gz model --spawn-file=iris.sdf --model-name=iaaa -p 1.01 0.98 0.83 0 0 1.14

No comments: