reach_right_hand.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
4 
5 from dynamic_graph.sot.dynamic_pinocchio.tools import (
6  checkFinalConfiguration,
7  clt,
8  reach,
9  robot,
10  solver,
11  timeStep,
12 )
13 
14 # Move right wrist
15 reach(robot, "right-wrist", 0.25, 0, 0.1)
16 
17 # Push tasks
18 # Operational points tasks
19 solver.sot.push(robot.tasks["right-ankle"].name)
20 solver.sot.push(robot.tasks["left-ankle"].name)
21 solver.sot.push(robot.tasks["right-wrist"].name)
22 solver.sot.push(robot.tasks["left-wrist"].name)
23 
24 # Center of mass
25 solver.sot.push(robot.comTask.name)
26 
27 # Main.
28 # Main loop
29 for i in range(500):
30  robot.device.increment(timeStep)
31 
32  if clt:
33  clt.updateElementConfig("hrp", robot.smallToFull(robot.device.state.value))
34 
35 finalPosition = (
36  -0.015361,
37  -0.0049075500000000001,
38  -0.00047065200000000001,
39  -0.0172946,
40  -0.020661800000000001,
41  0.0374547,
42  -0.037641599999999997,
43  0.025434399999999999,
44  -0.45398100000000002,
45  0.86741800000000002,
46  -0.39213799999999999,
47  -0.0089269499999999995,
48  -0.037646100000000002,
49  0.025648199999999999,
50  -0.46715499999999999,
51  0.87717599999999996,
52  -0.38872200000000001,
53  -0.0091408199999999992,
54  0.080488199999999996,
55  -0.18355399999999999,
56  -0.00036695100000000002,
57  -0.0056776600000000002,
58  -0.12173299999999999,
59  -0.23972599999999999,
60  -0.00637303,
61  -0.56908000000000003,
62  0.00296262,
63  0.19108900000000001,
64  0.100088,
65  0.23896800000000001,
66  0.21485599999999999,
67  -0.18973400000000001,
68  -0.49457699999999999,
69  0.040646799999999997,
70  0.16970299999999999,
71  0.100067,
72 )
73 
74 checkFinalConfiguration(robot.device.state.value, finalPosition)
75 print("Exiting.")
dynamic_pinocchio.tools.checkFinalConfiguration
def checkFinalConfiguration(position, finalPosition)
Definition: tools.py:117
dynamic_pinocchio.tools.reach
def reach(robot, op, tx, ty, tz)
Definition: tools.py:96


sot-dynamic-pinocchio
Author(s): Olivier Stasse
autogenerated on Fri Jul 28 2023 02:10:01