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
Diff: 05_TrajectoryTracking/purePursuit.h
- Revision:
- 19:7345688260b2
- Parent:
- 11:49344285c82a
--- a/05_TrajectoryTracking/purePursuit.h Tue May 17 06:23:45 2016 +0000 +++ b/05_TrajectoryTracking/purePursuit.h Tue Jun 07 03:48:56 2016 +0000 @@ -10,28 +10,34 @@ public: purePursuit(); - + + /// generate velocity (mm/s) and omega (rad/s) for diff drive to track void GenVW(float* purePursuit_velocity, float* purePursuit_omega, - float target_waypoint[2], float target_velocity, + float target_waypoint[2], float target_velocity, float current_position[2], float current_heading); - - float robotFrame_targetDistance; + + /// generate velocity (mm/s), gamma (rad) and omega (rad/s) for non-linear controller to track + void GenVGW(float* purePursuit_velocity, float* purePursuit_gamma, float* purePursuit_omega, + float target_waypoint[2], float target_velocity, + float current_position[2], float current_heading); + + float robotFrame_targetDistance; float purePursuit_headingE; float purePursuit_ld; - float purePursuit_r; + float purePursuit_r; private: - static float const ld_min = 100.0; //min purepursuit lookahead distance - static float const ld_max = 1000.0; //max purepursuit lookahead distance - static float const trackingLimit = 150.0; //purepursuit will track only until the target distance is greater than this limit - + static float const ld_min = 200.0; //min purepursuit lookahead distance + static float const ld_max = 2000.0; //max purepursuit lookahead distance + static float const trackingLimit = 50.0; //purepursuit will track only until the target distance is greater than this limit + static float const drive_minV = driveTrain_minV; static float const drive_maxV = driveTrain_maxV; - + static float const purePursuit_omega_limit = DEG_TO_RAD(90); - + float robotFrame_targetPos[2]; - + };