ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Colour coding in RViz

asked 2021-03-11 01:52:38 -0600

Py gravatar image

Is it possible to place some kind of 2D rectangular shape in RViz that is colour coded according to some data value subscribed to and positioned wherever the robot is at the time the data was read?

If so, how might I go about implementing this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-03-11 10:57:35 -0600

Rviz is only a data visualizer. As such, you cannot "place" a shape in rviz, but if the shape is being published somewhere, you can subscribe to it and visualize it! There are two easy ways to go about your problem:
1. Work with gazebo and place an object wherever you want. You can then visualize in either a camera pointed towards it or using some lidar scan.
2. Generate markers in code and publish them. This tutorial will show you how to. I'd recommend this method since it sounds like you want it based on the robot position and you can just keep changing the marker pose in code.

edit flag offensive delete link more

Comments

That's great thanks! I've been able to publish some markers and visualise them in RViz. My next challenge is to to colour code them according to the sensor value like a heatmap. Any idea how I'd go about this?

Py gravatar image Py  ( 2021-03-15 14:24:08 -0600 )edit
1

I believe the markers have a RGB field? You can read your sensor data and using whatever algorithm/idea you have in mind and apply individual markers with relevant RGB values.

Akhil Kurup gravatar image Akhil Kurup  ( 2021-03-15 14:28:04 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-03-11 01:52:38 -0600

Seen: 770 times

Last updated: Mar 11 '21