Skip to content

MoveIt Tutorial

rethink-kmaroney edited this page Jul 17, 2013 · 42 revisions

MoveIt! Logo
Please visit the MoveIt! homepage for more information

Summary

This tutorial describes how to use the Baxter Research Robot with MoveIt! the standard ROS motion planning framework.

Installation/Prerequisites

Check out the Baxter MoveIt configuration package

    $ git clone https://github.com/ros-planning/moveit_robots.git
    # Either Add moveit_robots to your ROS_PACKAGE_PATH or place is below your sdk-example directory

The follow debian packages are required for using MoveIt! with Baxter

    $ sudo apt-get install ros-groovy-moveit-full
    $ sudo apt-get install ros-groovy-pr2-moveit-plugins

Overview

MoveIt! motion planning framework provides capabilities including Kinematics (IK, FK, Jacobian), Motion Planning (OMPL, SBPL, CHOMP) integrated at MoveIt! plugins, Environment Representation (robot representation, environment representation, collision checking, contraint evaluation), execution using move_groups, benchmarking, warehouse database for storage (scenes, robot states, motion plans), a C++/Python API and more!

Baxter now supports using MoveIt! through the addition of the configurable joint trajectory action server, and hosting of the necessary MoveIt! configuration files on ros_planning/moveit_robots.

This tutorial will focus on the MoveIt! Rviz plugin as an introduction to some of the capabilities of MoveIt!

####Baxter Planning Groups##### Describes the joints considered during motion planning. These groups by the SRDF for Baxter. Including planning groups, additional collision checking information, and default configurations.

Planning Groups

  • both_arms
    • left_arm
    • right_arm
  • left_arm
    • left_s0
    • left_s1
    • left_e0
    • left_e1
    • left_w0
    • left_w1
    • left_w2
    • left_hand
    • left_endpoint
  • right_arm
    • right_s0
    • right_s1
    • right_e0
    • right_e1
    • right_w0
    • right_w1
    • right_w2
    • right_hand
    • right_endpoint
  • left_hand
    • left_gripper
  • right_hand
    • right_gripper

You can view the SRDF at any time:

    $ rosed baxter_moveit_config baxter.srdf

Tutorial

Verify that the robot is enabled from an RSDK terminal session, ex:

    $ rosrun tools enable_robot.py -e

Start the joint trajectory controller, ex:

 $ rosrun baxter_interface trajectory_controller.py

In another RSDK terminal session, Launch the rviz MoveIt! plugin, ex:

    $ roslaunch baxter_moveit_config demo_baxter.launch

Note: Do not launching baxter_moveit_config demo_sim.launch with the ROS_MASTER_URI set to the robot (ie. using the robot's ros master) as this starts a new joint_state_publisher/robot_state_publisher causing the robot's internal joint_state_publisher/robot_state_publisher be preempted, essentially stopping the ability to move Baxter's joints until a reboot. Please use baxter_moveit_config demo_baxter.launch to run this demonstration on Baxter.

The Rviz gui will then open showing Baxter with interactive markers: Baxter MoveIt rviz start

You will see the goal state for the motion planning, shown for each plan group in Orange.

You can then move Baxter's arms to a planning goal by clicking and dragging the arrows (Cartesian) and rings (orientation) of the interactive markers. Kinematic/collision checking is happening simultaneously and will not allow self collisions (links will turn red), or goal states out of the reachable workspace (inability to drag and endpoint/gripper will turn red).

Baxter MoveIt rviz interact

Interfaces

ROS APIs

See the API Reference page for details.

  • Joint Trajectory Action Server - /sdk/robot/limb/right/follow_joint_trajectory [control_msgs/FollowJointTrajectoryAction]
  • Joint Trajectory Action Server - /sdk/robot/limb/left/follow_joint_trajectory [control_msgs/FollowJointTrajectoryAction]

baxter_interface APIs

  • JointTrajectoryActionServer class: joint_trajectory_action_server.py

Related Examples/Tutorials

Troubleshooting

###The arm is not executing the trajectory Verify that the robot is enabled:

rosrun tools enable_robot.py -e

Verify that the trajectory controller has been started:

rosrun baxter_interface trajectory_controller.py

Clone this wiki locally