ros / geometry2

A set of ROS packages for keeping track of coordinate transforms.
191 stars 279 forks source link

dotransform TransformStamped datatype not process child_frame_id #541

Closed darkchooselight closed 1 year ago

darkchooselight commented 2 years ago

the code do not process child_frame_id transform. look below: tf2_geometry_msgs/tf2_geometry_msgs.h

template <>
inline
void doTransform(const geometry_msgs::TransformStamped& t_in, geometry_msgs::TransformStamped& t_out, const geometry_msgs::TransformStamped& transform)
  {
    tf2::Transform input;
    fromMsg(t_in.transform, input);

    tf2::Transform t;
    fromMsg(transform.transform, t);
    tf2::Transform v_out = t * input;

    t_out.transform = toMsg(v_out);
    t_out.header.stamp = transform.header.stamp;
    t_out.header.frame_id = transform.header.frame_id;
  }
tfoote commented 2 years ago

That does look like it's missing the logic to transfer the child_frame_id if t_in and t_out aren't the same.

tfoote commented 1 year ago

I was reviewing the PR #555 proposed to resolve this and I think this behavior is actually correct. See my logic there.