Michael Shimniok / Mbed 2 deprecated DataBus

Dependencies:   mbed Watchdog SDFileSystem DigoleSerialDisp

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Config.h Source File

Config.h

00001 #ifndef __CONFIG_H
00002 #define __CONFIG_H
00003 
00004 #include "GeoPosition.h"
00005 #include "CartPosition.h"
00006 
00007 /** Text-based configuration; reads config file and stores in fields
00008  */
00009 class Config {
00010     public:
00011         static const int MAX_WPT=10;            // maximum number of waypoints
00012 
00013         /** Create a new config instance */
00014         Config();
00015 
00016         /** Load configuration from file */
00017         bool load(const char *filename);
00018 
00019         bool loaded;                        // has the config been loaded yet?
00020         float intercept;                    // used for course correction steering calculation
00021         float waypointDist;                 // distance threshold to waypoint
00022         float brakeDist;                    // braking distance
00023         GeoPosition wpt[10];                // Waypoints, lat/lon coords
00024         CartPosition cwpt[10];              // Waypoints, cartesian coords
00025         float wptTopSpeedAdj[MAX_WPT];      // Speed approaching waypoint
00026         float wptTurnSpeedAdj[MAX_WPT];
00027         unsigned int wptCount;              // number of active waypoints
00028         float escMin;                       // minimum ESC value; brake
00029         float escZero;                      // zero throttle
00030         float escMax;                       // max throttle
00031         float topSpeed;                     // default top speed to achieve on the straights
00032         float turnSpeed;                    // default speed for turns
00033         float startSpeed;                   // speed for start
00034         float minRadius;                    // minimum turning radius (calculated)
00035         float speedKp;                      // Speed PID proportional gain
00036         float speedKi;                      // Speed PID integral gain
00037         float speedKd;                      // Speed PID derivative gain
00038         float steerZero;                    // zero steering aka center point
00039         float steerScale;                   // gain factor for steering algorithm
00040         float curbThreshold;                // distance at which curb avoid takes place
00041         float curbGain;                     // gain of curb avoid steering
00042 //        float gyroBias;                   // this needs to be 3d
00043         float gyroScale;                    // scales gyro output to degrees / sec
00044         // float gyroScale[3];
00045         float magOffset[3];
00046         float magScale[3];
00047         // float accelOffset[3];
00048         // float accelScale[3];
00049         float wheelbase;                    // Vehicle wheelbase, front to rear axle
00050         float track;                        // Vehicle track width, left to right contact patch
00051         float tireCirc;                     // tire circumference
00052         int encStripes;                     // Number of ticks per revolution
00053         float gpsValidSpeed;                // speed above which GPS can be relied upon
00054 };
00055 
00056 #endif