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

AP_RangeFinder_VL53L0X.cpp version 3.6-Dev - Arducopter #8072

Closed
shaddow501 opened this issue Apr 3, 2018 · 2 comments
Closed

AP_RangeFinder_VL53L0X.cpp version 3.6-Dev - Arducopter #8072

shaddow501 opened this issue Apr 3, 2018 · 2 comments

Comments

@shaddow501
Copy link

shaddow501 commented Apr 3, 2018

Hello

Can it be that the return value is in M instead of cm and that is why I get Lidar error?
At "sonarrange" I get values of 0.01 to 1.27 +-.

Update:
It seems when I change those parameters it gets accurate reading.
I still get "Bad LiDAR health" could it be because "sonarvoltage" = 0? I mean does the "Bad LiDAR Health" function report error because the sonarvoltage is 0? and this sensor doesnt have read voltage function?

can anyone confirm?

void AP_RangeFinder_VL53L0X::update(void)
{
if (counter > 0) {
state.distance_cm = sum_mm * (10/counter);
sum_mm = 0;
counter = 0;
update_status();
} else {
set_status(RangeFinder::RangeFinder_NoData);
}
}

void AP_RangeFinder_VL53L0X::timer(void)
{
uint16_t range_mm;
if (get_reading(range_mm) && range_mm < 8192) {
sum_mm += range_mm;
counter++;
}
}

Update:
it seems that the values are configured as CM, but the "sonarrange" is shown in Meters, I search a lot in the web to know how "sonarrange" show the value, again assumed it was in CM but it wasnt.
Very confusing....!
so the main code is correct - state.distance_cm = sum_mm / (10*counter);
I should get values from 0.01 to 1.27. means 1 CM to 1.27 M.
I notice that after I set the state.distance_cm = sum_mm * (10/counter); ,lifted the sonar about 7 CM and the Mission planner showed that I raised it by 7 Meter!!

Still getting "Bad Lidar health" though.

In ardupilot web site there is a note:

If you get a “Bad LiDAR Health” message in Mission Planner this is caused because the rangefinder isn’t enabled for landing. This is done through the RNGFND_LANDING parameter and if set you should see the message disappear.

But there isnt any value named RNGFND_LANDING in the parameters list...
I did see the EK2_RNG_USE_HGT and set it to 70% but still didnt fix the Bad LiDAR Health..

Any thoughts? Is it a bug?

@shaddow501 shaddow501 changed the title AP_RangeFinder_VL53L0X.cpp version 3.6-Dev AP_RangeFinder_VL53L0X.cpp version 3.6-Dev - Arducopter Apr 10, 2018
@auturgy
Copy link
Contributor

auturgy commented Jul 30, 2018

Ref #9024

@rmackay9
Copy link
Contributor

rmackay9 commented Jul 30, 2018

I think this report is probably also related to the range finder driver issue so let's close it.

This fix to the drive will go out this week for beta testing in Copter-3.6.0-rc7

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

3 participants