Where to start with programming autonomy?

Hello,

I am working on a project that requires me to program in a flight path for a drone in which it follows another vehicle if that vehicle appears.

Where do I start in regards to programming? I’ve followed the basic tutorial on the documentation with the px4_simple_app. But how do I go about programming the drone itself?

I am having trouble finding the documentation that will explain to me how to code the movements of the drone, or pre-program a flight path for the drone.

Can somebody point me in the right direction to find this? Thanks!

It is as simple as uploading a mission to your PX4 drone using QGroundControl GUI then swiping the screen to start the mission.

This is assuming you have the drone hovering and following commands in manual/altitude/position modes.

1 Like

Thanks! I suppose that will have to do for now.

Do you know how I would get started in having that vehicle follow another one?

You’ll just have to dig into Mavlink Messaging if you want to automate this in code. QGC is just a nice wrapper around mavlink messages to the aircraft.

Your second question will need a lot more detail. Can you talk to the other aircraft? How do you want them to communicate? Visual tracking? Do you plan on passing the lead vehicle information from a ground station or directly between aircraft?

So I need a drone to detect(based on color) and follow a specific vehicle.

For example. My drone is on its flight path and on that flight path it detects(sees) a red car, it then diverts from the flight path to follow the red car.

As @dlwalter has mentioned you have to dig into mavlink messages. One approach I can think of is that you need a onboard computer like jetson nano and run ros, you will need ros to interface camera with a python script which will detect the object and though this script too you will be giving commands to drones with the help of mavros as you have seen in examples in documentation. Mavros gives you the various ros messages and topics to talk with drone over mavlink protocol. Morever you can work and control the jetson like which script you would like to run just like raspberry remotely.
Let me know if you any other way.
I am beginner as you.
this link is for better understanding : connection_between companion computer

I do have the same query