I wanted to post the code and exe of the Flash file for the Ground Station and my AP. If you want to try it, you need to do a few things first.

(If you try this, remove your throttle or disconnect your ESC from your motor!)
1 - Load the DefaultsWriter.pde onto the Ardupilot HW to get some decent values into the EEprom
2 - Load the Waypoint Writer onto the Ardupilot HW to put some waypoints into the EEprom
3 - Load the JSXPilot_Navigate.pde onto the Ardupilot HW
4 - Download Serproxy and configure it as indicated in the cfg file
5 - Run the Flash app as an EXE or with a local Flash player or -maybe- it will work in a browser
6 - Press the space bar to connect the GS to Serproxy
7 - tilt the plane to adjust the IR sensors and the plane is set to fly at 30MPH - it's in debug mode
8 - If you want to play further, look in the test.pde and see test versions of 3 important functions. Elsewhere in the code these functions have been relabeled with a "_off" also turn off debug mode in the defines.h

This is a lot, but I'm used to it. Also, this is information for people making there own AP or just curious. It's not supported. It only works with my radio. It's barely tested. The code is very well commented. If you can get it to work for you, you win a gold star.

Download it here
You can see the video here of it in action. GroundStation.mov

Views: 776


3D Robotics
Comment by Chris Anderson on November 8, 2009 at 7:59pm
Is there supposed to be a link to the code and exe?

Developer
Comment by Jason Short on November 8, 2009 at 8:01pm
Link added.

Developer
Comment by Jason Short on November 8, 2009 at 8:04pm
I forgot to mention. This code is using the trick of pulling the Pin 7 high and low to toggle the serial mux on the V2 Ardupilot Shield. The groundStation.pde file contains the parsing code.
Comment by Zak on November 8, 2009 at 8:58pm
Very cool. Why is the angle of the plane down? (Lower left icon, if the name is incorrect...) Shouldn't that be reversed (so the head of the plane is up)? I really like the map display. I always wondered conceptually how auto pilot works, and that visual aid helped. Thanks. :)

Developer
Comment by Jason Short on November 8, 2009 at 9:45pm
I saw you are a Perl guy. I wrote a Perl socket server for the BS2 and Flash about 4 years ago. I still do a lot with it. I'm doing all of my waypoint parsing in Perl.
Comment by JC on November 8, 2009 at 10:46pm
Thats a nice looking ground station

Developer
Comment by Jason Short on November 8, 2009 at 10:59pm
The plane angle is caused by me being at my kitchen table and sensors that are pointed at something warm. I'm using my hand to steer the plane by interfering with the XY IR sensors. I have a turn rate estimator that runs while the plane is waiting for GPS that is useful for this kind of simulation. I just have a faked out GPS routine for testing that doesn't correct the estimation and let's it fly on.

T3
Comment by Krzysztof Bosak on November 12, 2009 at 12:39pm
Display is messed up in my 1280x1024 screen. P

robably screen aspect ratio 5:4 plays a major role here.

T3
Comment by Krzysztof Bosak on November 12, 2009 at 12:40pm
BTW what is the protocol?

Developer
Comment by Jason Short on November 12, 2009 at 1:05pm
If you look in the print.pde file you'll see void print_data() which has all of the output params.
I'm using a format like this:
Serial.print("!!");
Serial.print(groundSpeed,DEC); // 0
Serial.print("|");
Serial.print(airSpeed, DEC); // 1
Serial.print("|");
Serial.print(throttle,DEC); // 2 throttle set by AutoPilot
Serial.print("|");
Serial.print(roll,DEC); // 3
Serial.print("|");
Serial.print(pitch,DEC); // 4
Serial.print("|");
Serial.print(rollSensor,DEC); // 5
Serial.print("|");
Serial.print(pitchSensor,DEC); // 6
Serial.print("|");
Serial.print(altitudeAboveHome(),DEC); // 7
Serial.print("|");
Serial.print(climbRate,DEC); // 8
Serial.print("|");
Serial.print(wpIndex,DEC); // 9
Serial.print("|");
Serial.print(wp_distance,DEC); // 10
Serial.print("|");
Serial.print(wp_TotalDistance,DEC); // 11
Serial.print("|");
Serial.print(planeBearing,DEC); // 12
Serial.print("|");
Serial.print(targetBearing,DEC); // 13
Serial.print("|");
Serial.print(bearingError,DEC); // 14
Serial.print("|");
Serial.print(actualTurnRate,DEC); // 15
Serial.print("|");
Serial.print(estTurnRate,DEC); // 16
Serial.println("|");

The values are sent unlabeled to save time and bandwidth. If you don't have a variable that matches, just send a 0.

For example - the acutalTurnRate variable is for my debugging, sending 0 instead wouldn't affect anything.

You should be able to easily replace the variable name with the Ardupilot names and get it to work.
Jason

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service