Skip to content

Commit 0fed09d

Browse files
committed
Unify Python demo scripts
1 parent 93ef98a commit 0fed09d

16 files changed

+50
-52
lines changed

core/doc/tutorials/properties.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ You can obtain a reference to the the PropertyMap of a stage like so
9797
:start-after: [propertyTut10]
9898
:end-before: [propertyTut10]
9999

100-
.. literalinclude:: ../../../demo/scripts/properties.py
101-
:language: python
102-
:start-after: [propertyTut11]
103-
:end-before: [propertyTut11]
104-
105100

106101
As mentioned, each stage contains a PropertyMap.
107102
Stages communicate to each other via their interfaces.

demo/config/mtc.rviz

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ Panels:
2323
Name: Motion Planning Tasks
2424
Tasks View:
2525
property_splitter:
26-
- 600
26+
- 643
2727
- 0
2828
solution_sorting:
2929
column: 1
3030
order: 0
3131
solutions_splitter:
32-
- 223
33-
- 72
32+
- 316
33+
- 102
3434
solutions_view_columns: ~
3535
tasks_view_columns:
36-
- 107
37-
- 38
36+
- 194
3837
- 38
3938
- 38
39+
- 44
4040
Preferences:
4141
PromptSaveOnExit: true
4242
Toolbars:
@@ -153,6 +153,10 @@ Visualization Manager:
153153
Markers:
154154
All at once?: false
155155
Value: true
156+
approach: true
157+
lift: true
158+
place: true
159+
retract: true
156160
Name: Motion Planning Tasks
157161
Robot:
158162
Fixed Robot Color: 150; 50; 150
@@ -238,7 +242,7 @@ Visualization Manager:
238242
State Display Time: REALTIME
239243
Task Solution Topic: /mtc_tutorial/solution
240244
Tasks:
241-
{}
245+
pick + place: 24
242246
Trail Step Size: 1
243247
Value: true
244248
Enabled: true
@@ -289,9 +293,9 @@ Window Geometry:
289293
collapsed: false
290294
Motion Planning Tasks - Slider:
291295
collapsed: false
292-
QMainWindow State: 000000ff00000000fd00000002000000000000015600000303fc020000000efc0000003d00000303000000e60100001cfa000000000100000002fb000000100044006900730070006c0061007900730100000000000001770000015600fffffffb0000000a005600690065007700730100000000ffffffff0000010000fffffffb0000000800480065006c00700000000342000000bb0000006e00fffffffb0000000c00430061006d00650072006100000002ff000001610000000000000000fb0000001e004d006f00740069006f006e00200050006c0061006e006e0069006e00670100000374000001890000000000000000fb0000002e004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d00200053006c0069006400650072010000026f000000480000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e00670000000294000002410000000000000000fb00000024005200760069007a00560069007300750061006c0054006f006f006c0073004700750069000000027d0000004b0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000034f000001fb0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000032d000001fb0000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000003c005400720061006a006500630074006f007200790020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb000000120020002d00200053006c00690064006500720000000000ffffffff0000000000000000fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067000000013d000001a60000000000000000000000010000012b00000303fc0200000002fb0000002a004d006f00740069006f006e00200050006c0061006e006e0069006e00670020005400610073006b0073010000003d00000292000000e800fffffffb0000003c004d006f00740069006f006e00200050006c0061006e006e0069006e00670020005400610073006b00730020002d00200053006c006900640065007201000002d50000006b0000004100ffffff0000031d0000030300000001000000020000000100000002fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
296+
QMainWindow State: 000000ff00000000fd00000002000000000000015600000303fc020000000efc0000003d00000303000000e60100001cfa000000000100000002fb000000100044006900730070006c0061007900730100000000000001770000015600fffffffb0000000a005600690065007700730100000000ffffffff0000010000fffffffb0000000800480065006c00700000000342000000bb0000006e00fffffffb0000000c00430061006d00650072006100000002ff000001610000000000000000fb0000001e004d006f00740069006f006e00200050006c0061006e006e0069006e00670100000374000001890000000000000000fb0000002e004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d00200053006c0069006400650072010000026f000000480000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e00670000000294000002410000000000000000fb00000024005200760069007a00560069007300750061006c0054006f006f006c0073004700750069000000027d0000004b0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000034f000001fb0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000032d000001fb0000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000003c005400720061006a006500630074006f007200790020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb000000120020002d00200053006c00690064006500720000000000ffffffff0000000000000000fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067000000013d000001a6000000000000000000000001000001a600000303fc0200000002fb0000002a004d006f00740069006f006e00200050006c0061006e006e0069006e00670020005400610073006b0073010000003d000002bc000000e700fffffffb0000003c004d006f00740069006f006e00200050006c0061006e006e0069006e00670020005400610073006b00730020002d00200053006c006900640065007201000002ff000000410000004100ffffff000002a20000030300000001000000020000000100000002fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
293297
Views:
294298
collapsed: false
295299
Width: 1450
296-
X: 1920
297-
Y: 28
300+
X: 2560
301+
Y: 9

demo/scripts/alternatives.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
from py_binding_tools import roscpp_init
66
import time
77

8-
roscpp_init("mtc_tutorial_alternatives")
8+
roscpp_init("mtc_tutorial")
99

1010
# Use the joint interpolation planner
1111
jointPlanner = core.JointInterpolationPlanner()
1212

1313
# Create a task
1414
task = core.Task()
15+
task.name = "alternatives"
1516

1617
# Start from current robot state
1718
currentState = stages.CurrentState("current state")

demo/scripts/cartesian.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
# [cartesianTut3]
2525
task = core.Task()
26+
task.name = "cartesian"
2627

2728
# start from current robot state
2829
task.add(stages.CurrentState("current state"))

demo/scripts/compute_ik.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22
# -*- coding: utf-8 -*-
33

44
from moveit.task_constructor import core, stages
5-
from geometry_msgs.msg import PoseStamped, Pose, Vector3
5+
from geometry_msgs.msg import PoseStamped, Pose, Point
66
from std_msgs.msg import Header
77
import time
88

99
from py_binding_tools import roscpp_init
1010

11-
roscpp_init("mtc_tutorial_compute_ik")
11+
roscpp_init("mtc_tutorial")
1212

1313
# Specify the planning group
1414
group = "panda_arm"
1515

1616
# Create a task
1717
task = core.Task()
18+
task.name = "compute IK"
1819

1920
# Add a stage to retrieve the current state
2021
task.add(stages.CurrentState("current state"))
@@ -32,7 +33,7 @@
3233
generator.setMonitoredStage(task["current state"])
3334
# Configure target pose
3435
# [propertyTut13]
35-
pose = Pose(position=Vector3(z=0.2))
36+
pose = Pose(position=Point(z=0.2))
3637
generator.pose = PoseStamped(header=Header(frame_id="panda_link8"), pose=pose)
3738
# [propertyTut13]
3839

demo/scripts/constrained.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
planner = core.PipelinePlanner()
1717

1818
task = core.Task()
19+
task.name = "constrained"
20+
1921
task.add(stages.CurrentState("current state"))
2022

2123
co = CollisionObject()

demo/scripts/current_state.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
from py_binding_tools import roscpp_init
66
import time
77

8-
roscpp_init("mtc_tutorial_current_state")
8+
roscpp_init("mtc_tutorial")
99

1010
# Create a task
1111
task = core.Task()
12+
task.name = "current state"
1213

1314
# Get the current robot state
1415
currentState = stages.CurrentState("current state")

demo/scripts/fallbacks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
from py_binding_tools import roscpp_init
66
import time
77

8-
roscpp_init("mtc_tutorial_fallbacks")
8+
roscpp_init("mtc_tutorial")
99

1010
# use cartesian and joint interpolation planners
1111
cartesianPlanner = core.CartesianPath()
1212
jointPlanner = core.JointInterpolationPlanner()
1313

1414
# initialize the mtc task
1515
task = core.Task()
16+
task.name = "fallbacks"
1617

1718
# add the current planning scene state to the task hierarchy
1819
currentState = stages.CurrentState("Current State")

demo/scripts/fix_collision_objects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
from py_binding_tools import roscpp_init
66
import time
77

8-
roscpp_init("mtc_tutorial_current_state")
8+
roscpp_init("mtc_tutorial")
99

1010
# Create a task
1111
task = core.Task()
12+
task.name = "fix collision objects"
1213

1314
# Add the current state to the task hierarchy
1415
task.add(stages.CurrentState("current state"))

demo/scripts/fixed_state.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
from moveit.core.planning_scene import PlanningScene
88
import time
99

10-
roscpp_init("mtc_tutorial_current_state")
10+
roscpp_init("mtc_tutorial")
1111

1212

1313
# Create a task
1414
task = core.Task()
15+
task.name = "fixed state"
1516

1617
# [initAndConfigFixedState]
1718
# Initialize a PlanningScene for use in a FixedState stage

0 commit comments

Comments
 (0)