Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorials:intermediate:moveit [2015/06/03 13:22] – mpomarlan | tutorials:intermediate:moveit [2016/03/07 18:58] – [Initializing cram_moveit] gkazhoya | ||
---|---|---|---|
Line 3: | Line 3: | ||
**Description: | **Description: | ||
- | **Next Tutorial: | + | **Next Tutorial: |
===== Setting up your system ===== | ===== Setting up your system ===== | ||
Line 11: | Line 11: | ||
Fortunately, | Fortunately, | ||
- | You will also need the tutorial initialization code. Go to the src folder of your ROS workspace and check whether the cram_tutorials folder exists, and whether it contains cram_intermediate_tutorials. If not, retrieve this code [[https:// | + | You will also need the tutorial initialization code. Go to the src folder of your ROS workspace and check whether the cram_tutorials folder exists, and whether it contains cram_intermediate_tutorials. If not, retrieve this code [[https:// |
===== Initializing cram_moveit ===== | ===== Initializing cram_moveit ===== | ||
Line 23: | Line 23: | ||
In another tab, run | In another tab, run | ||
- | < | + | < |
- | roslaunch | + | roslaunch |
</ | </ | ||
Line 105: | Line 105: | ||
Play a bit with the robot in RViz: move one arm (remember to click Plan and Execute to make sure the movement actually happens!), then use joint-states to look at some joint on the arm and see that it changes. | Play a bit with the robot in RViz: move one arm (remember to click Plan and Execute to make sure the movement actually happens!), then use joint-states to look at some joint on the arm and see that it changes. | ||
+ | |||
+ | Another function you can use to get the current robot state is get-planning-scene-info. To get a robot state ROS message (as opposed to a list of name-value pairs), use the following: | ||
+ | |||
+ | <code lisp> | ||
+ | (second (first (get-planning-scene-info : | ||
+ | </ | ||
==== Moving the robot ==== | ==== Moving the robot ==== | ||
Line 153: | Line 159: | ||
" | " | ||
" | " | ||
- | tuti: | + | |
0.1 | 0.1 | ||
1.5 | 1.5 | ||
Line 362: | Line 368: | ||
You may use robot states different than the current one when, for example, you want to see whether the robot can reach a location on a table with the robot base placed at various positions around that table. | You may use robot states different than the current one when, for example, you want to see whether the robot can reach a location on a table with the robot base placed at various positions around that table. | ||
- | compute-ik will also account for collisions with objects in the environment, | + | compute-ik will also account for collisions with objects in the environment, |
+ | |||
+ | Sometimes you may want to tell MoveIt! to not do any collision checking during IK queries. You can do this by using the key parameter : | ||
+ | |||
+ | <code lisp> | ||
+ | (compute-ik link-name planning-group-name pose : | ||
+ | </ | ||
==== Manipulating the environment ==== | ==== Manipulating the environment ==== | ||
Line 462: | Line 474: | ||
when you want to clear the objects you've added to the MoveIt! planning scene from CRAM, but want to keep cram-moveit' | when you want to clear the objects you've added to the MoveIt! planning scene from CRAM, but want to keep cram-moveit' | ||
- | ==== Collision checking ==== | + | So far we've only written to MoveIt!' |
- | (Work in progress: MoveIt! offers | + | <code lisp> |
+ | (get-planning-scene-info : | ||
+ | </ | ||
+ | |||
+ | for which the response will look something like | ||
+ | |||
+ | <code lisp> | ||
+ | ((" | ||
+ | </ | ||
+ | |||
+ | Notice how the response is again a list of named pairs. What is in the list depends on the nature of the query. For a query like | ||
+ | |||
+ | <code lisp> | ||
+ | (get-planning-scene-info | ||
+ | </ | ||
+ | |||
+ | you will instead get as a response (assuming you still have the cube object in the planning scene) | ||
+ | |||
+ | <code lisp> | ||
+ | ((" | ||
+ | </ | ||
+ | |||
+ | so as you can see the partner for "world object names" is a list of object names. | ||
+ | |||
+ | Earlier in this tutorial we've also seen | ||
+ | |||
+ | <code lisp> | ||
+ | (get-planning-scene-info :robot-state T) | ||
+ | </ | ||
+ | |||
+ | which puts a pair formed | ||
+ | |||
+ | You can combine several queries about the planning scene into one: | ||
+ | |||
+ | <code lisp> | ||
+ | (get-planning-scene-info : | ||
+ | </ | ||
+ | |||
+ | and the response will be a concatenation of the responses of the individual queries: | ||
+ | |||
+ | <code lisp> | ||
+ | ((" | ||
+ | | ||
+ | </ | ||
+ | |||
+ | When you issue several queries in a get-planning-scene-info call, do NOT rely on the order of the pairs in the list; use the first element of the pair to identify it. The docstring for get-planning-scene-info will explain what queries are available and what responses they produce. | ||
== Next == | == Next == | ||
- | (coming soon) | + | We've mentioned the topic of obstacles and collisions, [[tutorials: |
+ |