Learning Robotics using Python
上QQ阅读APP看书,第一时间看更新

Testing Gazebo with the ROS interface

Assuming that the ROS environment is properly set up, we can start roscore before starting Gazebo using the following command:

    $ roscore  

The following command will run Gazebo using ROS:

    $ rosrun gazebo_ros gazebo  

Gazebo runs two executables-the Gazebo server and the Gazebo client. The Gazebo server will execute the simulation process and the Gazebo client can be the Gazebo GUI. Using the previous command, the Gazebo client and server will run in parallel.

The Gazebo GUI is shown in the following screenshot:

The Gazebo simulator

After starting Gazebo, the following topics will be generated:

$ rostopic list  
/gazebo/link_states  
/gazebo/model_states  
/gazebo/parameter_descriptions  
/gazebo/parameter_updates  
/gazebo/set_link_state  
/gazebo/set_model_state  

We can run the server and client separately using the following commands:

  • Run the Gazebo server using the following command:
    $ rosrun gazebo_ros gzserver  
  • Run the Gazebo client using the following command:
    $ rosrun gazebo_ros gzclient