Mastering ROS for Robotics Programming(Second Edition)
上QQ阅读APP看书,第一时间看更新

Simulating the robotic arm using Gazebo and ROS

In the previous chapter, we designed a seven-DOF arm. In this section, we will simulate the robot in Gazebo using ROS.

Before starting with Gazebo and ROS, we should install the following packages to work with Gazebo and ROS:

$ sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-msgs ros-kinetic-gazebo-plugins ros-kinetic-gazebo-ros-control  

The default version installed from kinetic ROS packages is Gazebo 7.0. The use of each package is as follows:

  • gazebo_ros_pkgs: This contains wrappers and tools for interfacing ROS with Gazebo
  • gazebo-msgs: This contains messages and service data structures for interfacing with Gazebo from ROS
  • gazebo-plugins: This contains Gazebo plugins for sensors, actuators, and so on.
  • gazebo-ros-control: This contains standard controllers to communicate between ROS and Gazebo

After installation, check whether Gazebo is properly installed using the following commands:

    $ roscore & rosrun gazebo_ros gazebo  

These commands will open the Gazebo GUI. If we have the Gazebo simulator, we can proceed to develop the simulation model of the seven-DOF arm for Gazebo.