How to utilize zranger with different sonar

Firmware/software/electronics/mechanics
Post Reply
kyubot
Beginner
Posts: 4
Joined: Mon May 28, 2018 8:40 am

How to utilize zranger with different sonar

Post by kyubot »

Hello,
I am trying to use a sonar to make the drone more accurately maintain its height during motion.
This sonar gives PWM signal of measurements about 30 cm ~ 400 cm.
So I implemented a driver which reads the pwm using TIMER Interrupts that reads the Pulse width everytime it detects the edge.
I figured it is working correctly.

I also found that there is zranger.c and zranger2.c under deck/drivers folder however could not figure out what is the best way of binding my sensor data to these files.
It looks like it is developed for VL53L1 or VL53L0.

Is there any documents on using zranger or anyone can give me a thought on this issue? Any help would be much appreciated.
Thanks,

Kyu
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How to utilize zranger with different sonar

Post by tobias »

The architecture needs some love but basically you need to fill in the height value as called from here in the sensors_cf2.c. The fill in the height estimation as in zranger.c
Post Reply