forked from jvrc/model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjvrc1_model.py
52 lines (46 loc) · 2.85 KB
/
jvrc1_model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
exec(open('/choreonoid_ws/install/share/irsl_choreonoid/sample/irsl_import.py').read())
class JVRC1(ru.ImportedRobotModel):
def __init__(self, robot=None, item=True, world=False, **kwargs):
super().__init__(robot=robot, item=item, world=world, **kwargs)
def _init_ending(self, **kwargs): ## override
self.off_ = (-0.02 + -0.08773589462041854) ## offset from ankle_joint to bottom of foot-plate
self.registerEndEffector('lleg', ## end-effector
'L_ANKLE_P', ## tip-link
tip_link_to_eef = coordinates(fv(0, 0, self.off_)),
joint_tuples = (('L_HIP_P', 'hip-p'),
('L_HIP_R', 'hip-r'),
('L_HIP_Y', 'hip-y'),
('L_KNEE', 'knee-p'),
('L_ANKLE_R', 'ankle-r'),
('L_ANKLE_P', 'ankle-p'),
)
)
self.registerEndEffector('rleg', ## end-effector
'R_ANKLE_P', ## tip-link
tip_link_to_eef = coordinates(fv(0, 0, self.off_)),
joint_tuples = (('R_HIP_P', 'hip-p'),
('R_HIP_R', 'hip-r'),
('R_HIP_Y', 'hip-y'),
('R_KNEE', 'knee-p'),
('R_ANKLE_R', 'ankle-r'),
('R_ANKLE_P', 'ankle-p'),
)
)
##
self.setFrame('rf_point0', 'R_ANKLE_P', coordinates(fv( 0.157, 0.05, self.off_)))
self.setFrame('rf_point1', 'R_ANKLE_P', coordinates(fv( 0.157, -0.05, self.off_)))
self.setFrame('rf_point2', 'R_ANKLE_P', coordinates(fv(-0.095, 0.05, self.off_)))
self.setFrame('rf_point3', 'R_ANKLE_P', coordinates(fv(-0.095, -0.05, self.off_)))
##
self.setFrame('lf_point0', 'L_ANKLE_P', coordinates(fv( 0.157, 0.05, self.off_)))
self.setFrame('lf_point1', 'L_ANKLE_P', coordinates(fv( 0.157, -0.05, self.off_)))
self.setFrame('lf_point2', 'L_ANKLE_P', coordinates(fv(-0.095, 0.05, self.off_)))
self.setFrame('lf_point3', 'L_ANKLE_P', coordinates(fv(-0.095, -0.05, self.off_)))
### settings of model_file
JVRC1.model_file = f'{os.path.dirname(__file__)}/JVRC-1/main.wrl'
### robot_class:
robot_class = JVRC1
### makeRobot(robot=None, **kwargs):
def makeRobot(robot=None, item=True, world=True, **kwargs):
return robot_class(robot, item=item, world=world, **kwargs)