Using the BaseLaser2D

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Using the BaseLaser2D

Chris Flesher
Hello,

I am trying to use the BaseLaser2D using openravepy but have not been
able to get valid data from the sensor. It seems to be rendering fine
however...

laser = env.GetAttachedSensor('Laser').GetSensor()
laser.SendCommand('render 1')
print self.deltaT.GetSensorData().ranges

The output seems to be a combination of some really large values (much
larger than the max range of the sensor) and garbage data (whatever is
leftover in memory). Also I'm receiving an array of size (numBeams, 3)
instead of just the distance data. I've tried the following things to
resolve this:

- Looked through tutorials and the mailing list
- The data seems to display properly in the qtcoin viewer
- Tried playing with the <scantime> attributes in my env.xml file
- Tried calling env.StepSimulation(timestep)

Also I'm using rev 1788.

Thanks,
Chris

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: Using the BaseLaser2D

Rosen Diankov
Administrator
hi chris,

There was a problem with the python bindings, it is fixed in r1806.
thanks for the report!

rosen,

2010/11/2 Christopher Flesher <[hidden email]>:

> Hello,
>
> I am trying to use the BaseLaser2D using openravepy but have not been
> able to get valid data from the sensor. It seems to be rendering fine
> however...
>
> laser = env.GetAttachedSensor('Laser').GetSensor()
> laser.SendCommand('render 1')
> print self.deltaT.GetSensorData().ranges
>
> The output seems to be a combination of some really large values (much
> larger than the max range of the sensor) and garbage data (whatever is
> leftover in memory). Also I'm receiving an array of size (numBeams, 3)
> instead of just the distance data. I've tried the following things to
> resolve this:
>
> - Looked through tutorials and the mailing list
> - The data seems to display properly in the qtcoin viewer
> - Tried playing with the <scantime> attributes in my env.xml file
> - Tried calling env.StepSimulation(timestep)
>
> Also I'm using rev 1788.
>
> Thanks,
> Chris
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: Using the BaseLaser2D

Chris Flesher
Hi Rosen,

Thanks. It seems to be working for the most part now. There is still
some problem... seems like the memory for the laser data is being
written to while I'm reading it sometimes. Is there a way to lock
this? I tried using the env.LockPhysics to no avail.

env.LockPhysics(True)
ranges = sqrt(sum(pow(laser.GetSensorData().ranges, 2.0), 1)).tolist()
env.LockPhysics(False)
print max(ranges)

The maximum value of 'ranges' is usually the max value of the sensor
but sometimes jumps to a really low value. When I manually check the
array just after a jump the range data seems to be fine, suggesting
that memory is being written to while I'm reading it??

Thanks,
Chris

On Tue, Nov 2, 2010 at 1:19 AM, Rosen Diankov <[hidden email]> wrote:

> hi chris,
>
> There was a problem with the python bindings, it is fixed in r1806.
> thanks for the report!
>
> rosen,
>
> 2010/11/2 Christopher Flesher <[hidden email]>:
>> Hello,
>>
>> I am trying to use the BaseLaser2D using openravepy but have not been
>> able to get valid data from the sensor. It seems to be rendering fine
>> however...
>>
>> laser = env.GetAttachedSensor('Laser').GetSensor()
>> laser.SendCommand('render 1')
>> print self.deltaT.GetSensorData().ranges
>>
>> The output seems to be a combination of some really large values (much
>> larger than the max range of the sensor) and garbage data (whatever is
>> leftover in memory). Also I'm receiving an array of size (numBeams, 3)
>> instead of just the distance data. I've tried the following things to
>> resolve this:
>>
>> - Looked through tutorials and the mailing list
>> - The data seems to display properly in the qtcoin viewer
>> - Tried playing with the <scantime> attributes in my env.xml file
>> - Tried calling env.StepSimulation(timestep)
>>
>> Also I'm using rev 1788.
>>
>> Thanks,
>> Chris
>>
>> ------------------------------------------------------------------------------
>> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
>> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>> http://p.sf.net/sfu/nokia-dev2dev
>> _______________________________________________
>> Openrave-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: Using the BaseLaser2D

Chris Flesher
Sorry to spam, the jumping value problem is not due to openravepy...
found out that it was originating from my code. Just curious to see if
you think this lock is necessary anyways?

Thanks,
Chris

On Tue, Nov 2, 2010 at 9:39 AM, Christopher Flesher
<[hidden email]> wrote:

> Hi Rosen,
>
> Thanks. It seems to be working for the most part now. There is still
> some problem... seems like the memory for the laser data is being
> written to while I'm reading it sometimes. Is there a way to lock
> this? I tried using the env.LockPhysics to no avail.
>
> env.LockPhysics(True)
> ranges = sqrt(sum(pow(laser.GetSensorData().ranges, 2.0), 1)).tolist()
> env.LockPhysics(False)
> print max(ranges)
>
> The maximum value of 'ranges' is usually the max value of the sensor
> but sometimes jumps to a really low value. When I manually check the
> array just after a jump the range data seems to be fine, suggesting
> that memory is being written to while I'm reading it??
>
> Thanks,
> Chris
>
> On Tue, Nov 2, 2010 at 1:19 AM, Rosen Diankov <[hidden email]> wrote:
>> hi chris,
>>
>> There was a problem with the python bindings, it is fixed in r1806.
>> thanks for the report!
>>
>> rosen,
>>
>> 2010/11/2 Christopher Flesher <[hidden email]>:
>>> Hello,
>>>
>>> I am trying to use the BaseLaser2D using openravepy but have not been
>>> able to get valid data from the sensor. It seems to be rendering fine
>>> however...
>>>
>>> laser = env.GetAttachedSensor('Laser').GetSensor()
>>> laser.SendCommand('render 1')
>>> print self.deltaT.GetSensorData().ranges
>>>
>>> The output seems to be a combination of some really large values (much
>>> larger than the max range of the sensor) and garbage data (whatever is
>>> leftover in memory). Also I'm receiving an array of size (numBeams, 3)
>>> instead of just the distance data. I've tried the following things to
>>> resolve this:
>>>
>>> - Looked through tutorials and the mailing list
>>> - The data seems to display properly in the qtcoin viewer
>>> - Tried playing with the <scantime> attributes in my env.xml file
>>> - Tried calling env.StepSimulation(timestep)
>>>
>>> Also I'm using rev 1788.
>>>
>>> Thanks,
>>> Chris
>>>
>>> ------------------------------------------------------------------------------
>>> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
>>> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
>>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
>>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>>> http://p.sf.net/sfu/nokia-dev2dev
>>> _______________________________________________
>>> Openrave-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>
>>
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users
Reply | Threaded
Open this post in threaded view
|

Re: Using the BaseLaser2D

Rosen Diankov
Administrator
In reply to this post by Chris Flesher
hi chris,

You don't need to lock the environment, the GetSensorData function is
thread safe.

Anyway, I could not reproduce your problem on the
data/testwamlaser.env.xml scene

Please send a script that shows this condition.
rosen,

2010/11/2 Christopher Flesher <[hidden email]>:

> Hi Rosen,
>
> Thanks. It seems to be working for the most part now. There is still
> some problem... seems like the memory for the laser data is being
> written to while I'm reading it sometimes. Is there a way to lock
> this? I tried using the env.LockPhysics to no avail.
>
> env.LockPhysics(True)
> ranges = sqrt(sum(pow(laser.GetSensorData().ranges, 2.0), 1)).tolist()
> env.LockPhysics(False)
> print max(ranges)
>
> The maximum value of 'ranges' is usually the max value of the sensor
> but sometimes jumps to a really low value. When I manually check the
> array just after a jump the range data seems to be fine, suggesting
> that memory is being written to while I'm reading it??
>
> Thanks,
> Chris
>
> On Tue, Nov 2, 2010 at 1:19 AM, Rosen Diankov <[hidden email]> wrote:
>> hi chris,
>>
>> There was a problem with the python bindings, it is fixed in r1806.
>> thanks for the report!
>>
>> rosen,
>>
>> 2010/11/2 Christopher Flesher <[hidden email]>:
>>> Hello,
>>>
>>> I am trying to use the BaseLaser2D using openravepy but have not been
>>> able to get valid data from the sensor. It seems to be rendering fine
>>> however...
>>>
>>> laser = env.GetAttachedSensor('Laser').GetSensor()
>>> laser.SendCommand('render 1')
>>> print self.deltaT.GetSensorData().ranges
>>>
>>> The output seems to be a combination of some really large values (much
>>> larger than the max range of the sensor) and garbage data (whatever is
>>> leftover in memory). Also I'm receiving an array of size (numBeams, 3)
>>> instead of just the distance data. I've tried the following things to
>>> resolve this:
>>>
>>> - Looked through tutorials and the mailing list
>>> - The data seems to display properly in the qtcoin viewer
>>> - Tried playing with the <scantime> attributes in my env.xml file
>>> - Tried calling env.StepSimulation(timestep)
>>>
>>> Also I'm using rev 1788.
>>>
>>> Thanks,
>>> Chris
>>>
>>> ------------------------------------------------------------------------------
>>> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
>>> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
>>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
>>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>>> http://p.sf.net/sfu/nokia-dev2dev
>>> _______________________________________________
>>> Openrave-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/openrave-users
>>>
>>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Openrave-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openrave-users
>

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Openrave-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openrave-users