|
Laser spot variable in Lisp API Brian Johansen from Denmark [2 posts] |
14 year
|
Hi Steven
Im trying to get the Laser points variable in my Lisp controlled robot (leaf project)
i write (getvariable 'Laser_Points) and the API returns either with Laser_points or an error because of to many commas.
My setup is working because i can get other variables from fiducials fx.
Could it be because Laser_points is an array ?
best regards
Brian Johansen
|
|
|
Anonymous |
14 year
|
Brian,
The fiducials array should be very similar to the Laser points array in terms of handling the array. Most likely since an array is transmitted to lisp as a bunch of numbers in a comma separated list LISP is probably not liking the length of this array.
Do you know how many points are being transmitted when it breaks? It is either a bunch or perhaps none. Either extreme could be a reason for the breakage. If we know which case is causing the error we can probably do something in RR to fix it or update the LISP API calls to better handle this situation.
Note, you should see a similar behavior with the Fiducials .. but having many fiducial results is rare whereas having many laser points is not.
You
STeven.
|
|
|
Brian Johansen from Denmark [2 posts] |
14 year
|
Hi Steven
I have now done some test, and i looks like i get the fault :
Error: A comma appears outside the scope of a backquote (or there are too many commas), when there is more than one laser point.
When i see only one or no laserpoint ( i check it with Watch_Variables)
i get no variable in Lisp and no fault.
-Brian
|
|
|
Anonymous |
14 year
|
Brian,
If you add the following line
(setq response (substitute #\_ #\, response))
just after all the others in the ParseResults function. The rr-string-to-list does not like commas when creating a list. The above will replace all commas with an underscore which you will then have to create a list from in order to use each value.
The RR_API.lisp has been updated.
STeven.
|
|