Skip to content

Commit

Permalink
Make the pose_V to TFMessage conform with ROS2
Browse files Browse the repository at this point in the history
  • Loading branch information
teyssieuman committed Mar 11, 2024
1 parent 13e5592 commit 826b0ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ros_gz_bridge/src/convert/tf2_msgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ convert_gz_to_ros(
tf2_msgs::msg::TFMessage & ros_msg)
{
ros_msg.transforms.clear();
builtin_interfaces::msg::Time ros_stamp;
convert_gz_to_ros(gz_msg.header().stamp(), ros_stamp);

for (auto const & p : gz_msg.pose()) {
geometry_msgs::msg::TransformStamped tf;
convert_gz_to_ros(p, tf);
tf.header.stamp = ros_stamp;
tf.header.frame_id = "world";
tf.child_frame_id = p.name();
ros_msg.transforms.push_back(tf);
}
}
Expand Down

0 comments on commit 826b0ef

Please sign in to comment.