Python Scripting

I’m trying to write a simple python script that polls the quadcopter for it’s GPS coordinates. However, everytime I try to run the script in the mission planner software, the program just crashes.

I need the quadcopter to write its GPS coordinates to a database so that’s why I need to poll it whenever I want. Anyone have any ideas on how to do this or why Mission Planner is crashing?

You do realize that the copter is continuously streaming it’s position to the GCS via MAVlink and you can access that information right?

I did not know that, sorry I’m a total newbie at this. The problem is, I cannot use a GCS. I am trying to make this quadcopter completely autonomous. So it will fly to a particular location, stop, sample some data, and beam the data back to me along with the GPS coordinates at which it took that sample.

Obviously, the locations it travels to is preloaded via the GCS. But after that, everything is autonomous. So I can receive the data of the sample it collected but I don’t understand how to get it’s GPS coordinates.

The autopilot is recording the GPS coordinates (make sure the GPS message is enabled) so you can download the log from the autopilot.

copter.ardupilot.com/wiki/downlo … n-planner/

Sounds like you need your own program to just decode the mavlink stream coming from the vehicle

please post the script that is causeing the crash.

^^^ Sorry to be redundant (as I said this in another post), but with the latest MP it will crash with any script – even scripts that don’t call on a single aspect of the APM extensions (i.e. a native-only Python script).

latest beta should resolve this