romeo_wrapper.py
Go to the documentation of this file.
1 #
2 # Copyright (c) 2015-2016 CNRS
3 #
4 
5 import numpy as np
6 
7 from . import pinocchio_pywrap_default as pin
8 from .robot_wrapper import RobotWrapper
9 
10 
12  def __init__(self, filename, package_dirs=None, verbose=False):
13  self.initFromURDF(
14  filename,
15  package_dirs=package_dirs,
16  root_joint=pin.JointModelFreeFlyer(),
17  verbose=verbose,
18  )
19  self.q0 = np.array(
20  [
21  0,
22  0,
23  0.840252,
24  0,
25  0,
26  0,
27  1, # Free flyer
28  0,
29  0,
30  -0.3490658,
31  0.6981317,
32  -0.3490658,
33  0, # left leg
34  0,
35  0,
36  -0.3490658,
37  0.6981317,
38  -0.3490658,
39  0, # right leg
40  0, # chest
41  1.5,
42  0.6,
43  -0.5,
44  -1.05,
45  -0.4,
46  -0.3,
47  -0.2, # left arm
48  0,
49  0,
50  0,
51  0, # head
52  1.5,
53  -0.6,
54  0.5,
55  1.05,
56  -0.4,
57  -0.3,
58  -0.2, # right arm
59  ]
60  )
61 
63  "lh": "LWristPitch",
64  "rh": "RWristPitch",
65  "rf": "RAnkleRoll",
66  "lf": "LAnkleRoll",
67  }
68 
69  for op, name in self.opCorrespondances.items():
70  self.__dict__[op] = self.index(name)
71  # self.__dict__["_M" + op] = types.MethodType(
72  # lambda s, q: s.position(q, idx), self
73  # )
74 
75  # --- SHORTCUTS ---
76  def Mrh(self, q):
77  return self.position(q, self.rh)
78 
79  def Jrh(self, q):
80  return self.jacobian(q, self.rh)
81 
82  def wJrh(self, q):
83  return pin.jacobian(self.model, self.data, self.rh, q, False)
84 
85  def vrh(self, q, v):
86  return self.velocity(q, v, self.rh)
87 
88  def Jlh(self, q):
89  return self.jacobian(q, self.lh)
90 
91  def Mlh(self, q):
92  return self.position(q, self.lh)
93 
94  def Jlf(self, q):
95  return self.jacobian(q, self.lf)
96 
97  def Mlf(self, q):
98  return self.position(q, self.lf)
99 
100  def Jrf(self, q):
101  return self.jacobian(q, self.rf)
102 
103  def Mrf(self, q):
104  return self.position(q, self.rf)
105 
106 
107 __all__ = ["RomeoWrapper"]
pinocchio.romeo_wrapper.RomeoWrapper.Mrf
def Mrf(self, q)
Definition: romeo_wrapper.py:103
pinocchio.robot_wrapper.RobotWrapper.index
def index(self, name)
Definition: bindings/python/pinocchio/robot_wrapper.py:352
pinocchio.robot_wrapper.RobotWrapper
Definition: bindings/python/pinocchio/robot_wrapper.py:15
pinocchio.robot_wrapper.RobotWrapper.velocity
def velocity(self, q, v, index, update_kinematics=True, reference_frame=pin.ReferenceFrame.LOCAL)
Definition: bindings/python/pinocchio/robot_wrapper.py:168
pinocchio.romeo_wrapper.RomeoWrapper.Jlf
def Jlf(self, q)
Definition: romeo_wrapper.py:94
pinocchio.robot_wrapper.RobotWrapper.data
data
Definition: bindings/python/pinocchio/robot_wrapper.py:346
pinocchio.romeo_wrapper.RomeoWrapper.Mlf
def Mlf(self, q)
Definition: romeo_wrapper.py:97
pinocchio.romeo_wrapper.RomeoWrapper.Jrh
def Jrh(self, q)
Definition: romeo_wrapper.py:79
pinocchio.romeo_wrapper.RomeoWrapper.Mlh
def Mlh(self, q)
Definition: romeo_wrapper.py:91
pinocchio.robot_wrapper.RobotWrapper.q0
q0
Definition: bindings/python/pinocchio/robot_wrapper.py:84
pinocchio.romeo_wrapper.RomeoWrapper.opCorrespondances
opCorrespondances
Definition: romeo_wrapper.py:62
pinocchio.romeo_wrapper.RomeoWrapper.wJrh
def wJrh(self, q)
Definition: romeo_wrapper.py:82
pinocchio.romeo_wrapper.RomeoWrapper.Jrf
def Jrf(self, q)
Definition: romeo_wrapper.py:100
pinocchio.romeo_wrapper.RomeoWrapper.__init__
def __init__(self, filename, package_dirs=None, verbose=False)
Definition: romeo_wrapper.py:12
pinocchio.robot_wrapper.RobotWrapper.initFromURDF
def initFromURDF(self, filename, *args, **kwargs)
Definition: bindings/python/pinocchio/robot_wrapper.py:24
pinocchio.romeo_wrapper.RomeoWrapper
Definition: romeo_wrapper.py:11
pinocchio.romeo_wrapper.RomeoWrapper.Jlh
def Jlh(self, q)
Definition: romeo_wrapper.py:88
pinocchio.robot_wrapper.RobotWrapper.model
model
Definition: bindings/python/pinocchio/robot_wrapper.py:75
pinocchio.romeo_wrapper.RomeoWrapper.Mrh
def Mrh(self, q)
Definition: romeo_wrapper.py:76
pinocchio.romeo_wrapper.RomeoWrapper.vrh
def vrh(self, q, v)
Definition: romeo_wrapper.py:85


pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:32