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

Does camera1394 support UDP transport layer?

asked 2013-02-28 07:39:13 -0600

AdrianPeng gravatar image

updated 2014-01-28 17:15:27 -0600

ngrennan gravatar image

I am trying to stream video from my gumstix Overo to my laptop with camera1394 package. With default TCP layer, I found there are 5 to 10 seconds delay and the frame rate is just about 1 frame/sec (which is not what I set 15 frames/sec). I know I need to compress image and I will do some research on that later.

Right now, I really want to change the data transport layer from TCP to UDP because UDP is batter for tele-operation. I know that I can change the transport layer by transport hint in subscriber node. So I did that in my image_view source code "image_nodelet.cpp".

At line 118, I changed:

image_transport::TransportHints hints(transport, ros::TransportHints(), getPrivateNodeHandle());

to

image_transport::TransportHints hints(transport, ros::TransportHints().udp(), getPrivateNodeHandle());

And rosmake it again. Then I run the image_view to receive video. However I found it still utilize TCP transport layer instead of UDP. Does camera1394 support UDP transport layer?

My laptop have Ubuntu 12.04 running as a virtual machine and bridged the host network. I inspect the transport layer by wireshark in windows(host). I also doubt that if I make the right image_view package I edited because I know there is another one in /opt/ros/groovy/stacks. But I my ROS_PAKCKAGE_PATH is

/home/adrian/catkin_ws/src:/opt/ros/groovy/share:/opt/ros/groovy/stacks

So I think rosmake should make the source image_view in my workspace.

Thanks and have a good day!

edit retag flag offensive close merge delete

Comments

I remember trying a couple of months ago to send images over UDP (with Electric probably) and communication was kind of unstable (sometimes the node just crashed). (I think I have been too lazy at that time to open a ticket regarding this issue, sorry!)

Thomas gravatar image Thomas  ( 2013-02-28 18:30:14 -0600 )edit

I heard that UDP transport might be unstable, but I still want to try since I really concern about latency. Do you mind telling me how you send images over UDP? Did you just edit the transport hint in subscriber node? Thanks!

AdrianPeng gravatar image AdrianPeng  ( 2013-03-01 03:02:07 -0600 )edit

Yes this is how I did it. You should also consider trying tcpNoDelay, it may help you.

Thomas gravatar image Thomas  ( 2013-03-03 14:11:20 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-02-28 16:15:20 -0600

joq gravatar image

updated 2013-02-28 16:15:36 -0600

There is definitely no explicit code in camera1394 for UDP transport. Publishing the sensor_msgs/Image and sensor_msgs/CameraInfo messages is actually done in image_transport, not in the driver, itself.

Since you seem uncertain which image_view you are using, run this command:

$ rospack find image_view

I have never attempted to use UDP with camera1394, and have no idea whether it will work reliably or not. It is certainly worth trying, if that's what you need.

edit flag offensive delete link more

Comments

Did you use UDP with other nodes before? As far as I know, I just need to edit ros::TransportHints() in subscriber source file. Is it right?

AdrianPeng gravatar image AdrianPeng  ( 2013-02-28 17:31:09 -0600 )edit

I found the description of image_transport package description is "image_transport should always be used to subscribe to and publish images". Does image_view also use image_transport to subscribe to images? If yes, I might need to edit the source code in image_transport package.

AdrianPeng gravatar image AdrianPeng  ( 2013-02-28 17:34:56 -0600 )edit

Yes, image_view subscribes using image_transport. My impression is that UDP transport with ROS is not fully functional, but I have no personal experience using it.

joq gravatar image joq  ( 2013-03-01 03:46:39 -0600 )edit

Is image_transport just a library? I am not supposed to change anything in image_transport, right?

AdrianPeng gravatar image AdrianPeng  ( 2013-03-01 07:10:31 -0600 )edit

image_transport is a ROS package, which provides a library and a republish node. You can check out the source and modify it, to experiment with UDP. Making a patch that could actually be merged back into the master source tree would probably be tricky.

joq gravatar image joq  ( 2013-03-01 13:03:13 -0600 )edit

I have two image_transport packages, one on my gumstix Overo side and one on my laptop. Which one do I need to modify? I heard I just need to set image_transport::TransportHints to udp() in subscriber node. I am really confused, does it mean I need to modify image_transport package on my laptop?

AdrianPeng gravatar image AdrianPeng  ( 2013-03-01 17:41:02 -0600 )edit

I am not sure, maybe someone else knows the answer. You can just experiement and see what happens. You can use something like wireshark to see what packets are transmitted.

joq gravatar image joq  ( 2013-03-02 03:30:15 -0600 )edit

Question Tools

Stats

Asked: 2013-02-28 07:39:13 -0600

Seen: 405 times

Last updated: Feb 28 '13