Commit Graph

411 Commits

Author SHA1 Message Date
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
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
DrZiplok@gmail.com eb39264834 Update the NMEA example code in conjunction with the new parser.
Added an init string for SiRF receivers that will bring them back out of the binary mode configuration that AP_GPS_Auto sets them to.  

Picked up the GPS logging format from the AP_GPS_Auto test.



git-svn-id: https://arducopter.googlecode.com/svn/trunk@1469 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:57:16 +00:00
DrZiplok@gmail.com cad260a481 Implement a completely new NMEA parser based on the TinyGPS parser by Mikal Hart.
Major new features:

 - No RAM buffer for the NMEA message being parsed; saves 120 bytes of RAM.
 - More robust parser, a little less likely to be confused by bad messages.
 - Added configuration strings for SiRF, ublox and MediaTek GPS in NMEA mode to select just the messages of interest.

Note that the issue that TinyGPS has with co-ordinates with "different" numbers of decimal digits is addressed in this code.

Size is comparable to the old parser.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1468 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:55:45 +00:00
DrZiplok@gmail.com 1bfcdaa2cb Add a delay after sending the GPS mode switch strings in an attempt to give any NMEA data time to drain before we attempt to sniff again.
Otherwise, we can end up settling on NMEA as a mode just after switching a SiRF GPS to binary mode.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1467 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:50:42 +00:00
DrZiplok@gmail.com dd6ede36ee Add more unit tests for AP_Var.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1466 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:44:23 +00:00
DrZiplok@gmail.com 6366cdc094 Add more documentation for AP_MetaClass.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1465 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:43:41 +00:00
DrZiplok@gmail.com 44cac7a853 Add a new macro PROGMEM_STRING that can be used to define a constant string in program memory.
This is a partial workaround for not being able to use PSTR at global scope, e.g. in an argument to a constructor; it makes the intent of the otherwise somewhat bulky declaration of the string more obvious.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1464 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:42:59 +00:00
DrZiplok 07dec5e1b7 Use operator new from AP_Common rather than our own. This also makes AP_Common available to the GPS drivers that work with AP_GPS_Auto.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1463 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:19:15 +00:00
DrZiplok@gmail.com 8c9a5d36d8 Add documentation and reformat closer to our current code standard.
Add support for re-opening a port without changing the baudrate or buffer sizes.  By passing zero for the parameters that aren't to be changed, code can reconfigure a port without needing to know how it was originally configured.





git-svn-id: https://arducopter.googlecode.com/svn/trunk@1462 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 01:17:03 +00:00
DrZiplok 2c0e8515d5 Add a date field to the standard GPS data. This may be zero, and its format is TBD (may be GPS-dependent).
Increase the no-data timeout to slightly more than a second, so that GPS' with a 1Hz update rate don't cause problems.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1461 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-10 00:44:09 +00:00
rmackay9@yahoo.com 1448b6991e AP_RangeFinder_test.pde - corrected some inaccurate comments in the code
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1459 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-09 14:20:26 +00:00
DrZiplok e299d5f58a Add a flags byte to variables, and implement a "no auto load" bit that opts variables out of load_all / save_all.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1449 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-05 17:56:46 +00:00
DrZiplok c0de571afd Save AP_Var's initial value as a default value, and add a function for restoring the default value.
Fix the AP_Var::lookup cache, which was very busted.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1448 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-05 09:25:07 +00:00
DrZiplok 0e868ca343 More unit tests.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1447 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-05 07:40:35 +00:00
DrZiplok 765cef724d Fix the assignment operator overload for AP_VarT so that direct assignments to the type work correctly.
Add a variant of AP_Float that stores the value as Q5.10 (16-bit fixed-point) to save EEPROM space.


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1446 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-05 07:40:06 +00:00
DrZiplok 814a16000a Simplify FastSerial::begin baudrate calculations in line with the changes made in Arduino-0022
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1424 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-04 18:41:27 +00:00
rmackay9@yahoo.com e0607712a3 AP_RangeFinder - tiny bit of extra initialisation on table holding averages
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1419 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-04 14:33:29 +00:00
DrZiplok@gmail.com d8046957c6 Unit tests for scope-based address offsetting.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1418 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-04 08:50:24 +00:00
DrZiplok@gmail.com 63643f73fc Move the AP_Var ctor out of the class definition; it's big enough that we don't want to inline it.
AP_Vars with either a name or an address are 'interesting' (the latter so we can save_all).

Add the concept of address offsets to scopes.  Now we have a container that we can put AP_Vars into that can be moved around in the EEPROM.  This will make it easier for things like the PID library which need to support multiple instances getting their parameters from different parts of the ROM.

Improve documentation.

Suck it up and admit that we aren't going to do "identity"-based addressing for the EEPROM and just call the property "address".



git-svn-id: https://arducopter.googlecode.com/svn/trunk@1417 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-04 08:49:55 +00:00
DrZiplok@gmail.com d2bd744244 Metaclass improvements:
- Add a default ctor/dtor pair.  The dtor ensures that all dtors are virtual, and guarantees that there is something in the dtor vtable slot for classes that don't implement their own.
 - serialize must not alter the class, mark it const
 - Improve documentation
 - Fix handle validation to prevent trying to read 2 bytes beyond the end of memory


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1416 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-04 08:46:01 +00:00
DrZiplok@gmail.com d7fccd1aa9 Checking these in makes the libraries too bulky. We need to host them somewhere.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1413 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-04 06:22:02 +00:00
rmackay9@yahoo.com ef673e5162 AP_RangeFinder - changes to allow sonar to work using pitot tube. Also moved most functionality into RangeFinder class instead of child classes.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1404 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-03 04:17:43 +00:00
DrZiplok 57f3f4e65b Beef up the unit tests for AP_Var. Most of the basic functionality is now covered.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1403 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-03 02:29:17 +00:00
DrZiplok 277105c437 Rename the base class for variables AP_Var; less confusing, less to type. Rename the template type instead.
We don't need any of the arithmetic overloads, so strip them.

Fix includes.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1402 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-03 02:28:35 +00:00
DrZiplok ea9c7859f8 Don't allow the default serialize/unserialize to be inlined.
Fix some includes and remove an old implementation of meta_cast.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1401 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-03 02:26:18 +00:00
DrZiplok a02136236f Add the ability to find the sketchbook when called from a Makefile in a library example.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1400 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-02 22:16:21 +00:00
DrZiplok a3a9fe59e3 Following discussions with James, a complete rewrite of AP_Var.
The overriding principle here is to keep the use of AP_Vars as simple as possible, whilst letting the implementation do useful things behind the scenes.  To that end, we define AP_Float, AP_Int8, AP_Int16 and AP_Int32.  These are strongly typed, so that there is no ambiguity about what a variable "really" is.

The classes behave like the variables they are storing; you can use an AP_Float in most places you would use a regular float; you can add to it, multiply by it, etc.  If it has been given an address in EEPROM you can load and save it.

Variables can be given names, and if they are named then they can be looked up.  This allows e.g. a GCS or a test tool to find and traffic in variables that it may not explicitly know about.

AP_Var does not attempt to solve the problem of EEPROM address space management.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1399 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-02 22:14:36 +00:00
rmackay9@yahoo.com 851101218d APM_Compass - moving to "legacy_do_not_use" directory
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1391 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-01 15:00:32 +00:00
DrZiplok 68be029a17 Don't define constant AP_Var's extern
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1381 f9c3cf11-9bcb-44bc-f272-b75c42450872
2011-01-01 00:31:39 +00:00
james.goppert 634f2734b5 Added AP_Controller library.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1379 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-31 06:20:28 +00:00
james.goppert 4e421a319a Updated docs.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1377 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 07:51:53 +00:00
DrZiplok@gmail.com cd341cef90 We should call imu.update() before asking for accel/gyro values so that we get timely, fresh numbers.
Most other consumers of the accel/gyro values should be asking us for them anyway.  At that point, what they are getting are the values we sampled here.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1376 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 07:52:35 +00:00
james.goppert 3f30b897fa Fixed non-standard value in RcChannel examples.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1375 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 07:43:56 +00:00
james.goppert 5b79ed9f53 Updated RcChannel examples.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1372 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 07:02:56 +00:00
james.goppert 8bc3fc599d Fixed casting issues with EEPROM Registry
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1371 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 06:46:40 +00:00
jasonshort 5f15380877 cosmetic
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1370 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 06:43:35 +00:00
james.goppert 86feb8bf7b Fixed issues with RcChannel EEPROM var ownership.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1369 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 05:25:28 +00:00
DrZiplok 23e78d0f4b Fix/improve depdendency handling. Deps are autogenerated on the first compile pass and consumed on subsequent builds. This helps work around the difficulty of building the 'clean' target with Eclipse.
Don't depend on the build directory anywhere; we automake it as required.



git-svn-id: https://arducopter.googlecode.com/svn/trunk@1368 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 03:45:50 +00:00
DrZiplok 7bc153f038 More awk-related changes. mawk hangs on the parser scripts, so try gawk; it's what we'll need for cygwin anyway.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1367 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 03:20:33 +00:00
DrZiplok f0f13752d0 We need TOOLPATH even when ARDUINO is defined. Refactor.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1366 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 02:25:55 +00:00
DrZiplok f65076dccc Adjust the awk scanners to deal with the somewhat less featureful awk found on many Linux systems.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1365 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-30 02:16:01 +00:00
DrZiplok 0dac8fca62 Better TOOLPATH handling for Linux
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1364 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-29 23:13:44 +00:00
DrZiplok 4d490359e7 Try to find the AVR tools on Linux
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1363 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-29 22:39:39 +00:00
DrZiplok c1e9a04ce6 Add Eclipse project metadata.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1362 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-29 20:35:16 +00:00
DrZiplok@gmail.com 2ec1d69a0f Move Arduino.mk here. This library should always be present in a constant location for our projects.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1361 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-29 19:43:58 +00:00
james.goppert e3041f08fe RcChannel now owns channel config params.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1354 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-29 08:26:21 +00:00
DrZiplok@gmail.com f2f38f2e71 Make the GPS ctor protected so that it can't be accidentally constructed or copied.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1353 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-29 03:32:37 +00:00
DrZiplok@gmail.com 75e78dabae Back out the memset optimisation. It helps with code size but causes inexplicable link-time failures (undefined references to __cxa_pure_virtual).
Thank you very much Mr GCC.  Can I have my evening back?


git-svn-id: https://arducopter.googlecode.com/svn/trunk@1352 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-29 03:09:29 +00:00