Size: 4061
Comment:
|
Size: 4057
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 === |
!
![]() |
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.
First initialize moveit_commander and rospy.
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.
1 robot = moveit_commander.RobotCommander()
Instantiate a PlanningSceneInterface object. This object is an interface to the world surrounding the robot.
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.
1 group = moveit_commander.MoveGroupCommander("arm")
We create this DisplayTrajectory publisher which is used below to publish trajectories for RVIZ to visualize.
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.
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
1 print "============ Reference frame: %s" % group.get_planning_frame()
We can also print the name of the end-effector link for this group
1 print "============ Reference frame: %s" % group.get_end_effector_link()
We can get a list of all the groups in the robot
1 print "============ Robot Groups:"
2 print robot.get_group_names()
Sometimes for debugging it is useful to print the entire state of the robot.
1 print "============ Printing robot state"
2 print robot.get_current_state()
3 print "============"