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.


2008/6/19 Cressel Anderson <>:
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)
laser=playerc.playerc_laser( player_client, 0)
print 'laser.scan_count = ',laser.scan_count
print laser.ranges
print 'range 0, 1 ='
print laser.ranges[0],', ', laser.ranges[1]

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

This is not the output I expect.


Check out the new Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
Playerstage-users mailing list

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