robopeak/rplidar_arduino

recording a frame

Opened this issue · 8 comments

Hi,

an example on how to record one frame and send it by serial port would be nice. (It is clear that some data may be lost during the serial output)

I tried it with my Arduino Mega. Lidar on UART3, PC on USB.
I tried to record one frame in an int array[359] and send it as soon as the next frame starts. But this results in very strange output. After two hours of try and error I concluded that I must run into a memory overflow. I don't know how much memory gets allocated during runtime - but this may be the issue.

Long story short request:
A demo for grabing and sending one frame woulde be nice.

Thanks
Robert

It is almost impossible to record one frame on Arduino Mega. Since the AVR chip has very limited RAM size. Each measurement sample costs 5 bytes, so a full scan requires at least 5*360 =1800 bytes. This eats up almost all the RAM of the chip.

Thanks for the feedback. I now record and submit half a frame (the front 180 degree) for my robot.
The code can be found here: http://pastebin.com/wQbmNXbu

Nothing special but maybe it is of use for someone.

Any feedback and improvements are welcome :-)

I record a whole frame (angle rounded to full angle; limited to 180 degree scan in this example).
Here the code: http://pastebin.com/nRz0TChH

I get around 3Hz only with this. Any idea on how to improve the code to grab all frames?

I use RaspberryPi and Python to record data from RPLidar, here is the code https://github.com/tong-wang/PyRPLidar

Thanks a lot! I'll give this a try.

On 26 February 2015 at 02:14, Tong Wang notifications@github.com wrote:

I use RaspberryPi and Python to record data from RPLidar, here is the code
https://github.com/tong-wang/PyRPLidar


Reply to this email directly or view it on GitHub
#1 (comment)
.

I have a question that when i used the arduino UNO to receive the data of rplidar A2 with the code, it was ok. but,when i used the arduino 101, it was failed. I can't receive the data.
are there some differences to use the UNO and 101?

I have a question. I used arduino UNO to receive the data of ralidar A2 with your sample. But it transmitted each other. But, Although both of them have same baudrate, it doesn't work. The response is broken. What is my problem?

I have a question that when i used the arduino UNO to receive the data of rplidar A2 with the code, it was ok. but,when i used the arduino 101, it was failed. I can't receive the data.
are there some differences to use the UNO and 101?
@hyb123456
Did you test that this Sensor RPLIDAR A2 works with Arduino UNO? Or do you think that it works?