Ask Your Question
0

Publish to topic from file

asked 2015-12-01 07:58:42 -0600

Victoria_W gravatar image

Hello,

I am quite new to ROS. I have a logfile (format: .pcapng) and I want to write a node which receives the logged udp-packets (as a simulation; later, the node should receive these packets from a CAN). My problem is the following: I know how to write a subscriber-node, but how can I make the file publishing the packets (as messages) to a topic?

I have read something about ROS bags, but I am not sure whether they are the way to go. I would prefer some kind of programm with which I could play the file, so that I simply had to write the subscriber node.

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-01 09:20:52 -0600

gvdhoorn gravatar image

updated 2015-12-01 09:23:11 -0600

It's a bit more complex, but the velodyne_driver node just does that (ie: it uses a pcap file as stand-in for a connection to an actual device).

See ros-drivers/velodyne/velodyne_driver/src/lib/input.cc, L187-L304, which is then used in the velodyne_driver/src/driver/driver.cc, L89-L99 itself.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-12-01 07:58:42 -0600

Seen: 141 times

Last updated: Dec 01 '15