Skip to content

Commit c558d81

Browse files
authored
Set panda's end effector (#634)
1 parent 1bd9145 commit c558d81

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

skrobot/models/panda.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from cached_property import cached_property
2+
import numpy as np
23

4+
from ..coordinates import CascadedCoords
35
from ..data import panda_urdfpath
46
from ..model import RobotModel
57
from .urdf import RobotModelFromURDF
@@ -14,6 +16,15 @@ class Panda(RobotModelFromURDF):
1416

1517
def __init__(self, *args, **kwargs):
1618
super(Panda, self).__init__(*args, **kwargs)
19+
20+
# End effector coordinate frame
21+
# Based on franka_ros configuration:
22+
# https://github.com/frankaemika/franka_ros/blob/0.10.1/franka_description/robots/common/franka_robot.xacro#L8
23+
self.rarm_end_coords = CascadedCoords(
24+
pos=[0, 0, 0.1034],
25+
parent=self.panda_hand,
26+
name='rarm_end_coords')
27+
self.rarm_end_coords.rotate(np.deg2rad(-90), 'y')
1728
self.reset_pose()
1829

1930
@cached_property
@@ -44,5 +55,5 @@ def rarm(self):
4455
links = [getattr(self, n) for n in link_names]
4556
joints = [l.joint for l in links]
4657
model = RobotModel(link_list=links, joint_list=joints)
47-
model.end_coords = self.panda_hand
58+
model.end_coords = self.rarm_end_coords
4859
return model

0 commit comments

Comments
 (0)