Wiki | Community | Discussion Forum | Q&A

LaserData has no attribute numLaser

Hello,

while tryin to parser the sensor data, i got an error tellin’ me that the ‘LaserData’ instance has no atribute ‘numLaser’.

Captura%20de%20pantalla%20de%202019-04-01%2016-33-47

This is my function parser:
Captura%20de%20pantalla%20de%202019-04-01%2016-34-17

and this is where i call it:
Captura%20de%20pantalla%20de%202019-04-01%2016-34-39

Thanks.

Hi,

what are you trying to do exactly? where do you get that numLaser attribute from? To get the laser data values read the exercise API: laser.getLaserData().values. I don’t know where that numLaser comes from.
Also, what is distanceData? I suppose you are trying to get the readings of the laser but I am not really sure.

Please, explain what is the purpose of this function and what are those attributes, so I can help you!

Regards.

Hi,

this come from the main exercise API:

Captura%20de%20pantalla%20de%202019-04-01%2021-18-26

Oh I see, I thought that was fixed. Yep, that part of the theory is outdated, so nevermind it. Use the API given in the code section instead.