reach_both_hands.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 left wrist
15 reach(robot, "left-wrist", 0.25, 0.25, 0.5)
16 reach(robot, "right-wrist", 0.25, -0.25, 0.5)
17 
18 # Push tasks
19 # Operational points tasks
20 solver.sot.push(robot.tasks["right-ankle"].name)
21 solver.sot.push(robot.tasks["left-ankle"].name)
22 solver.sot.push(robot.tasks["right-wrist"].name)
23 solver.sot.push(robot.tasks["left-wrist"].name)
24 
25 # Center of mass
26 solver.sot.push(robot.comTask.name)
27 
28 # Main.
29 # Main loop
30 for i in range(500):
31  robot.device.increment(timeStep)
32 
33  if clt:
34  clt.updateElementConfig("hrp", robot.smallToFull(robot.device.state.value))
35 
36 finalPosition = (
37  -0.0357296,
38  -0.0024092699999999998,
39  0.033870600000000001,
40  -0.00120006,
41  0.075338500000000003,
42  0.00028531699999999999,
43  2.9108999999999999e-05,
44  0.0053813699999999999,
45  -0.41716799999999998,
46  0.52743700000000004,
47  -0.185608,
48  -0.0041716399999999999,
49  2.9120099999999999e-05,
50  0.0053815199999999999,
51  -0.41625699999999999,
52  0.52549900000000005,
53  -0.184581,
54  -0.0041717899999999999,
55  -0.00306069,
56  -0.54035500000000003,
57  0.00036732799999999999,
58  -0.028043100000000001,
59  -0.69961799999999996,
60  -0.84530499999999997,
61  0.11480700000000001,
62  -0.61734999999999995,
63  0.088004899999999997,
64  1.0022899999999999,
65  0.100354,
66  -0.71066200000000002,
67  0.85328800000000005,
68  -0.109959,
69  -0.60156299999999996,
70  -0.082422700000000002,
71  1.0207200000000001,
72  0.10037500000000001,
73 )
74 
75 checkFinalConfiguration(robot.device.state.value, finalPosition)
76 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