Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect computation of intensity value? #27

Open
ecourtois opened this issue Nov 8, 2022 · 0 comments
Open

Incorrect computation of intensity value? #27

ecourtois opened this issue Nov 8, 2022 · 0 comments

Comments

@ecourtois
Copy link

Hello,

First of all, thanks for this very complete SDK!
I am using a YDLidar G2 device. I cannot get a correct intensity value.
Here is what I found in the source code:

In CYdLidar class, there is a member m_IntensityBit that can be set using setlidaropt and defaults to 10.
Depending on the device type, there can be no intensity value, or intensity value on 8 or 10 bits.

However, in YDlidarDriver class, there is also a member m_intensityBit, but it does not seem to be linked to the same member in CYdLidar.

In YDlidarDriver::getIntensityFlag(), called from YDlidarDriver::startScan(), m_intensityBit can be set to 0 or 8, but never to 10.

So in YDlidarDriver::parseNodeFromeBuffer(), the 2 upper intensity bit coming from the distance register are never used.

With a YDLidar G2 which has 10-bit intensity value, if the intensity becomes greater than 255, it returns to 0 whereas it should continue to increase until 1024.

Is my understanding correct or did I missing something to get the correct intensity value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant