Project

General

Profile

Planning API functions description » History » Version 1

Kévin Desormeaux, 2021-06-11 11:26

1 1 Kévin Desormeaux
h1. Planning API functions description
2
3
h2. Master branch
4
5
The whole CM2P stack can be launched with a simple launch file. The launch files are available in this package (dual_arm_planning_api/launch).
6
There is two of them. One is for launching CM2P in simulation mode. 
7
8
<pre>
9
roslaunch dual_arm_planning_api dual_arm_planning_api_simu.launch
10
</pre>
11
12
The other is for launching CM2P with the real robots. *The two instances of CM2C must be running beforehand so that the controllers are spawned.* 
13
14
<pre>
15
roslaunch dual_arm_planning_api dual_arm_planning_api.launch
16
</pre>
17
18
Now the dual_arm_planning_api node is running. It is necessary to run the following rosservice in another terminal to finish the initialization of the node:
19
20
<pre>
21
rosservice call /dual_arm_planning_api/init "{}"
22
</pre>
23
24
This takes a few seconds to load the environment, the frames etc. You should see all of this pop in Rviz.
25
After that the node is ready to take commands.
26
27
28
We can start with a left pick or a right pick.
29
30
<pre>
31
rostopic pub /dual_arm_planning_api/PickLeft/goal dual_arm_planning_api/PickActionGoal "header:
32
  seq: 0
33
  stamp:
34
    secs: 0
35
    nsecs: 0
36
  frame_id: ''
37
goal_id:
38
  stamp:
39
    secs: 0
40
    nsecs: 0
41
  id: ''
42
goal:
43
  planning_time: 10.0
44
  pre_grasp_approach_direction:
45
    x: 0.0
46
    y: 0.0
47
    z: 1.0
48
  pre_grasp_approach_distance: 0.1"
49
</pre>
50
51
First you can notice that i use rostopic pub instead of rosaction call. The reason is that with rostopic pub we can have autocompletion in the terminal (with tab) which is very useful when we have a lot of arguments.
52
But most importantly you will notice that there is no pose defined for the grasp frame. This is because there is one defined during the initialization for each arm. 
53
But you can change it whenever you want with the following service:
54
55
<pre>
56
rosservice call /dual_arm_planning_api/SetLeftGrasp  "position:
57
  x: 0.0
58
  y: 0.0
59
  z: 0.0
60
orientation:
61
  x: 0.0
62
  y: 0.0
63
  z: 0.0"
64
</pre>