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 as pin
8 from .robot_wrapper import RobotWrapper
9 
10 
12 
13  def __init__(self, filename, package_dirs=None, verbose=False):
14  self.initFromURDF(filename, package_dirs=package_dirs, root_joint=pin.JointModelFreeFlyer(), verbose=verbose)
15  self.q0 = np.array([
16  0, 0, 0.840252, 0, 0, 0, 1, # Free flyer
17  0, 0, -0.3490658, 0.6981317, -0.3490658, 0, # left leg
18  0, 0, -0.3490658, 0.6981317, -0.3490658, 0, # right leg
19  0, # chest
20  1.5, 0.6, -0.5, -1.05, -0.4, -0.3, -0.2, # left arm
21  0, 0, 0, 0, # head
22  1.5, -0.6, 0.5, 1.05, -0.4, -0.3, -0.2, # right arm
23  ])
24 
25  self.opCorrespondances = {"lh": "LWristPitch",
26  "rh": "RWristPitch",
27  "rf": "RAnkleRoll",
28  "lf": "LAnkleRoll",
29  }
30 
31  for op, name in self.opCorrespondances.items():
32  self.__dict__[op] = self.index(name)
33  # self.__dict__['_M'+op] = types.MethodType(lambda s, q: s.position(q,idx),self)
34 
35  # --- SHORTCUTS ---
36  def Mrh(self, q):
37  return self.position(q, self.rh)
38 
39  def Jrh(self, q):
40  return self.jacobian(q, self.rh)
41 
42  def wJrh(self, q):
43  return pin.jacobian(self.model, self.data, self.rh, q, False)
44 
45  def vrh(self, q, v):
46  return self.velocity(q, v, self.rh)
47 
48  def Jlh(self, q):
49  return self.jacobian(q, self.lh)
50 
51  def Mlh(self, q):
52  return self.position(q, self.lh)
53 
54  def Jlf(self, q):
55  return self.jacobian(q, self.lf)
56 
57  def Mlf(self, q):
58  return self.position(q, self.lf)
59 
60  def Jrf(self, q):
61  return self.jacobian(q, self.rf)
62 
63  def Mrf(self, q):
64  return self.position(q, self.rf)
65 
66 __all__ = ['RomeoWrapper']
def __init__(self, filename, package_dirs=None, verbose=False)
def initFromURDF(self, filename, package_dirs=None, root_joint=None, verbose=False, meshLoader=None)
def velocity(self, q, v, index, update_kinematics=True, reference_frame=pin.ReferenceFrame.LOCAL)


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:32