Autonomous Indoor Drone


#1

Hi All,
I’m trying to create an autonomous drone that will fly indoors using LiDARs.
Currently I have a connected Optical flow and RPI zero 2w to the drone. fully communicating with each other. I Calibrated the OF and using the controller the drone flies very well with no significant oscillations.

My problem is when I try to use the RPI and send commands to the drone- I managed to send commands for changing flight mode and to arm the drone. when I try to use simple_takeoff, using the code from dronekit site, it just dont take off. seems like the command dont change the thrust level of the drone.

Do you have any suggestion what can I do?

Thanks!


#2

Could you re-post your question under ‘Drone Building’ or ‘Programming’?

Are the props spinning?
Did you try re-calibrating the radio?
Could you post a screen shot of your code? Copy/paste might alter the indents.


#3

Hi, Changed the topic to programming.

The props are setup correctly and spinning. The RC working, If I try to control the drone using the RC it works perfectly.
Maybe the throttle needs to be on mid for the code to work? I tried that but then the drone didn’t arm.

The takeoff code is:

image

The Altitude I set in the simple_takeoff is in the range of the LiDAR


#4

Takeoff uses the barometer, and transitions to lidar, so it shouldn’t be a hardware issue since you said it already works with the transmitter.

I think it is a problem with your program, but the code you shared looks good. Perhaps there is something amiss with the other parts? You can email [dronedojoforum@gmail.com] the whole code and I can look at it and test it.

Otherwise I’m not sure. I can ask a few more questions, though they may not be relevant to your issue.
What do you see in the MF Messages? Sometimes it can be revealing.
Did you examine the .bin file? [INS_LOG_BAT_OPT = 1]
No connected GPS, right?
Are you indoors? Did you try outside?
What fc are you using?
What OF and lidar are you using?

You can also try posting your question to the Ardupilot forum or contact Caleb [https://dojofordrones.com/contact/], unless he sees this message. :slightly_smiling_face:

References
https://www.youtube.com/watch?v=onevfKpEhos

https://discuss.ardupilot.org/

[EKF3,Optical flow and GPS behavior - ArduCopter / Copter 4.3 - ArduPilot Discourse](EKF3,Optical flow and GPS behavior - ArduCopter / Copter 4.3 - ArduPilot Discourse)


#5

Thanks for the reply. I sent my code in the email with 2 log files. I looked at the lob file, couldn’t find anything that helped me.

I did set that the main sensor for position Z for the KF will be the LiDAR and not the barometer.

The takeoff using the controller is all manual- takeoff in stabilize and switching to GUIDED.
Trying to fly indoors, no GPS or compass.
FC- Speedybee f405 v4.
OF- micoair mtf-02


#6

I managed to make the drone take off in guided mode.
I made a lot of changes for the optical flow and LiDAR but I think that what made the change is the parameter GUID_OPTIONS.
In mission planner it was 1, in Qgroundcontrol it was 0. Anyway, I changed it to 9 and it workd.
Now the next challenge is to make the drone move forward with the relevant command from DroneKit


#7

Good to hear.:+1:
Interesting, I never have used these setttings.
I see this setting equals 9:
image