Skip to content

incorrect tranformation of VelocityStamped with doTransform() #817

@asherikov

Description

@asherikov

Generated by Generative AI

No response

Operating System:

Ubuntu 22

ROS version or commit hash:

humble

RMW implementation (if applicable):

No response

RMW Configuration (if applicable):

No response

Client library (if applicable):

No response

'ros2 doctor --report' output

Steps to reproduce issue

Applying identity transform

    geometry_msgs::msg::TransformStamped transform;

    geometry_msgs::msg::VelocityStamped v;
    v.velocity.linear.z = 1;

    std::cout << to_yaml(transform, /*use_flow_style=*/true).c_str() << std::endl;
    std::cout << to_yaml(v, /*use_flow_style=*/true).c_str() << std::endl;

    tf2::doTransform(v, v, transform);

    std::cout << to_yaml(v, /*use_flow_style=*/true).c_str() << std::endl;

Result (velocity doubled)

{header: {stamp: {sec: 0, nanosec: 0}, frame_id: ""}, child_frame_id: "", transform: {translation: {x: 0.00000, y: 0.00000, z: 0.00000},
rotation: {x: 0.00000, y: 0.00000, z: 0.00000, w: 1.00000}}}
{header: {stamp: {sec: 0, nanosec: 0}, frame_id: ""}, body_frame_id: "", reference_frame_id: "", velocity: {linear: {x: 0.00000, y: 0.000
00, z: 1.00000}, angular: {x: 0.00000, y: 0.00000, z: 0.00000}}}
{header: {stamp: {sec: 0, nanosec: 0}, frame_id: ""}, body_frame_id: "", reference_frame_id: "", velocity: {linear: {x: 0.00000, y: 0.00000, z: 2.00000}, angular: {x: 0.00000, y: 0.00000, z: 0.00000}}}

Expected behavior

Identity transform should not change magnitude of velocity

Actual behavior

Velocity is doubled

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions