gazebo.launch 1.9 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?xml version="1.0"?>
  2. <launch>
  3. <!-- Gazebo options -->
  4. <arg name="gazebo_gui" default="true" doc="Start Gazebo GUI"/>
  5. <arg name="paused" default="false" doc="Start Gazebo paused"/>
  6. <arg name="world_name" default="worlds/empty.world" doc="Gazebo world file"/>
  7. <arg name="world_pose" default="-x 0 -y 0 -z 0 -R 0 -P 0 -Y 0" doc="Pose to spawn the robot at"/>
  8. <arg name="initial_joint_positions" default=" -J joint_1 0 -J joint_2 0 -J joint_3 0 -J joint_4 0 -J joint_5 0 -J joint_6 0" doc="Initial joint configuration of the robot"/>
  9. <!-- Start Gazebo paused to allow the controllers to pickup the initial pose -->
  10. <include file="$(find gazebo_ros)/launch/empty_world.launch" pass_all_args="true">
  11. <arg name="paused" value="true"/>
  12. </include>
  13. <!-- Set the robot urdf on the parameter server -->
  14. <param name="robot_description" textfile="$(find robot_config)/config/gazebo_a9.urdf" />
  15. <!-- Unpause the simulation after loading the robot model -->
  16. <arg name="unpause" value="$(eval '' if arg('paused') else '-unpause')" />
  17. <!-- Spawn the robot in Gazebo -->
  18. <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot $(arg unpause) $(arg world_pose) $(arg initial_joint_positions)"
  19. respawn="false" output="screen" />
  20. <!-- Load the controller parameters onto the parameter server -->
  21. <rosparam file="$(find robot_config)/config/gazebo_controllers.yaml" />
  22. <include file="$(dirname)/ros_controllers.launch"/>
  23. <!-- Spawn the Gazebo ROS controllers -->
  24. <node name="gazebo_controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="joint_state_controller" />
  25. <!-- Given the published joint states, publish tf for the robot links -->
  26. <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" />
  27. </launch>