Hello,
I am making a drone that has a pixhawk 6c and plan to add a Jetson Orin Nano on top to connect to the pixhawk and control its movement based on input from a camera.
For this, I need to write a python script that will get the distance to an object from a depth camera(i will figure this part out) and then tell the pixhawk to travel that distance while maintaining altitude.
First, Is this possible? And if yes, then what resources might be helpful?
Second, I asked chatGPT to write me a script to make the drone go 3 meters forward and 2 meters left at 1 meter altitude, and I wanted someone who is experienced with MAVLink and the python library to verify if the script would actually work.
Here is the script: DroneTEST.txt (2.2 KB)
Finally, how accurate would the speed be based on the Pixhawk 6C’s accelerometer? Can I at least trust that it will always go the same distance every time?(As in it always goes 1.8m when you tell it to go 2m rather than varying randomly)
I plan to fly it outdoors but not too far, the drone will probably move a max of 10 meters from the start location.
I have an M10 GPS connected to the Pixhawk 6C
The Drone will have a set path(see image below) that it will follow. When the camera detects an object on the ground, the drone will receive a message that interrupts the set path and saves the current location. Then, based on the camera data, the drone will move towards the object on the ground and land over it and pick it up with a claw mechanism attached to the bottom of the drone. Next, the drone will return to the start location, drop the item, and then return to the saved location and resume on the original path.
I was looking through the command list and found “Attitude Time” to be a potential solution to my original problem. However, that command takes Pitch, Roll, Yaw, and Time as inputs. How can I convert pitch and time to distance traveled? For example, how far would the drone travel if I applied -20 Pitch for 5 seconds?
Thanks