Implement new controller
Dependencies: mbed-rtos mbed QEI BNO055 MPU6050_DMP_Nucleo-I2Cdev virgo3_imuHandler_Orion_PCB MAX17048 Servo
Fork of Orion_newPCB_test by
05_TrajectoryTracking/purePursuit.h@11:49344285c82a, 2016-04-24 (annotated)
- Committer:
- akashvibhute
- Date:
- Sun Apr 24 23:54:50 2016 +0000
- Revision:
- 11:49344285c82a
- Child:
- 19:7345688260b2
Purepursuit + pid pitch control works nicely; this is the demo setup for the french contigent - 25/Apr/2016
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akashvibhute | 11:49344285c82a | 1 | #ifndef purePursuit_H |
akashvibhute | 11:49344285c82a | 2 | #define purePursuit_H |
akashvibhute | 11:49344285c82a | 3 | |
akashvibhute | 11:49344285c82a | 4 | #include "mbed.h" |
akashvibhute | 11:49344285c82a | 5 | #include "generalFunctions.h" |
akashvibhute | 11:49344285c82a | 6 | #include "config.h" |
akashvibhute | 11:49344285c82a | 7 | |
akashvibhute | 11:49344285c82a | 8 | class purePursuit |
akashvibhute | 11:49344285c82a | 9 | { |
akashvibhute | 11:49344285c82a | 10 | public: |
akashvibhute | 11:49344285c82a | 11 | |
akashvibhute | 11:49344285c82a | 12 | purePursuit(); |
akashvibhute | 11:49344285c82a | 13 | |
akashvibhute | 11:49344285c82a | 14 | void GenVW(float* purePursuit_velocity, float* purePursuit_omega, |
akashvibhute | 11:49344285c82a | 15 | float target_waypoint[2], float target_velocity, |
akashvibhute | 11:49344285c82a | 16 | float current_position[2], float current_heading); |
akashvibhute | 11:49344285c82a | 17 | |
akashvibhute | 11:49344285c82a | 18 | float robotFrame_targetDistance; |
akashvibhute | 11:49344285c82a | 19 | float purePursuit_headingE; |
akashvibhute | 11:49344285c82a | 20 | float purePursuit_ld; |
akashvibhute | 11:49344285c82a | 21 | float purePursuit_r; |
akashvibhute | 11:49344285c82a | 22 | |
akashvibhute | 11:49344285c82a | 23 | private: |
akashvibhute | 11:49344285c82a | 24 | static float const ld_min = 100.0; //min purepursuit lookahead distance |
akashvibhute | 11:49344285c82a | 25 | static float const ld_max = 1000.0; //max purepursuit lookahead distance |
akashvibhute | 11:49344285c82a | 26 | static float const trackingLimit = 150.0; //purepursuit will track only until the target distance is greater than this limit |
akashvibhute | 11:49344285c82a | 27 | |
akashvibhute | 11:49344285c82a | 28 | static float const drive_minV = driveTrain_minV; |
akashvibhute | 11:49344285c82a | 29 | static float const drive_maxV = driveTrain_maxV; |
akashvibhute | 11:49344285c82a | 30 | |
akashvibhute | 11:49344285c82a | 31 | static float const purePursuit_omega_limit = DEG_TO_RAD(90); |
akashvibhute | 11:49344285c82a | 32 | |
akashvibhute | 11:49344285c82a | 33 | float robotFrame_targetPos[2]; |
akashvibhute | 11:49344285c82a | 34 | |
akashvibhute | 11:49344285c82a | 35 | }; |
akashvibhute | 11:49344285c82a | 36 | |
akashvibhute | 11:49344285c82a | 37 | |
akashvibhute | 11:49344285c82a | 38 | #endif |