Skip to content

Commit 5f7ac02

Browse files
committed
Add more examples
1 parent 2f10449 commit 5f7ac02

File tree

6 files changed

+15158
-4
lines changed

6 files changed

+15158
-4
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
*******************************************************************************
2+
Full examples
3+
*******************************************************************************
4+
5+
.. note::
6+
7+
The following examples use the `ROS <http://www.ros.org/>`_ backend
8+
and the MoveI! planner with the Franka Emika Panda robots.
9+
Before running them, please make sure you have the :ref:`ROS backend <ros_backend>`
10+
correctly configured and the :ref:`Panda Demo <ros_bundles_list>` started.
11+
12+
The following lists the 4 main features of the integrated motion planning framework:
13+
forward and inverse kinematics, cartesian and kinematic planning including loading
14+
the entire robot model over ROS, and a complete Grasshopper canvas as a playground
15+
for these features.
16+
17+
Forward Kinematics
18+
=====================
19+
20+
.. literalinclude :: files/02_forward_kinematics_ros_loader.py
21+
:language: python
22+
23+
Inverse Kinematics
24+
=====================
25+
26+
.. literalinclude :: files/02_inverse_kinematics_ros_loader.py
27+
:language: python
28+
29+
Plan cartesian motion
30+
=====================
31+
32+
.. literalinclude :: files/04_plan_cartesian_motion_ros_loader.py
33+
:language: python
34+
35+
Plan motion
36+
===========
37+
38+
.. literalinclude :: files/04_plan_motion_ros_loader.py
39+
:language: python
40+
41+
Grasshopper playground
42+
======================
43+
44+
The following Grasshopper canvas demonstrate all these features combined in
45+
a single document, as a reference of how these features could be integrated:
46+
47+
48+
.. raw:: html
49+
50+
<div class="card bg-light">
51+
<div class="card-body">
52+
<div class="card-title">Download</div>
53+
54+
* :download:`Robot playground (Grasshopper) (.GHX) <files/robot-playground.ghx>`
55+
56+
.. raw:: html
57+
58+
</div>
59+
</div>
60+

docs/examples/03_backends_ros/files/02_forward_kinematics_ros_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
robot = Robot(model, semantics=semantics, client=client)
1919

20-
configuration = Configuration.from_revolute_values([-2.238, -1.153, -2.174, 0.185, 0.667, 0.])
20+
configuration = Configuration.from_prismatic_and_revolute_values([0.], [-2.238, -1.153, -2.174, 0.185, 0.667, 0.])
2121

2222
frame_RCF = robot.forward_kinematics(configuration)
2323
frame_WCF = robot.to_world_coords(frame_RCF)

docs/examples/03_backends_ros/files/04_plan_cartesian_motion_ros_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
frames.append(Frame((0.2925, 0.3949, 0.5066), (0, 1, 0), (0, 0, 1)))
2424
frames.append(Frame((0.5103, 0.2827, 0.4074), (0, 1, 0), (0, 0, 1)))
2525

26-
start_configuration = Configuration((0.667, -0.298, 0.336, -2.333, -1.787, 2.123, 0.571), (0, 0, 0, 0, 0, 0, 0))
26+
start_configuration = Configuration.from_revolute_values((0.667, -0.298, 0.336, -2.333, -1.787, 2.123, 0.571))
2727

2828
trajectory = robot.plan_cartesian_motion(frames,
2929
start_configuration,

docs/examples/03_backends_ros/files/04_plan_motion.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,16 @@
2727

2828
print("Computed kinematic path with %d configurations." % len(trajectory.points))
2929
print("Executing this path at full speed would take approx. %.3f seconds." % trajectory.time_from_start)
30+
# print('Executing')
31+
32+
# robot.client.follow_joint_trajectory(
33+
# trajectory, callback=done_handler, errback=errhandler, feedback_callback=handler)
34+
35+
# wait = robot.client.execute_joint_trajectory(trajectory)
36+
37+
# print('Waiting...')
38+
# r = wait.result()
39+
# print('Done waiting...')
40+
41+
# import time
42+
# time.sleep(1)

docs/examples/03_backends_ros/files/04_plan_motion_ros_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
tolerance_position = 0.001
2525
tolerance_axes = [math.radians(1)] * 3
2626

27-
start_configuration = Configuration(
28-
(0.667, -0.298, 0.336, -2.333, -1.787, 2.123, 0.571), (0, 0, 0, 0, 0, 0, 0))
27+
start_configuration = Configuration.from_revolute_values(
28+
(0.667, -0.298, 0.336, -2.333, -1.787, 2.123, 0.571))
2929

3030
# create goal constraints from frame
3131
goal_constraints = robot.constraints_from_frame(frame,

0 commit comments

Comments
 (0)