Neato LDS intensity data
The Neato LDS scanner returns the angle, range, intensity, and an error code. The neato_driver.py from the XV-11 node does not look at the intensity. I want to use the intensity data to help detect 'bright' obstacles marked by reflective tape. How can the driver by modified to return intensity data. My Python skills are non-existant. my first attempt failed. Can I do a pull request still on the Git repository. (Fergy and Ralph probably have better things to do with their time.
???? Code ????? def getScanRanges(self):
""" Read values of a scan -- call requestScan first! """
ranges = list()
intense = list()
angle = 0
if not self.readTo("AngleInDegrees"):
self.flush()
return []
last=False
while not last: #angle < 360:
try:
vals,last = self.getResponse()
except Exception as ex:
rospy.logerr("Exception Reading Neato lidar: " + str(ex))
last=True
vals=[]
vals = vals.split(",")
if ((not last) and ord(vals[0][0])>=48 and ord(vals[0][0])<=57 ):
#print angle, vals, intense
try:
a = int(vals[0])
r = int(vals[1])
# i = int(vals[2])
e = int(vals[3])
while (angle < a):
ranges.append(0)
# intense.append(0)
angle +=1
if(e==0):
ranges.append(r/1000.0)
# intense.append(i/1000.0)
else:
ranges.append(0)
# intense.append(0)
except:
ranges.append(0)
# intense.append(0)
angle += 1
if len(ranges) <> 360:
rospy.loginfo( "Missing laser scans: got %d points" %len(ranges))
# return ranges, intense
return ranges
The following code with comments(#) removed does not abort, but rostopic echo /scan shows intensities[ ]