mirror of
https://github.com/bjoernellens1/cps_rmp220_support.git
synced 2025-01-19 08:06:59 +00:00
update
This commit is contained in:
parent
5dd8b2c27b
commit
4bea3eb5c6
@ -19,14 +19,18 @@ def odom_callback(msg):
|
|||||||
orientation.x, orientation.y, orientation.z, orientation.w
|
orientation.x, orientation.y, orientation.z, orientation.w
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Get frame IDs from the message
|
||||||
|
parent_frame_id = msg.header.frame_id if msg.header.frame_id else "odom"
|
||||||
|
child_frame_id = msg.child_frame_id if msg.child_frame_id else "base_link"
|
||||||
|
|
||||||
# Broadcast the transformation
|
# Broadcast the transformation
|
||||||
br = tf.TransformBroadcaster()
|
br = tf.TransformBroadcaster()
|
||||||
br.sendTransform(
|
br.sendTransform(
|
||||||
(position.x, position.y, position.z), # Translation
|
(position.x, position.y, position.z), # Translation
|
||||||
(qx, qy, qz, qw), # Normalized rotation (quaternion)
|
(qx, qy, qz, qw), # Normalized rotation (quaternion)
|
||||||
rospy.Time.now(), # Timestamp
|
rospy.Time.now(), # Timestamp
|
||||||
msg.child_frame_id if msg.child_frame_id else "base_link", # Child frame ID
|
child_frame_id, # Child frame ID
|
||||||
msg.header.frame_id if msg.header.frame_id else "odom" # Parent frame ID
|
parent_frame_id # Parent frame ID
|
||||||
)
|
)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user