Hi.
I’m reading data from my YLIDAR F4 (C#, accessing the serial port).
I can read data but I can’t figure out the unit of measure used for angles.
As stated in the Development Manual, received scan packets contain a starting angle and an ending angle, both coded in two bytes.
I can’t find any reference to the unit of measure, and I can’t guess from the data I read from the device - a screenshot from the test application here.
Any help is appreciated, thanks
I don’t know if this is right or not, but the datasheet says it has an angle resolution of 0.50 degree (bottom of page 3.) Based on that I would take a bet that the number you get is the integer degrees * 2. for Example, 121.5 degrees would be transmitted as 243. Divide that by 2 (243 / 2 = 121.5)
But, of course, I could be completely wrong
EDIT – After posting that I looked at your numbers and that didn’t work. But I still suspect it is the angle in degrees times some constant. Probably either a convenient decimal number (*100) or a binary number (*4, *8, *16, etc)
Anyway, sorry I don’t have your answer – that is some of the worst documentation i’ve seen in a long time
Hi there, OldGuy, and thanks for your answer.
I’ll try some multiplier and see what happens.
It was a good laugh when I read your comment about the “worst documentation”.
Did you take a look at the SDK?! ^^_
Ciao.
Orf Quarenghi
The multiplicator could be 128.
I’m trying dividing by 128 and here are the results:
I am also “sampling the samples” (!) trying to find the maximum and minimum angle used…
It’s a bit bewildering… it seems data come in a bit randomly.
I never get exactly 0° or 360°…
About angle resolution of 0.5°… well, this thing doesn’t exactly behave like a stepper motor… It really is a laser distance meter strapped noto a DC motor!
In the end, I guess I’ll have an array of, say, 2*360 integers and each time I get a new packet I’ll go writing in the appropriate elements…
Those numbers look reasonable to me. I think you might have it.
I just skimmed through the documentation – I saw enough! I didn’t look at the SDK.
The comment about the resolution came straight from the docs. Even though the system “could be” at any point, it has to measure it to some resolution and also has to fit that resolution into the 16 bit integer it sends you. So it is likely the numbers you get are to 1/2 degree. But it is possible you are getting numbers of say 1/8 or 16, or something, they just aren’t accurate to less than 1/2. But with docs like that, who knows?
One thing I didn’t mention was to make sure you put the two bytes back together in the right order. I suspect you have done that, but in the docs it seems some are high byte first and some low byte first, and its also quite possible that the docs are wrong in some places.
One more thing you might try is to run the thing in a large area with nothing to detect for a large distance in all directions (maybe a large empty room or an open field.) Then place an object at a known angle (say 90 degrees) and see what numbers it sends you for that object.
Anyway, good luck!
I just skimmed through the documentation – I saw enough! I didn’t look at the SDK.
One thing I didn’t mention was to make sure you put the two bytes back together in the right order. I suspect you have done that, but in the docs it seems some are high byte first and some low byte first, and its also quite possible that the docs are wrong in some places.
Yes, big endian. This seems consistent.
One more thing you might try is to run the thing in a large area with nothing to detect for a large distance in all directions (maybe a large empty room or an open field.) Then place an object at a known angle (say 90 degrees) and see what numbers it sends you for that object.
Anyway, good luck!
I’m almost there. It’s like in the space opera books I love so much: you find an ancient and poerful artifact and you have to poke it with your stick in many ways in order to find out how to get to the big power it contains…
Let’s hope I’m the hero, not the villain that will be consumed by the evil artefact!!!
Thank you for your answers.
Orf Quarenghi
P.S. Now I have to guess the unit of measure it uses for the distance!
BlockquoteP.S. Now I have to guess the unit of measure it uses for the distance!
Lol!
I’m confident you’ll be the hero.
I’ve dealt with quite a few pieces of equipment like this. Fortunately I like a challenge!
I’ll be interested to see how it turns out.