Skip to content

Commit dbe584e

Browse files
authored
Merge pull request #3122 from JdeRobot/pick-place-hal
Updated quaternion calculations in HAL
2 parents 816cb51 + ff70623 commit dbe584e

File tree

1 file changed

+2
-2
lines changed
  • exercises/static/exercises/pick_place/python_template/ros2_humble

1 file changed

+2
-2
lines changed

exercises/static/exercises/pick_place/python_template/ros2_humble/HAL.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def MoveLinear(abs_xyz, abs_ypr, speed, wait_time):
9393
qx = np.sin(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) - np.cos(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
9494
qy = np.cos(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.cos(pitch/2) * np.sin(yaw/2)
9595
qz = np.cos(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) - np.sin(roll/2) * np.sin(pitch/2) * np.cos(yaw/2)
96-
qw = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2)
96+
qw = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
9797

9898
InputPose = Robpose()
9999
InputPose.x = float(abs_xyz[0])
@@ -130,7 +130,7 @@ def MoveJoint(abs_xyz, abs_ypr, speed, wait_time):
130130
qx = np.sin(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) - np.cos(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
131131
qy = np.cos(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.cos(pitch/2) * np.sin(yaw/2)
132132
qz = np.cos(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) - np.sin(roll/2) * np.sin(pitch/2) * np.cos(yaw/2)
133-
qw = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2)
133+
qw = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
134134

135135
InputPose = Robpose()
136136
InputPose.x = float(abs_xyz[0])

0 commit comments

Comments
 (0)