swri-robotics / mapviz

Modular ROS visualization tool for 2D data.
BSD 3-Clause "New" or "Revised" License
390 stars 149 forks source link

Marker Scale #739

Open tky1026 opened 3 years ago

tky1026 commented 3 years ago

The visualization_msgs::Marker do not scale according to the size provided when showing up in MapViz's marker(display).

For example when displaying Marker type

marker.type = visualization_msgs::Marker::POINTS;
marker.scale.x = 1.0;
marker.scale.y = 1.0;

Instead of showing up according to scale (1.0m) similar to RViz, the are shown as one single pixel only in MapViz.

RViz

MapViz

It would be nice, if the markers can show according to size, or maybe there are some ways to do it that i missed.

Thank you.

danthony06 commented 3 years ago

@matt-attack do you have any insight into this?

pjreed commented 3 years ago

IIRC, this has been a known issue for a long time. The scale in a visualization_msgs/Marker message is supposed to be in meters, which is how they behave in rviz, but mapviz interprets it as pixels.

The obvious solution to "fix" things here is to make Mapviz draw them in meters instead, but the problem is that there are many places where nodes that were developed and tested primarily with Mapviz publish markers and expect the scale to be in pixels, and so changing that will cause all of those old markers to be way too large (or small, depending on how zoomed out you are).

For now I would suggest adding a button to the Marker config panel that toggles whether scales are in meters or pixels and have it default to pixels to preserve backwards compatibility, but in the future it should probably be in meters instead.