• Diff for "ric_moveit/komodo moveit"
Differences between revisions 24 and 25
Revision 24 as of 2015-11-22 07:32:40
Size: 4061
Editor: tomwiss1231
Comment:
Revision 25 as of 2015-11-22 07:33:44
Size: 4057
Editor: tomwiss1231
Comment:
Deletions are marked like this. Additions are marked like this.
Line 40: Line 40:
==== Setup ==== === Setup ===
Line 92: Line 92:
==== Getting Basic Information ==== === Getting Basic Information ===

!

(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Moveit Tutorial

Description: In this tutorial we will explain about our moveit package, and how to work with it.

Keywords: ric_moveit,komodo moveit

Tutorial Level: INTERMEDIATE

Getting started

First of all you need to install the moveit itself, installing moveit is easy just open a new terminal and type the following command

$ sudo apt-get install ros-indigo-moveit-full

Moveit

NOTE: Right now there only two komodo model which support moveit functionality

  • Komodo with arm.
  • Komodo with elevator and arm.

Moveit api

About the API

In MoveIt!, the primary user interface is through the RobotCommander class. It provides functionality for most operations that a user may want to carry out, specifically setting joint or pose goals, creating motion plans, moving the robot, adding objects into the environment and attaching/detaching objects from the robot.

Setup

To use the python interface to move_group, import the moveit_commander module. We also import rospy and some messages that we will use.

Toggle line numbers
   1 import sys
   2 import copy
   3 import rospy
   4 import moveit_commander
   5 import moveit_msgs.msg
   6 import geometry_msgs.msg

First initialize moveit_commander and rospy.

Toggle line numbers
   1 print "============ Starting tutorial setup"
   2 moveit_commander.roscpp_initialize(sys.argv)
   3 rospy.init_node('move_group_python_interface_tutorial', anonymous=True)

Instantiate a RobotCommander object. This object is an interface to the robot as a whole.

Toggle line numbers
   1 robot = moveit_commander.RobotCommander()

Instantiate a PlanningSceneInterface object. This object is an interface to the world surrounding the robot.

Toggle line numbers
   1 scene = moveit_commander.PlanningSceneInterface()

Instantiate a MoveGroupCommander object. This object is an interface to one group of joints. In this case the group is the joints in the arm. This interface can be used to plan and execute motions on the arm.

Toggle line numbers
   1 group = moveit_commander.MoveGroupCommander("arm")

We create this DisplayTrajectory publisher which is used below to publish trajectories for RVIZ to visualize.

Toggle line numbers
   1 display_trajectory_publisher = rospy.Publisher('/move_group/display_planned_path',                                      moveit_msgs.msg.DisplayTrajectory)

Wait for RVIZ to initialize. This sleep is ONLY to allow Rviz to come up.

Toggle line numbers
   1 print "============ Waiting for RVIZ..."
   2 rospy.sleep(10)
   3 print "============ Starting tutorial "

Getting Basic Information

We can get the name of the reference frame for this robot

Toggle line numbers
   1 print "============ Reference frame: %s" % group.get_planning_frame()

We can also print the name of the end-effector link for this group

Toggle line numbers
   1 print "============ Reference frame: %s" % group.get_end_effector_link()

We can get a list of all the groups in the robot

Toggle line numbers
   1 print "============ Robot Groups:"
   2 print robot.get_group_names()

Sometimes for debugging it is useful to print the entire state of the robot.

Toggle line numbers
   1 print "============ Printing robot state"
   2 print robot.get_current_state()
   3 print "============"

Wiki: ric_moveit/komodo moveit (last edited 2015-11-22 07:41:59 by tomwiss1231)