Open lucasw opened 4 months ago
That would be awesome. It would require extending rerun_ros_interface.cpp and adding the corresponding subscriber factory method to the visualizer node.
I am currently porting the bridge to ROS 2 and will also work on adding support for more of the standard types once that is done.
Here's what I have so far:
rosrun visualization_marker_tutorials example_marker_array.py
rosrun rerun_bridge rerun_marker.py
The Arrow isn't rotating properly, but I haven't looked into it much (possibly that rotation matrix is bad)- any suggestions to fix it are welcome. Also am I squashing it flat? Having the rviz marker control over the length of the tip and shaft and tip base radius would be nice, but not super important to anything I'm doing. There's another mode where the rviz arrow is defined by start and end points and I'll try that next, I expect it will work better.
There's no cylinder primitive so it would have to be generated as a Mesh3D, not too hard but rerun support would be nice.
Have rerun generate triangle flat face normals if not provided, could be optional.
Optional support for faces on boxes instead of the wireframe? Or I could generate a box Mesh3D instead.
marker.pose.orientation
is ignored for many types (though I never use it with any of the list marker types, I would instead make a parent ros transform handle it)- but adding a rerun transform for it seems like it would work.
I could take a look at adding any of the above that apply to the core rerun.
After fixing the arrows I can look at moving some of this to the bridge.
That looks great!
I did create a rerun transform per marker, arrows are looking good and it turned out I did have a few cases of other marker types setting orientation so those all work now too.
def ros_pose_to_rr_transform(pose: Pose) -> rr.Transform3D:
t = pose.position
translation = [t.x, t.y, t.z]
q = pose.orientation
rotation = rr.Quaternion(xyzw=[q.x, q.y, q.z, q.w])
return rr.Transform3D(translation=translation, rotation=rotation)
...
rr_transform = ros_pose_to_rr_transform(marker.pose)
rr_name = f"{parent_frame}/{marker.header.frame_id}/{marker.ns}/{marker.id}"
...
rr.log(rr_name, rr_transform)
I've just started using rerun and am trying out making a Marker-to-rerun standalone node (I don't think I've seen one elsewhere): https://github.com/lucasw/cpp-example-ros-bridge/blob/viz_markers/rerun_bridge/scripts/rerun_marker.py (so far it only converts a line strip, but the other primitives should be easy). I could convert to C++ later once I've gotten it mostly working in python- and it ought to go into the bridge?