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
19 changes: 12 additions & 7 deletions dimos/robot/drone/connection_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,17 @@ def _store_and_publish_frame(self, frame: Image) -> None:

def _publish_tf(self, msg: PoseStamped) -> None:
"""Publish odometry and TF transforms."""
self._odom = msg
self._odom = PoseStamped(
position=Vector3(msg.position.x, msg.position.y, 0.0),
orientation=msg.orientation,
frame_id=msg.frame_id,
ts=msg.ts,
)

# Publish odometry
self.odom.publish(msg)
nav_msg = self._odom
self.odom.publish(nav_msg)

# Publish base_link transform
# Keep real z for TF so Rerun draws the drone at correct altitude
base_link = Transform(
translation=msg.position,
rotation=msg.orientation,
Expand All @@ -187,10 +192,10 @@ def _publish_tf(self, msg: PoseStamped) -> None:
)
self.tf.publish(base_link)

# Publish camera_link transform (camera mounted on front of drone, no gimbal factored in yet)
# Camera mounted on front of drone, no gimbal factored in yet
camera_link = Transform(
translation=Vector3(0.1, 0.0, -0.05), # 10cm forward, 5cm down
rotation=Quaternion(0.0, 0.0, 0.0, 1.0), # No rotation relative to base
translation=Vector3(0.1, 0.0, -0.05),
rotation=Quaternion(0.0, 0.0, 0.0, 1.0),
frame_id="base_link",
child_frame_id="camera_link",
ts=time.time(),
Expand Down
Loading