Commit Graph

57303 Commits

Author SHA1 Message Date
DrZiplok@gmail.com e7da843d90 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 39fea200ca 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 de71731994 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 8901d8a238 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 b912b7e0eb 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 b830afd678 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 aaa19ebbfc 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 09df4b35ea 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 7205208801 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 39b718fce0 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 30d9a92c4e 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 60f766f9e2 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 a6a4fffe46 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 49b387e874 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 baea026e59 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 05f8162d81 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 f5fef60e03 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 1606e1a8e9 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 1fca47fc9b 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 08a2fbfdd0 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 05622fe225 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 3ad113b4b9 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 0328f926b5 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 50c3b2e4fd 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 548fc9debf 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 5e0fff1618 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 80689920af 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 96d2dc33fe 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 610e26db36 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 c960235f7e 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 2b35c91775 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 5113a12144 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 dc9c29e8f3 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 cf7488317d 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 cbdf462acc 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 aaf125e441 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 8423ab6364 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 521d7ab424 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
jasonshort a80b4fbb69 added new PID nav functions to split lat and long based on Randy's work.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1488 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:15:08 +00:00
jasonshort 3ed6e0fc87 added new PID nav functions to split lat and long based on Randy's work.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1487 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:15:02 +00:00
jasonshort 53ec770da4 added new PID nav functions to split lat and long based on Randy's work.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1486 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:14:57 +00:00
jasonshort 83687a43ed added new PID nav functions to split lat and long based on Randy's work.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1485 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:13:30 +00:00
jasonshort 1ae7f54aef added reset I functions for new pids
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1484 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:12:57 +00:00
jasonshort e8734783bb deprecated older method of finding pitch and roll
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1483 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:12:29 +00:00
jasonshort b346d003e3 increased PitchMax to 22 to match NG
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1482 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 21:11:51 +00:00
gigiorm 40b7bc2e3c This is just a test for SVN
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1481 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-11 02:42:53 +00:00
DrZiplok@gmail.com 52a0a03d56 Bring AP_GPS_Auto closer to ready for prime-time:
- disable NMEA autodetection; false positives are still a risk
 - trim down the console output to a minimum; we still need something to help users diagnose potential problems, but the old output was much too verbose
 - rather than block forever, only do one autodetect pass for each ::read call.  That's still too long (five seconds or so) but better than blocking forever.
 - don't block forever if no GPS is attached.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1480 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 08:20:41 +00:00
DrZiplok@gmail.com fdde092213 Extend the logic that preserves buffer sizing on re-begin by also avoiding freeing and re-allocating buffers when they don't change in size.
This can make re-opening a port faster (as the free/malloc pair can be avoided) and possibly more robust (in the case where e.g. the heap has been corrupted).

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1479 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 08:17:31 +00:00
jasonshort bcd3e7db56 renamed err to altitude_error
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1478 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 02:49:45 +00:00
jasonshort cfea6b014a not used
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1477 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 02:29:16 +00:00