Open hunterthorington opened 10 years ago
Research ideas: Create a new flight mode. *Create a new MAVlink command. Run script through python.
Links: Creating a new MAVlink command - http://qgroundcontrol.org/mavlink/create_new_mavlink_message. QGroundControl (a different possibly more customizable ground station) - https://code.google.com/p/ardupilot-mega/wiki/QGC. DancingServo example - https://code.google.com/p/ardupilot-mega/wiki/ProgrammingArduino. Python script example - https://code.google.com/p/ardupilot-mega/wiki/Acrobatics. Possibly helpful camera info - http://diydrones.com/forum/topics/arducopter-navigation-with-wii-camera.
http://diydrones.com/profiles/blogs/infrared-beacon-guidance-for-the-arducopter seems to be a summary of the forum post. He seems like he's taken some baby steps towards moving the code that we use to run our PC demo into something the ArduCopter can use. Still nothing on how to implement a precision landing algorithm though.
There was, however, a comment that could be used as a starting point, from a developer on the forum board (last link Rick's post) of where to start. Excerpt:
" I believe we're using two nested PI controllers to control position. The main functions that would need to be modified would be in navigation.pde. In particular calc_location_error and calc_nav_rate. So what it looks like is: -- update_navigation in ArduCopter.pde gets called at 10hz. In LOITER mode this immediately calls update_nav_wp. -- update_nav_wp in turns calls the calc_location_error function to get the lon/lat distance to the target. these distances are then passed into the more complex calc_nav_rate function. -- calc_nav_rate uses a PI controller to calculate the desired lat/lon speed (slightly confusingly renamed to x and y) and the another PI controller to convert speed to an angle to lean at -- calc_nav_pitch_roll converts this 'angle to lean at' into roll and pitch angles.
So if you could modify those two functions, calc_location_error and calc_nav_rate, it should work. Some gotchas are that the navigation code probably only gets called if we have a gps lock. There's added complexity because we work in lat/lon distance/speed/angles right up until the calc_nav_pitch_roll stuff...but staying consistent with that might be good especially if you want your code to work outside too."
I'm planning on delving through that code between classes before lab.
It is possible that we could re-write the loiter flight mode to be our precision landing. This would keep us from touching other areas of code. It looks like we are going to be confied to using the MavLink programs to upload a flight plan each time we want to fly the quad copter. In light of this I think we should look into the the idea of getting a zigby to attach to the arduno so that we can modify the flight plan without having a USB connection. Over the weekend I was able to get the quadcopter to fly inside using only the flightplanner software. I was able to get a USB extension and tether the quad copter to send it commands manually. I couldn't figure out how to disable the GPS though. The flight modes seems to only work if you have a GPS sync. This afternoon I think we should go outside and get a good understanding of the controller software and all the flight modes. Then progress from there.
http://copter.ardupilot.com/wiki/arducopter-parameters/#Library_Parameters Seems like a description of all the MAVLink parameters. Might be useful if we start scripting.
MavLink guide for absolute dummies (me): http://api.ning.com/files/Tc1DvjhnAzXqvzUt8x9oAy2mCvEub4Br0bbMkchq9QnvL*1wpwyoEvJlheOALmmmIkC8LSwA6weXjqGBoUueb17TeY*-Iq3J/MAVLINK_FOR_DUMMIESPart1_v.1.pdf
Quick Summary of Dev Resources:
Developer's guide to implementing new control algorithms, new flight modes, and new parameters: http://dev.ardupilot.com/wiki/code-overview-adding-a-new-parameter/ http://dev.ardupilot.com/wiki/apmcopter-adding-a-new-flight-mode/ http://dev.ardupilot.com/wiki/apmcopter-adding-a-new-roll-pitch-mode/
Setting up a test environment on a Linux Virtual Machine for software testing without hardware: http://dev.ardupilot.com/wiki/setting-up-sitl-on-windows/
I found a few links that might help us learn more about working with the APM:
Simplified overview of the code structure: https://docs.google.com/document/d/1OCEMtCq7Njr-YeEroSsMPQCZNP0QvMxqYPPCJy2zZHI/edit?hl=en Two hour webinar on developing with the Ardupilot code: http://www.youtube.com/watch?v=xA0z65TnMv0&feature=youtu.be Slides for the webinar: http://goo.gl/eVQuR
I came across a couple papers from various academic sources that describe what we are doing. Might be helpful.
http://www.cogsys.cs.uni-tuebingen.de/publikationen/2010/Wenzel2010imav.pdf http://link.springer.com/article/10.1007/s10846-010-9473-0#page-1
Succeeded in running the dancing_light function in user code on the ardupilot. The following article was an invaluable resource.
http://the-force-physics.com/index.php?title=User_Hooks_and_Adding_User_Flight_Modes
Download Ardupilot IDE from http://ardupilot.com/downloads/?did=44 (Mac) or http://ardupilot.com/downloads/?did=45 (Windows). Download source code from http://ardupilot.com/downloads/?did=70.