Quantcast

GetData() failing on Camera sensor

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

GetData() failing on Camera sensor

Jeremy Breen
Hi

I am having some difficulty with the camera sensor. I wish to access the camera sensor data and save an image to file to use with computer vision algorithms. However, this is not going as well as I'd hoped. At the moment I am trying to access the camera sensor data in the following way:
for attachedsensor in starbug.GetAttachedSensors():
        if attachedsensor.GetSensor() is not None and attachedsensor.GetSensor().Supports(Sensor.Type.Camera):
                attachedsensor.GetSensor().Configure(Sensor.ConfigureCommand.PowerOn)
                time.sleep(5)
                sensordata = attachedsensor.GetData()

However this is failing with the message
openravepy.openravepy_ext.openrave_exception: openrave (Failed): SensorData failed

Any advice about where to start looking for the cause of this problem would be appreciated. I believe that I've attached the sensor correctly and a simple print of the above attachedsensor shows it is of camera type. I've also managed to access the camera data the same way in some of the included examples. So I'm currently out of ideas. I'm also not sure as to what information about the rest of my program would be relevant to include.

Cheers

Jeremy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GetData() failing on Camera sensor

Rosen Diankov
Administrator
hi Jeremy,

There are two possibilities:

- the camera needs more time to initialize

- the viewer is not initialized

The correct way of waiting for the camera is by catching the exception
until the camera works.
We're attaching a script to show you this along with saving the image
to test.png.

rosen,

2011/7/7 Jeremy Breen <[hidden email]>:

> Hi
>
> I am having some difficulty with the camera sensor. I wish to access the
> camera sensor data and save an image to file to use with computer vision
> algorithms. However, this is not going as well as I'd hoped. At the moment I
> am trying to access the camera sensor data in the following way:
> for attachedsensor in starbug.GetAttachedSensors():
>        if attachedsensor.GetSensor() is not None and
> attachedsensor.GetSensor().Supports(Sensor.Type.Camera):
>                attachedsensor.GetSensor().Configure(Sensor.ConfigureCommand.PowerOn)
>                time.sleep(5)
>                sensordata = attachedsensor.GetData()
>
> However this is failing with the message
> openravepy.openravepy_ext.openrave_exception: openrave (Failed): SensorData
> failed
>
> Any advice about where to start looking for the cause of this problem would
> be appreciated. I believe that I've attached the sensor correctly and a
> simple print of the above attachedsensor shows it is of camera type. I've
> also managed to access the camera data the same way in some of the included
> examples. So I'm currently out of ideas. I'm also not sure as to what
> information about the rest of my program would be relevant to include.
>
> Cheers
>
> Jeremy
>
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/GetData-failing-on-Camera-sensor-tp3146982p3146982.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users

testcamera.py (922 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GetData() failing on Camera sensor

Jeremy Breen
Hi Rosen

Thank you for your reply. I can run your attached script no problems. However when I include the try catch block in my program it just enters an infinite loop. One difference I have noticed between your script (and the examples) and my program is my program does not display the

Coin info in glglue_allow_newer_opengl():

Features of OpenGL version > 1.0 has been
disabled, due to the use of a remote display. ... etc message while the other scripts do. I was wondering if I might be doing something wrong in this regard. I have set the viewer and loaded the environment the same way. Any ideas?

Cheers

Jeremy

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GetData() failing on Camera sensor

Rosen Diankov
Administrator
hi jeremy,

you cannot have the environment locked during your wait. most like you
have a "with env" or "with robot" somewhere..?

rosen,

2011/7/7 Jeremy Breen <[hidden email]>:

> Hi Rosen
>
> Thank you for your reply. I can run your attached script no problems.
> However when I include the try catch block in my program it just enters an
> infinite loop. One difference I have noticed between your script (and the
> examples) and my program is my program does not display the
>
> Coin info in glglue_allow_newer_opengl():
>
> Features of OpenGL version > 1.0 has been
> disabled, due to the use of a remote display. ... etc message while the
> other scripts do. I was wondering if I might be doing something wrong in
> this regard. I have set the viewer and loaded the environment the same way.
> Any ideas?
>
> Cheers
>
> Jeremy
>
>
>
> --
> View this message in context: http://openrave-users-list.185357.n3.nabble.com/GetData-failing-on-Camera-sensor-tp3146982p3147121.html
> Sent from the OpenRAVE Users List mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GetData() failing on Camera sensor

Jeremy Breen
Hi Rosen

I think I've gotten to the bottom of it thank you. I was doing some funny things when I was initialising the viewer and loading the environment.

Thank you for your help

Jeremy
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: GetData() failing on Camera sensor

lixdhitrobot
In reply to this post by Rosen Diankov
Hi Rosen

I have run the attachment file "testcamera.py", but there is no image stored.

there are still many errors.



Coin info in glglue_allow_newer_opengl():

Features of OpenGL version > 1.0 has been
disabled, due to the use of a remote display.

This is so because many common OpenGL drivers
have problems in this regard.

To force full OpenGL use, set the environment
variable COIN_FULL_INDIRECT_RENDERING=1 and re-run the application.

If you don't want this message displayed again,
set the environment variable COIN_DONT_INFORM_INDIRECT_RENDERING=1.

[qtcoinviewer.cpp:3157] offscreen renderer failed (check video driver), disabling
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
[qtcoinviewer.cpp:3110] cannot render offscreen
Loading...