Enabling ros topic streaming

Typically: "How do I... ", "How can I... " questions
Post Reply
pacifica
Posts: 4
Joined: 09 Feb 2014, 23:14

Enabling ros topic streaming

Post by pacifica »

Hi Guys!

I am addressing a problem about the enabling of streaming data catch by robotic sensor on ros topic in v-rep. Even if i found several hints on internet and on this forum i have no found a good solution to my problem:

i am trying to publish on a topic the vision data catched from the UAV quadrotor model integrated in v-rep in the mobile robot direcory... here we have 2 cameras... i just add a script to the choosen camera, in the same way doing in the "rosTopicPublisherAndSubscriber" scene, integrated in the v-rep package...

I am pretty sure that my script is correct... are just few lines and it's copied from the rosTopicPublisherAndSubscriber scene... can anyone tell me if it's necessary to do other stufft after write the script?? or mybe if us better to enable data streaming from ros system call ( such as rosservice... ) or if exist any step-by-step tutorial that teach me wath to do...

Thanks a lot!

pacifica
Posts: 4
Joined: 09 Feb 2014, 23:14

Re: Enabling ros topic streaming

Post by pacifica »

I have tryed even to use the ros service to enable image publishing... here are the commands:

--To retrive the handle of the handle of the camera
rosservice call vrep/simRosGetObjectHandle 'Quadricopter_floorCamera'
handle: 36

-- so... 36 is the handle

--enable the streaming on topic
rosservice call vrep/simRosEnablePublisher 'camera' 1 4114 36 -- 1 ''

--but the result is:
effectiveTopicName: ''


P.S i think that 4114 is the value of simros_strmcmd_get_vision_sensor_image command!!
What's wrong???

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

Re: Enabling ros topic streaming

Post by coppelia »

Hello,

It seems you are mixing up vision sensors and cameras. They cannot be used in the same way, here just the major difference between them:
  • a camera basically just allows to look through it. It has no fixed resolution (i.e. in a small view it will render with a small resolution, in a large view with a high resolution), and its image content cannot easily be retrieved (actually you can, if you look at the sim_message_eventcallback_openglframe and sim_message_eventcallback_openglcameraview messages).
  • a vision sensor has a fixed resolution and its image content can directly be read, modified, and written back (i.e. image processing)
In your case, you wanna use a vision sensor, not a camera.

Cheers

pacifica
Posts: 4
Joined: 09 Feb 2014, 23:14

Re: Enabling ros topic streaming

Post by pacifica »

Hello, Thanks a lot for your reply!

Thanks even for the suggestion about differences between camera and visual sensor... but i think that i have not done mistake between that...

For example... i ask to v-rep to stream the image taken by the quadcopter with "simros_strmcmd_get_vision_sensor_image" command...that should be the command to stream image with a visual sensor. My dubt is that the quadrotor model two cameras and not two visual sensors ... but seeme a quite impossibile :)... anyway i have created a new scene with just an object: a visual_sensor... and retry the ros commands... i think that there is something of wrong in my configuration mybe...

PS: I have tryed to strem the pose of the object, even with ros service as suggested in the ros tutorial on the v-rep website... and everythingh works great! Mybe someone already had a scene where the quadrotor stream the images cathed by visual_sensors on a ros topic??? From that i can understand where my problem is...

Thanks a lot for your support

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

Re: Enabling ros topic streaming

Post by coppelia »

if you look at the default quadricopter model, it has no vision sensors on it! Just cameras. So unless you replaced the cameras with vision sensors, it will not work.
Additionally, always inspect the error messages in the status bar, at the bottom of your main window. Does it say anything there?

Cheers

pacifica
Posts: 4
Joined: 09 Feb 2014, 23:14

Re: Enabling ros topic streaming

Post by pacifica »

ok... i am very very inattentive... for 2 reason

1. i have not notice that the quadrotor is equipped with a visual sensor but with a camera ( the different shape confued me...)
2. i have nevers seen the status bar :D

Thanks a lot for your support!! I will try to substitute the camera on the quadrotor model and will try to stream it on topic... i hope that will have not problems! Sory for the lost time!!


Cheers

Post Reply