reach_left_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 left wrist
15 reach(robot, "left-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.015183500000000001,
37  -0.00037148200000000002,
38  -0.00065935600000000005,
39  0.0137784,
40  -0.022388600000000002,
41  -0.036052000000000001,
42  0.036032099999999997,
43  -0.012359200000000001,
44  -0.466526,
45  0.87994899999999998,
46  -0.39055299999999998,
47  -0.00060408700000000001,
48  0.036028499999999998,
49  -0.0121996,
50  -0.45257900000000001,
51  0.86809899999999995,
52  -0.39265,
53  -0.00076379799999999999,
54  -0.084612699999999999,
55  -0.18716099999999999,
56  0.00038832500000000002,
57  -0.0054475900000000004,
58  0.23852599999999999,
59  -0.19830900000000001,
60  0.17092299999999999,
61  -0.48823699999999998,
62  -0.014739800000000001,
63  0.170987,
64  0.100064,
65  -0.117492,
66  0.24870200000000001,
67  0.016264399999999998,
68  -0.56795700000000005,
69  0.0040012399999999997,
70  0.18956200000000001,
71  0.100089,
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