Skip to content

Commit b88ed1d

Browse files
authored
Merge pull request #148 from ichumuh/main
fix omni drive
2 parents d3f5523 + bf9aaa0 commit b88ed1d

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

src/semantic_digital_twin/world_description/connections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def add_to_world(self, world: World):
720720
pitch=self.pitch.variables.position,
721721
yaw=0,
722722
)
723-
self.kinematicskinematics = odom_T_bf @ bf_T_bf_vel @ bf_vel_T_bf
723+
self.kinematics = odom_T_bf @ bf_T_bf_vel @ bf_vel_T_bf
724724
self.kinematics.child_frame = self.child
725725

726726
@classmethod

test/test_robots/test_world_pr2.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,30 @@ def test_compute_fk_np_pr2(pr2_world):
161161
)
162162

163163

164+
def test_compute_fk_np_pr2_root_left_hand(pr2_world):
165+
tip = pr2_world.root
166+
root = pr2_world.get_kinematic_structure_entity_by_name(
167+
PrefixedName("l_gripper_tool_frame")
168+
)
169+
170+
connection = pr2_world.get_connections_by_type(OmniDrive)[0]
171+
connection.origin = TransformationMatrix.from_xyz_rpy(x=1, yaw=1)
172+
173+
fk = pr2_world.compute_forward_kinematics_np(root, tip)
174+
np.testing.assert_array_almost_equal(
175+
fk,
176+
np.array(
177+
[
178+
[0.523, 0.815, 0.247, -1.692],
179+
[-0.841, 0.540, 0.0, 0.653],
180+
[-0.133, -0.208, 0.968, -0.5],
181+
[0.0, 0.0, 0.0, 1.0],
182+
],
183+
),
184+
decimal=3,
185+
)
186+
187+
164188
def test_compute_fk_np_l_elbow_flex_joint_pr2(pr2_world):
165189
tip = pr2_world.get_kinematic_structure_entity_by_name(
166190
PrefixedName("l_elbow_flex_link")

0 commit comments

Comments
 (0)