0
$\begingroup$

Rosanswers logo

I wish to create a multicolored visualization of a car in Rviz. I am using a Collada (.dae) file with the car's 3D mesh.

I followed the steps here: http://wiki.ros.org/rviz/DisplayTypes/Marker#Mesh_Resource_.28MESH_RESOURCE.3D10.29_.5B1.1.2B-.5D.

The shape gets correctly visualized but the colors are ignored and the car is shown in grey. I can add a single color by setting the color parameter of visualization_msgs::Marker in the ros node, but doing so adds the same color to all parts of the car.

Thank you in advance for any suggestion :D


Originally posted by Junskter on ROS Answers with karma: 41 on 2019-07-15

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I think there is an issue with Rviz because of which colors in the Collada (.dae) mesh file are ignored. Here's what I did to solve the problem:

  1. For each part of the 3D object, I added a different texture from image. Eg. for a red part, I used plain red colored image and added that as a texture to the object. I used Blender software for this.

  2. Added these lines to the node that published the visualization marker:

    marker.mesh_resource = "package://rl_car/visual_models/car/car.dae"; marker.mesh_use_embedded_materials = true;

It takes a few seconds for the marker to be visualized for the first time when I start Rviz, maybe because Rviz needs the time to load the textures. After that the marker position gets updated in real time. I hope it's helpful for you.


Originally posted by Junskter with karma: 41 on 2019-07-21

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.