How can I read velodyne_msgs in c++ and also I want to publish that msg over rviz ?

asked 2019-04-18 00:40:15 -0500

Sarang Patrange gravatar image

updated 2019-04-18 01:12:42 -0500

gvdhoorn gravatar image

I have a rosbag file. if I run the command rosbag info filename.bag I am getting following output.

path:        data.bag                                                                                                                                                
version:     2.0                                                                                                                                                     
duration:    3:48s (228s)                                                                                                                                                     
start:       Sep 23 2016 12:26:58.43 (1474613818.43)                                                                                                                                                     
end:         Sep 23 2016 12:30:46.55 (1474614046.55)                                                                                                                                                     
size:        486.2 MB                                                                                                                                                     
messages:    26301                                                                                                                                                     
compression: none [570/570 chunks]                                                                                                                                                     
types:       geometry_msgs/PoseStamped  [d3812c3cbc69362b77dc0b19b345f8f5]                                                                                                                                                     
                vehicle_socket/CanInfo     [605f4356821f92a8fec1a756259316df]                                                                                                                                                     
                velodyne_msgs/VelodyneScan [50804fc9533a0e579e6322c04ae70566]                                                                                                                                                     
topics:      /can_info           21743 msgs    : vehicle_socket/CanInfo                                                                                                                                                     
                /current_pose        2279 msgs    : geometry_msgs/PoseStamped                                                                                                                                                     
                /velodyne_packets    2279 msgs    : velodyne_msgs/VelodyneScan
  1. I can see these above three topics.
  2. I want to publish this msgs on the above topics over rviz.

Any advice? I would appreciate.

edit retag flag offensive close merge delete

Comments

2

Are you asking how to play a bagfile?

gvdhoorn gravatar image gvdhoorn  ( 2019-04-18 01:13:24 -0500 )edit

I am asking about, how to read rosbag file using c++ api by topic and then how to send that msgs on rviz. I could read that file as well as publishing some msgs(geometry_msgs/PoseStamp) on rviz but that msgs won't get a display.

Sarang Patrange gravatar image Sarang Patrange  ( 2019-04-19 00:09:52 -0500 )edit

If this question is not about playing a bagfile, maybe your problem is that there is no existing plugin to directly visualize velodyne_msgs/VelodyneScan messages? You need to convert them to a pointcloud using the velodyne_pointcloud package. Is this what you are looking for?

mgruhler gravatar image mgruhler  ( 2019-04-23 01:30:56 -0500 )edit