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

Rviz visualization for the radar

asked 2017-09-19 05:01:06 -0500

stitch gravatar image

updated 2017-09-19 10:15:29 -0500

jayess gravatar image

Hello i am new to ROS and i would like to visualize my radar data on rviz. My radar.msg is made in this way :

uint8 id

float32 distance_sd_m

float32 angle_sd_deg

float32 velocity_sd_m__s

float32 distance_m

float32 angle_deg

float32 velocity_m__s

float32 width_m

float32 length_m
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-09-21 12:34:57 -0500

updated 2017-09-26 08:38:36 -0500

As far as I know there is no RViz plugin for this type of sensor. In my work I've regularly used the marker message type to visualise complex information that isn't currently supported. Using this type you can visualise any 3D color mesh data you can generate. It's a bit tricky if you're new to ROS but I can post some code examples if you're using C++.

Here is an example code segment that creates a marker mesh message, you'll then need to publish this message to a topic to see it in RVIZ. Once the message has been created and setup you're basically adding a color value then three vertices for each triangle, each triangle can be a different color (in my example they're all the same).

This example uses a vector of Eigen::Vector3f to represent the vertices and a vector of custom triangle structures, you can replace this with anything you wish for your own project.

// create Mesh message
visualization_msgs::Marker meshMarker;

// setup Triangle_List marker message
meshMarker.header.frame_id = "Coordinate_frame_id";
meshMarker.header.stamp = ros::Time();
meshMarker.ns = "custom_mesh"; = 0;
meshMarker.type = visualization_msgs::Marker::TRIANGLE_LIST;
meshMarker.action = visualization_msgs::Marker::ADD;
meshMarker.pose.position.x = 0;
meshMarker.pose.position.y = 0;
meshMarker.pose.position.z = 0;
meshMarker.pose.orientation.x = 0.0;
meshMarker.pose.orientation.y = 0.0;
meshMarker.pose.orientation.z = 0.0;
meshMarker.pose.orientation.w = 1.0;
meshMarker.scale.x = 1;
meshMarker.scale.y = 1;
meshMarker.scale.z = 1;
meshMarker.color.a = 1.0;

// create temp vertex and color objects.
geometry_msgs::Point    vertex;
std_msgs::ColorRGBA meshColor;

// add triangles
for (int f=0; f<triangles.size(); ++f)
    meshColor.r = 1.0;
    meshColor.g = 0.5;
    meshColor.b = 0.0;


    // add triangle to mesh
    vertex.x = vertices[triangles[f].v1][0];
    vertex.y = vertices[triangles[f].v1][1];
    vertex.z = vertices[triangles[f].v1][2];

    vertex.x = vertices[triangles[f].v2][0];
    vertex.y = vertices[triangles[f].v2][1];
    vertex.z = vertices[triangles[f].v2][2];

    vertex.x = vertices[triangles[f].v3][0];
    vertex.y = vertices[triangles[f].v3][1];
    vertex.z = vertices[triangles[f].v3][2];
edit flag offensive delete link more


Yes I am using C++. I had heard of the markers but I couldn't get to a solution. Thank you very much, your codes would be a great help!

stitch gravatar image stitch  ( 2017-09-21 15:12:12 -0500 )edit

Can you please post those examples?

stitch gravatar image stitch  ( 2017-09-26 04:03:55 -0500 )edit

I've just added it to my original post. Let me know if you have any questions getting this going.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2017-09-26 08:39:03 -0500 )edit

This is a special type of marker(similar to Basic Shapes) ...but still i can't see how to represent the radar data through it

stitch gravatar image stitch  ( 2017-09-26 10:44:28 -0500 )edit

You're right it is one of the basic marker types in rviz. The beauty of this message type is you write nodes to generate them for all different types of information. Work out how you want the radar information displayed in rviz, then write a node to convert the radar message to a mesh.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2017-09-26 11:17:59 -0500 )edit

answered 2017-09-20 15:49:16 -0500

gvdhoorn gravatar image

updated 2017-09-26 09:17:31 -0500

I don't know of any Display plugins for RViz that visualise radar (or related) data. There was a Gazebo GSoC project (this one) that could have potentially resulted in a plugin for that, but OSRF wasn't selected for GSoC this year.

If you can't find anything online (github fi), then I'm afraid you'll have to write your own plugin. That can be slightly involved, but should be doable. See wiki/rviz/Tutorials for the introductory tutorials.

Edit: short-term custom visualisation using markers may be sufficient, but I would recommend you also try and see whether you can contribute to the ongoing discussion about radar and ROS on Discourse: Addition of Radar-Specific Message(s) to sensor_msgs.

After a standardised msg set, adding visualisation capabilities to tools like RViz would be a lot easier.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-09-19 05:01:06 -0500

Seen: 2,373 times

Last updated: Sep 26 '17