ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Assuming you are using a robot that moves in the plane with its z-axis pointing upwards and markers that have their z axis (mostly) pointing upwards, you can:
tf2
.The quaternion that rotates around the z-axis by pi radian would have w = cos(theta/2) = 0
and z = sin(theta/2) = 1
which you could insert in your launch file as:
<node pkg="tf2_ros" type="static_transform_publisher" name="mirror_marker_rotation_broadcaster" args="0 0 0 1 0 0 0 marker mirrored_orientation_marker" />
You could also manually do this math yourself by post-multiplying (right-multiplying) the rotation quaternion with the marker's quaternion. Note that if the z-axis of the markers aren't pointing perfectly upright and you are adding a translation (e.g. you move your robot to be 1m in front of the marker), these errors will cause the calculated pose to be offset from where you want it to be depending on much the z-axis diverges from the vertical.