Commit Graph

715 Commits

Author SHA1 Message Date
jasonshort e185d02785 better default config
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1549 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-24 01:57:31 +00:00
jasonshort 78e19fbe26 improved throttle PIDs
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1548 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-24 01:55:19 +00:00
DrZiplok@gmail.com d38874cd05 Move the unit test framework out of the unit tests. Add unit tests for the k_typeid_* constants.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1543 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 23:59:26 +00:00
DrZiplok@gmail.com 27c36583d0 Add a function to AP_Var for finding a variable by name. It is not efficient, but convenient for e.g. interactive use.
Add pseudo-constant copies of the AP_Meta_calss::Type_id for the standard AP_VarT subclasses.  This makes checking the type of a possible AP_Var much cheaper than calling ::meta_cast, as there is no object con/destruction involved.

Add some helper functions for manipulating AP_Vars from Menu interfaces.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1541 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 23:58:07 +00:00
DrZiplok@gmail.com 7f5b882e1a Don't include AP_Vector (in preparation for retirement) and AP_Loop (because it's not being used by APM*). Interested clients can still include AP_Loop if they need it.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1540 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 23:48:07 +00:00
DrZiplok@gmail.com ce651511d7 Rename AP_Meta_class::AP_Type_id to AP_Meta_class::Type_id in keeping with the coding standard.
Add a non-static version of AP_Meta_class::meta_cast that can be used against any subclass object directly.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1539 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 23:46:58 +00:00
DrZiplok fd83ba7753 Fix a serious typo, add more documentation.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1538 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 20:33:20 +00:00
DrZiplok e2f15b3b97 Move the Test unit test framework out into its own header, so that it can be used by other libraries.
Add some documentation explaining how it is used.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1537 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 20:26:11 +00:00
jphelirc 021746fd0a hexa frame setp
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1536 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 16:40:03 +00:00
DrZiplok@gmail.com b8598c7ef6 Simplify AP_Var_group::_serialize_unserialize slightly by removing some variables.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1535 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 10:04:24 +00:00
DrZiplok@gmail.com 8de4cc56da Improve performance when saving a number of variables that don't have space allocated in the EEPROM. This avoids scanning the entire EEPROM every time a variable that has not yet had space allocated is written.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1534 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 09:56:58 +00:00
DrZiplok@gmail.com 82fdeb11bb Fix ::save_all/::load_all so that they check the correct criteria for opt-out. Now load/save_all work.
Fix prototype for AP_Var_group::serialize so that it's called correctly when saving a group.  Now group load/save works.

Add load/save_all and group load/save unit tests.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1533 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 09:27:58 +00:00
DrZiplok@gmail.com 3adec05593 Fixes for EEPROM space allocation and mapping.
- We can't count on the first EEPROM scan knowing about everything; new variables may be constructed later so be willing to go back and re-scan the EEPROM if we encounter a new variable that hasn't been loaded yet.
- Sort out where _key actually points (the variable's data) in the EEPROM and get everyone to use the same interpretation.
- Fix return values from ::save and ::load.
- Make it possible to re-save after ::erase_all by de-locating all variables before the EEPROM is blown away.
- Fix args to eeprom_read_block/eeprom_write_block so that we don't spam random memory.

Add unit tests for basic save/load operations.


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1532 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 08:11:53 +00:00
DrZiplok@gmail.com 1a2ce433e1 I never liked the plan that variable groups could only be statically scoped; it was much too fragile. These changes address that issue by splitting the global variable list into two lists, one for standalone variables (including groups), and one for variables that are members of a group.
Now a variable belonging to a group can safely be constructed before the group it belongs to, and the group can be destroyed before its member variables.  This greatly simplifies the AP_Var constructor(s).

Remove the lookup-by-index and lookup-by-key interfaces to AP_Var and replace them with first/next interfaces for all variables, and for variables belonging to a specific group.  Document their usage.  Add an accessor for the key associated with a variable so that search-by-key can be performed by a consumer.  Throw away the lookup cache implementation, as it's not required anymore.

Re-layout the EEPROM variable header and tweak the EEPROM space allocator so that it's more resistant to interruptions during variable save.

Fix the global constants so that they work.

Add an interface for erasing all variables in EEPROM (only writes one byte).

Fix unit tests so that they work with the changed interfaces.  Also tweak the unit test framework so that it doesn't inline all its code.  This is a WIP - many more tests need to be written still.


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1531 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 06:52:59 +00:00
DrZiplok@gmail.com 8317c090da Add a templated version of AP_Meta_class::meta_type_id so that you can get a type ID for any named type without having to have an instance of the type lying around. Update the comments about caching type IDs to reflect its availability.
Fix the comments around AP_Meta_class::meta_cast; they were leftovers from an earlier implementation and entirely not helpful.


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1530 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 06:44:07 +00:00
jasonshort 1468ec497d Added Arming light. LED A solid = safe, blinking = armed.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1529 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 02:36:22 +00:00
jasonshort eb67a7eee0 altitude was set to sonar pid rather than baro pid
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1528 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 02:09:54 +00:00
jasonshort 28ee251978 was adding throttle cruise twice.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1527 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 02:08:46 +00:00
jasonshort f7f0fdf945 Added ability to exit the GPS test loop.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1526 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 02:07:21 +00:00
jasonshort 6d9c271126 updated and tested the auto-trim mode of the accell offsets. Works great, although it's slow, only .6° a second.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1525 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-23 00:35:51 +00:00
jasonshort 8e6c8a49ef Added failsafe radio test!
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1524 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-22 20:25:14 +00:00
DrZiplok@gmail.com 6cf396074b Implement the missing AP_Var_group::*serialize functions.
Rather than implementing empty default constructors, make sure that AP_Var and friends have useful default constructors instead.  This works around AP_Meta_class::meta_cast requiring a default constructor without having empty ctors scattered around.

Add accessors to AP_Var so that the global variable list can be traversed and the group/variable relationship comprehended by outsiders.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1523 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-22 18:42:44 +00:00
DrZiplok@gmail.com d53844c52d Implement a pure data serialisation load/save model for AP_Var.
The format is a simple TLV format; a tag identifying the variable, a length for the variable, and then the actual data.  This format could ultimately be extended to include waypoint/commands as well.

This allows us to load and save groups of variables to EEPROM without having to have a static EEPROM map.

Still needs unit tests and (probably) bugfixing.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1522 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-22 08:37:52 +00:00
jasonshort 64d061a79f cleaning up the instructions for use
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1519 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-21 06:10:26 +00:00
jasonshort 02fae1d48d minor navigation updates, added new copter friendly altitude control for navigating waypoints.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1518 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-21 05:28:01 +00:00
jasonshort e26b2dab67 made I term 0 by default
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1517 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-21 04:16:11 +00:00
jasonshort b074312487 New updated CLI for setup. Cleaner and better defaults and reporting of values.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1516 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-20 07:11:21 +00:00
jasonshort 96262f3bcd changed casting
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1515 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-19 01:48:23 +00:00
jasonshort e0298b6e58 removed access to kD = use the dampener instead
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1513 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-18 19:02:54 +00:00
jasonshort cf55b0f93f updated the stabilize_dampener variable
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1512 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-18 19:00:07 +00:00
jasonshort 4c34b46e14 Added current total to the log. Logging at a lower rate. decreased size to ints.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1511 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-18 06:12:11 +00:00
jasonshort d542c75d6e Added current total to the log. Logging at a lower rate. decreased size to ints.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1510 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-18 06:11:48 +00:00
james.goppert 8ec3a8de4a Updated AP_RcChannel for AP_Var.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1509 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-18 04:56:45 +00:00
jasonshort f60602d7a9 Renamed the loop timers to gain a new medium loop delta. Fixed an issue with the navigation timer. Updated the current sensing. Need to add a low voltage or current trigger.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1508 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-18 02:48:44 +00:00
mich146@hotmail.com dbb40ad9a4 Reinstate Float loading and saving
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1507 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-17 22:57:48 +00:00
deweibel@gmail.com 82e6e29d2f Add initial values for scaling and dead zone to RC_Channel constructor
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1506 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-17 04:05:48 +00:00
jasonshort feb3f1a811 Added support for the AttoPilot Current sensor, Logging current is enabled at 10hz,
Trim is now called again on pitch and roll, now that trimming can be done with adc_offsets. Fixed setup::motors for x frame.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1505 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-17 03:44:12 +00:00
deweibel@gmail.com c9788d7b0b Add back AP_GPS_IMU to provide Xplane functionality
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1504 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-17 01:50:34 +00:00
jasonshort 709b56f477 Added getter functions to accels
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1503 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-16 20:42:11 +00:00
DrZiplok@gmail.com ea3570ded0 Formatting and naming changes for conformance with the ArduPilot Coding Conventions.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1502 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-16 09:14:21 +00:00
jasonshort d7418d4fc4 removed unused EEPROMB include
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1501 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-16 03:53:30 +00:00
jasonshort 53b2560412 Flipped the signs. Should be right.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1500 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-16 02:44:30 +00:00
jasonshort 3558567aad Added new leveling command. Hold the trainer swicth - ch7- in and the copter will adjust the ADC_OFFSET based on the roll and pitch command needed to straighten the copter.
no roll and pitch input means no change. Flicking will still update the throttle cruise value. Please check I have the signs correct!!!

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1499 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-16 02:37:35 +00:00
DrZiplok 91efbeac56 Deal more gracefully with the case where the incoming PPM stream has more than 8 channels encoded.
This makes it possible to move one resistor on the APM board and feed it PPM directly from a receiver emitting a PPM stream.



git-svn-id: https://arducopter.googlecode.com/svn/trunk@1498 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-15 19:32:04 +00:00
rmackay9@yahoo.com 067ddc4802 TradHeli - updated Heli.h to use AP_Compass instead of the outdated APM_Compass. Also changed autopilot on/off switch to be consistent with Quad.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1497 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-15 01:41:51 +00:00
jasonshort 78095b1dd7 Implemented new DCM based yaw independent heading controller.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1495 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-13 01:31:05 +00:00
DrZiplok e552b7c7e1 Update to current MAVLink dev branch protocol version. This has NOT been tested yet.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1494 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-12 08:57:54 +00:00
DrZiplok 3f663597b5 Based on explaining AP_VarNoAddress to Doug, improve the description of the value.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1491 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-12 02:43:25 +00:00
jasonshort d1052612ac added better default value for longitude scaling
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1490 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:22:54 +00:00
jasonshort 76efe23cd7 added new FBW test to develop new nav functions
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1489 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:16:00 +00:00