Code for autonomous rover for Sparkfun AVC. DataBus won 3rd in 2012 and the same code was used on Troubled Child, a 1986 Jeep Grand Wagoneer to win 1st in 2014.
Dependencies: mbed Watchdog SDFileSystem DigoleSerialDisp
Config/Config.h@3:42f3821c4e54, 2013-06-07 (annotated)
- Committer:
- shimniok
- Date:
- Fri Jun 07 14:45:46 2013 +0000
- Revision:
- 3:42f3821c4e54
- Parent:
- 1:cb84b477886c
- Child:
- 11:33757b21d0e4
Working version 6/6/2013. Heading estimation may not be quite perfect yet but seems the major estimation bugs are fixed now.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimniok | 0:a6a169de725f | 1 | #ifndef __CONFIG_H |
shimniok | 0:a6a169de725f | 2 | #define __CONFIG_H |
shimniok | 0:a6a169de725f | 3 | |
shimniok | 0:a6a169de725f | 4 | #include "GeoPosition.h" |
shimniok | 0:a6a169de725f | 5 | #include "CartPosition.h" |
shimniok | 0:a6a169de725f | 6 | |
shimniok | 0:a6a169de725f | 7 | /** Text-based configuration; reads config file and stores in fields |
shimniok | 0:a6a169de725f | 8 | */ |
shimniok | 0:a6a169de725f | 9 | class Config { |
shimniok | 0:a6a169de725f | 10 | public: |
shimniok | 0:a6a169de725f | 11 | Config(); |
shimniok | 0:a6a169de725f | 12 | |
shimniok | 0:a6a169de725f | 13 | bool load(); |
shimniok | 3:42f3821c4e54 | 14 | bool loaded; // has the config been loaded yet? |
shimniok | 0:a6a169de725f | 15 | float interceptDist; // used for course correction steering calculation |
shimniok | 0:a6a169de725f | 16 | float waypointDist; // distance threshold to waypoint |
shimniok | 0:a6a169de725f | 17 | float brakeDist; // braking distance |
shimniok | 0:a6a169de725f | 18 | float declination; |
shimniok | 0:a6a169de725f | 19 | float compassGain; // probably don't need this anymore |
shimniok | 0:a6a169de725f | 20 | float yawGain; // probably don't need this anymore |
shimniok | 0:a6a169de725f | 21 | GeoPosition wpt[10]; // Waypoints, lat/lon coords |
shimniok | 0:a6a169de725f | 22 | CartPosition cwpt[10]; // Waypoints, cartesian coords |
shimniok | 0:a6a169de725f | 23 | unsigned int wptCount; // number of active waypoints |
shimniok | 0:a6a169de725f | 24 | int escMin; // minimum ESC value; brake |
shimniok | 0:a6a169de725f | 25 | int escZero; // zero throttle |
shimniok | 0:a6a169de725f | 26 | int escMax; // max throttle |
shimniok | 0:a6a169de725f | 27 | float topSpeed; // top speed to achieve on the straights |
shimniok | 0:a6a169de725f | 28 | float turnSpeed; // speed for turns |
shimniok | 0:a6a169de725f | 29 | float startSpeed; // speed for start |
shimniok | 0:a6a169de725f | 30 | float minRadius; // minimum turning radius (calculated) |
shimniok | 0:a6a169de725f | 31 | float speedKp; // Speed PID proportional gain |
shimniok | 0:a6a169de725f | 32 | float speedKi; // Speed PID integral gain |
shimniok | 0:a6a169de725f | 33 | float speedKd; // Speed PID derivative gain |
shimniok | 0:a6a169de725f | 34 | float steerZero; // zero steering aka center point |
shimniok | 0:a6a169de725f | 35 | float steerGain; // gain factor for steering algorithm |
shimniok | 0:a6a169de725f | 36 | float steerGainAngle; // angle below which steering gain takes effect |
shimniok | 0:a6a169de725f | 37 | float curbThreshold; // distance at which curb avoid takes place |
shimniok | 0:a6a169de725f | 38 | float curbGain; // gain of curb avoid steering |
shimniok | 0:a6a169de725f | 39 | // acceleration profile? |
shimniok | 0:a6a169de725f | 40 | // braking profile? |
shimniok | 0:a6a169de725f | 41 | float gyroBias; // this needs to be 3d |
shimniok | 0:a6a169de725f | 42 | // float gyroScale[3]; |
shimniok | 0:a6a169de725f | 43 | float magOffset[3]; |
shimniok | 0:a6a169de725f | 44 | float magScale[3]; |
shimniok | 0:a6a169de725f | 45 | // float accelOffset[3]; |
shimniok | 0:a6a169de725f | 46 | // float accelScale[3]; |
shimniok | 0:a6a169de725f | 47 | int gpsType; |
shimniok | 0:a6a169de725f | 48 | int gpsBaud; |
shimniok | 0:a6a169de725f | 49 | |
shimniok | 0:a6a169de725f | 50 | }; |
shimniok | 0:a6a169de725f | 51 | |
shimniok | 0:a6a169de725f | 52 | #endif |