Robotics StackExchange | Archived questions

MAVROS RC Override Python Script Troubleshooting

Hello, I've been writing software for many years but am new to ROS and drone development. I have built a DIY quadcopter drone using Erle Robotics' PXFmini autopilot.

I have the following simple script that successfully arms the drone for a few seconds: https://gist.github.com/dsposito/e9daaed88ae13dff9546f0cfc6c92694

I'm now trying to programmatically pilot the drone 100% using ROS via RC Override. As a simple test, I'd like to have the drone slowly takeoff and rise into the air a few feet, hover roughly in place for a few seconds, and then slowly descend and land. Eventually, I'll want to be able to easily move the drone in a given direction a few inches / feet but that's about it.

NOTE: My drone does not currently have a GPS unit so I've been using the STABILIZE mode to manually control all aspects of the flight.

I'm having a couple of problems with this more advanced script: https://gist.github.com/dsposito/2065d446d0e7bb563b88aabe1eace0f4

1.) I'm struggling to understanding how to manage the throttle for a slow, controlled takeoff - the motors either spin slowly or super fast - not sure how to have more granular control. 2.) The script "works" the first time I run it but oddly does not work any time I run it after that (all ros cli output appears successful but the motors do not spin). It's as if the drone gets stuck in a weird state.

I appreciate any help or suggestions you may have!

Asked by dsposito on 2018-03-20 01:11:51 UTC

Comments

I am trying to send RC commands in px4 simulation using a ROS node same as your's but I facing the issue while sending RC commands. In the simulation, the drone is not taking off after arming.

Asked by Nebula on 2018-07-13 04:09:43 UTC

Hi Nebula, did you found the solution? As i am also stuck on the same.

Asked by Desmnd on 2018-11-22 01:29:03 UTC

Answers