0

Good morning,

I ran a simulation of a hecacopter with a gazebo. I have an sdf file of my drone with a 3-D lidar. I send the data of my lidar on the topic /scan, and I want to visualize it on rviz. I saw that I had to make an urdf file of my drone, but I can't make the conversion. (and the sdf file is quite big) Is there another way to display the data without having to do the conversion? Thank you

Translated with www.DeepL.com/Translator (free version)

  • SDF is not supported by ROS and its tools. You have to build an URDF description of your robot, which can be displayed in RVIZ, as well as (through conversion to SDF) by Gazebo. The laser scanner data is commonly produced by some laser scanner plugin. which you have to put into your model description. – Tik0 Mar 30 '20 at 07:53

1 Answers1

0

If you're publishing a (LaserScan/PointCloud) msg on topic /scan, and the header.frame_id is (for example) on frame lidar, then you can just look at the lidar frame in Rviz, and have a laser scan element subscribing to /scan. You don't need to render the whole vehicle if you don't want to. Personally, I find just rendering a coordinate axis frame to be sufficient sometimes.Here's an example of my Rviz, publishing a random scan.

JWCS
  • 1,120
  • 1
  • 7
  • 17
  • Okay thank you for your answer! How you publishing the frame of the lidar with sdf? I must create a plugin who publish the frame of my sdf model ? – Nicolas Brugie Mar 30 '20 at 09:53
  • The `frame_id` is set in the header ([std_msgs/Header](https://docs.ros.org/melodic/api/std_msgs/html/msg/Header.html)) of the laser scan ([sensor_msgs/LaserScan](https://docs.ros.org/melodic/api/sensor_msgs/html/msg/LaserScan.html)) msg you're publishing. I'm not using sdf at all. I'm telling Rviz to (look in upper left of image) view from the "Fixed Frame", which I chose to be (the string) "lidar". In my node that got my data from my device/robot/simulation, I set which frame I wanted the LaserScan msg to be seen as. IFyou don't care about seeing the rest of the robot, don't need sdf. – JWCS Mar 30 '20 at 21:13