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

Moving the robot joints

After finishing the preceding topics, we can start commanding positions to each joint.

To move a robot joint in Gazebo, we should publish a desired joint value with a message type std_msgs/Float64 to the joint position controller command topics.

Here is an example of moving the fourth joint to 1.0 radians:

$ rostopic pub /seven_dof_arm/joint4_position_controller/command  std_msgs/Float64 1.0  
Figure 10: Moving a joint of the arm in Gazebo

We can also view the joint states of the robot by using the following command:

    $ rostopic echo /seven_dof_arm/joint_states