ROS Vision Sensor publisher dropping frames

Report crashes, strange behaviour, or apparent bugs
Post Reply
kakarot1905
Posts: 2
Joined: 31 Jan 2016, 16:51

ROS Vision Sensor publisher dropping frames

Post by kakarot1905 »

I have two ROS topics being published from a non-threaded child script attached to a vision sensor.

Code: Select all

visionTopicName=simExtROS_enablePublisher('front_camera_raw',1,simros_strmcmd_get_vision_sensor_image,visionSensorHandle,0,'')
visionInfoTopicName=simExtROS_enablePublisher('front_camera_raw/camera_info',1,simros_strmcmd_get_vision_sensor_info, visionSensorHandle,0,'')
When I run VRep alone, everything works fine. But when there is another CPU intensive executable running (eg: a SLAM localizer), VRep drops publishing the topic sporadically. Would threading the publishing script help? If so, how can I do that?

Thanks for the help!

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: ROS Vision Sensor publisher dropping frames

Post by coppelia »

Hello,

that would be very strange if V-REP would indeed drop publishing a message. Messages are published normally once per simulation step, as can be seen from this page.

What is probably happening is that the input buffer of your subscriber on the ROS node side is too small, and the message gets dropped (or overwritten) there?! Try increasing the queue size to see if that makes a difference.

Cheers

kakarot1905
Posts: 2
Joined: 31 Jan 2016, 16:51

Re: ROS Vision Sensor publisher dropping frames

Post by kakarot1905 »

Hi There!

Thanks for the quick reply!

I tried it out, and unfortunately it doesn't seem to fix the problem. I also ran:

Code: Select all

rosrun image_view image_view image:=/vrep/front_camera_raw
which gives a smooth camera feed when I don't have another cpu intensive task running. But the moment the other task startups, the feed starts dropping frames.

Regards

coppelia
Site Admin
Posts: 10364
Joined: 14 Dec 2012, 00:25

Re: ROS Vision Sensor publisher dropping frames

Post by coppelia »

That is very strange. Can you try to print a text in the publisher routine in file programming/ros_packages/vrep_plugin/src/ROS_server.cpp, recompile the plugin and try to see if a print is missed? You could also print another text in the sensing phase of a non-threaded child script, this way, the two messages should always appear in alternance.

Cheers

Post Reply