Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the pose_V to TFMessage conform with ROS2 #510

Open
wants to merge 1 commit into
base: humble
Choose a base branch
from

Conversation

teyssieuman
Copy link

🦟 Bug fix

The conversion from a gz::msgs::pose_V message to a ros2 geometry_msgs::msg::TransformStamped message what not compatible to make it a proper "tf2" message.

Summary

Checklist

  • Signed all commits for DCO

@azeey
Copy link
Contributor

azeey commented Mar 11, 2024

I'm not sure why this PR is needed. The child_frame_id is properly handled by the conversion from gz::msgs::Pose to geometry_msgs::msg::TransformStamped in

for (auto i = 0; i < gz_msg.header().data_size(); ++i) {
auto aPair = gz_msg.header().data(i);
if (aPair.key() == "child_frame_id" && aPair.value_size() > 0) {
ros_msg.child_frame_id = frame_id_gz_to_ros(aPair.value(0));
break;
}
}

and the frame_id is handled in

for (auto i = 0; i < gz_msg.data_size(); ++i) {
auto aPair = gz_msg.data(i);
if (aPair.key() == "frame_id" && aPair.value_size() > 0) {
ros_msg.frame_id = frame_id_gz_to_ros(aPair.value(0));
}
}

@azeey azeey self-requested a review March 11, 2024 21:34
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";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about this, maybe we should be able to configure this with a parameter, @azeey or @mjcarroll thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants