Ask Your Question

[RViz] How do I use marker.colors with LINE_LIST?

asked 2015-07-29 08:47:04 -0500

Sebastian Kasperski gravatar image

updated 2015-07-29 08:47:45 -0500

The doc says colors should have same size as points. But in case of LINE_LIST, there are 2n points, with n = number of lines. I tried both to resize colors to n and 2*n and setting every color twice for each line, but I always end up seeing only every second line segment and having several segments rendered black.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-08-03 03:34:28 -0500

Sebastian Kasperski gravatar image

The strange behaviour was due to a programming bug.

The correct solution is to have colors the same size as points. Indeed you are coloring the points, not the full line segments. The two colors (start point and end point) are interpolated along the line segment.

edit flag offensive delete link more

answered 2015-07-29 19:25:12 -0500

William gravatar image

The wiki says:

In visualization 1.1+ will also optionally use the colors member for per-vertex color.

I would guess that means you need to specify a color for each point in the points list, so colors should be the number of points or two times the number of lines. But that sounds like what you're doing. Can you post (as an edit to your original post) what version of rviz you're using and what version of ROS and what your OS is?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-07-29 08:47:04 -0500

Seen: 332 times

Last updated: Aug 03 '15