colors does not work on basic rviz markers like LINE_LIST and others
Hi
I like to publish marker (lines) with different colors for rviz on diamondback back. Therefore i like to use LINE_LIST markers, but the colors entry of the marker are ignored. Every line has the same color if I use the marker.color or does not show up at all if I use the markers.colors[] array? Same on POINTS, LINE_STRIP, ...
visualization_msgs::Marker marker;
marker.header.frame_id = frame_id_;
marker.header.stamp = ros::Time::now();
marker.ns = ns_name;
marker.id = 0;
marker.type = visualization_msgs::Marker::LINE_LIST;
marker.points.resize(n*2);
for (unsigned int i = 0; i < n; i++) {
cv::Point3d p0 = mFilter[i]->location();
cv::Point3d p1 = mFilter[i]->location(sec);
marker.points[i*2].x = p0.x;
marker.points[i*2].y = p0.y;
marker.points[i*2].z = p0.z;
marker.points[i*2+1].x = p1.x;
marker.points[i*2+1].y = p1.y;
marker.points[i*2+1].z = p1.z;
/// Just a internal call to define the color
marker.colors[i] = markerColorBySet(mFilter[i]->idSet());
}
marker.scale.x = 10;
marker.scale.y = 10;
marker.scale.z = 10;
// using the following line works, using marker.colors[] array not
//marker.color = markerColorBySet(mFilter[0]->idSet());
marker.lifetime = ros::Duration(1.0);
rvizMarkerPub_.publish(marker);