Some questions while using Lighthouse distance measuring

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
slalomoth
Beginner
Posts: 1
Joined: Sun Mar 14, 2021 5:49 am

Some questions while using Lighthouse distance measuring

Post by slalomoth »

Hello, I am a student. In order to achieve automatic obstacle avoidance, our team want to measure distance by using UWB deck.
Example of the final implementation: when there is no obstacle, crazyflies can reach the location B from A directly. If there is an obstacle in the middle, crazyflies can circumvent the obstacle from location B to A through automatic obstacle avoidance.
We are beginners of coding and want to achieve the purpose by modifying the code.
Besides, we use Lighthouse location system.
If the method mentioned above is available, how should we oprate in the source code?(The more detailed the better)
arnaud
Bitcraze
Posts: 2463
Joined: Tue Feb 06, 2007 12:36 pm

Re: Some questions while using Lighthouse distance measuring

Post by arnaud »

I am a bit curious of how you achieve distance measurement to an obstacle with UWB (ie the LPS deck)? Are you maybe using the multiranger deck instead?

In either case, the way to go is to make an out-of-tree app, you can make an app for the Crazyflie and pull the Crazyflie firmware as a subrepos. An example of how to organize your project can be found in this push example that uses the multiranger and flow deck: https://github.com/ataffanel/crazyflie-push-demo.

When making an app, you are starting with the app laywer documented there: https://www.bitcraze.io/documentation/r ... app_layer/.

There is a brunch of example already in the Crazyflie repos that shows how to do various things that will be useful for you. For example the swarm demo (https://github.com/bitcraze/crazyflie-f ... swarm_demo) is using the high-level controller in a lighthouse system. You should look at goto setpoints mostly since this is likely what you are going to need. The push demo I liked above and in the crazyflie repos shows how to detect and react to obstacles using the multiranger deck.

There is no official API to be used in app yet, so you will have to look at examples and at the Crazyflie code to see how to do things. But everything you can do from a python script on the ground, should be doable in the firmware as an app.
Post Reply