Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/apriltag/apriltag/apriltag_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ def tagDetectionSub(self, msg):
# Apply a known rotation to the transform
rotation_quaternion = R.from_euler(
"xyz", [float(rpy[0]), float(rpy[1]), float(rpy[2])], degrees=True
).as_quat()
)
current_quaternion = R.from_quat(
[
odom_to_tag_transform.transform.rotation.x,
odom_to_tag_transform.transform.rotation.y,
odom_to_tag_transform.transform.rotation.z,
odom_to_tag_transform.transform.rotation.w,
]
).as_quat()
rotated_quaternion = current_quaternion * rotation_quaternion # Multiply the quaternions
)
rotated_quaternion = (current_quaternion * rotation_quaternion).as_quat() # Multiply the quaternions

# Apply the rotation to the position before adding it to the cumulative sum
# Then, we can just average the positions and use an identity quaternion for the rotation
Expand Down
Loading