you need to use laser.get_range(index) now in player 2.1. This is related to the dynamic array changes in the underlying player interfaces.

Toby

2008/6/19 Cressel Anderson <cressel@gatech.edu>:
I am using two Hokuyo URG's and have verified that the server is
operating using playerv. I have been using version 2.0.4 and just
updated to 2.1.1. Under 2.0.4, I had success accessing the URG's ranges
using python. In the past I have been able to access the range readings
similarly to this:

import playerc
host = 'localhost'
port = 6665
player_client = playerc.playerc_client(None, host, port)
player_client.connect()
laser=playerc.playerc_laser( player_client, 0)
laser.subscribe(playerc.PLAYERC_OPEN_MODE)
player_client.read()
print 'laser.scan_count = ',laser.scan_count
print laser.ranges
print 'range 0, 1 ='
print laser.ranges[0],', ', laser.ranges[1]


Output:
laser.scan_count =  654
<Swig Object of type 'double *' at 0x81d52d0>
range 0, 1 =
Traceback (most recent call last):
  File "problem.py", line 18, in <module>
    print laser.ranges[0],', ', laser.ranges[1]
TypeError: 'PySwigObject' object is unsubscriptable


This is not the output I expect.

Thanks,
-Cressel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users



--
This email is intended for the addressee only and may contain privileged and/or confidential information