diff --git a/dimos/robot/drone/connection_module.py b/dimos/robot/drone/connection_module.py index 8591d3edc3..21e9b89855 100644 --- a/dimos/robot/drone/connection_module.py +++ b/dimos/robot/drone/connection_module.py @@ -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, @@ -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(),