Main repository for dump truck API development in Spring 2017
Dependencies: Tracker mbed MotorV2 SRF05 nRF24L01P
Fork of DUMP_TRUCK_TEST_V1 by
Activities
This Week
If needed, please contact Milo Pan at mpan9@gatech.edu for rights and access to this repository.
DumpTruck.h@8:9c94865bd087, 2017-02-14 (annotated)
- Committer:
- pvela
- Date:
- Tue Feb 14 14:46:37 2017 -0500
- Revision:
- 8:9c94865bd087
- Parent:
- 7:dd3a7dcc5c84
- Child:
- 10:cf77da9be0b8
Text edt.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pvela | 6:5cc6a9b6f60e | 1 | /** |
pvela | 6:5cc6a9b6f60e | 2 | * @file DumpTruck.h |
pvela | 6:5cc6a9b6f60e | 3 | * |
pvela | 6:5cc6a9b6f60e | 4 | * @brief DumpTruck class implements API for commanding the dump truck and |
pvela | 6:5cc6a9b6f60e | 5 | * for implementing proprioceptive sensing. |
pvela | 6:5cc6a9b6f60e | 6 | * |
pvela | 6:5cc6a9b6f60e | 7 | * @author Terrabots Team |
pvela | 6:5cc6a9b6f60e | 8 | * |
pvela | 6:5cc6a9b6f60e | 9 | */ |
pvela | 6:5cc6a9b6f60e | 10 | |
pvela | 6:5cc6a9b6f60e | 11 | |
Josahty | 0:6942f0e2198c | 12 | #ifndef MBED_DUMP_TRUCK_H |
Josahty | 0:6942f0e2198c | 13 | #define MBED_DUMP_TRUCK_H |
Josahty | 0:6942f0e2198c | 14 | |
Josahty | 0:6942f0e2198c | 15 | #include "mbed.h" |
Josahty | 0:6942f0e2198c | 16 | |
pvela | 7:dd3a7dcc5c84 | 17 | /** |
pvela | 7:dd3a7dcc5c84 | 18 | * @class DumpTruck |
pvela | 7:dd3a7dcc5c84 | 19 | * |
pvela | 8:9c94865bd087 | 20 | * @brief Interface for controlling a Dump Truck configured "robot." |
pvela | 7:dd3a7dcc5c84 | 21 | */ |
Josahty | 0:6942f0e2198c | 22 | class DumpTruck { |
Josahty | 0:6942f0e2198c | 23 | public: |
pvela | 6:5cc6a9b6f60e | 24 | |
pvela | 6:5cc6a9b6f60e | 25 | /** |
pvela | 6:5cc6a9b6f60e | 26 | * Constructor for the DumpTruck object. |
pvela | 6:5cc6a9b6f60e | 27 | * |
pvela | 6:5cc6a9b6f60e | 28 | * @param[in] truckId Not sure. |
pvela | 6:5cc6a9b6f60e | 29 | */ |
Josahty | 0:6942f0e2198c | 30 | DumpTruck(int truckId); |
pvela | 6:5cc6a9b6f60e | 31 | |
pvela | 6:5cc6a9b6f60e | 32 | /** |
pvela | 6:5cc6a9b6f60e | 33 | * Command the dump truck to drive with a desired sped for a specified |
pvela | 6:5cc6a9b6f60e | 34 | * distance. |
pvela | 6:5cc6a9b6f60e | 35 | * |
pvela | 6:5cc6a9b6f60e | 36 | * @param[in] mSpeed The desired motor speed. |
pvela | 6:5cc6a9b6f60e | 37 | * @param[in] dDist The desired driver distance. |
pvela | 6:5cc6a9b6f60e | 38 | */ |
Josahty | 0:6942f0e2198c | 39 | void drive(); // Drive DC motors with a desired motor speed and distance |
pvela | 6:5cc6a9b6f60e | 40 | |
pvela | 6:5cc6a9b6f60e | 41 | /** |
pvela | 6:5cc6a9b6f60e | 42 | * Command the dump truck to stop. |
pvela | 6:5cc6a9b6f60e | 43 | * |
pvela | 6:5cc6a9b6f60e | 44 | */ |
Josahty | 0:6942f0e2198c | 45 | void stop(); |
pvela | 6:5cc6a9b6f60e | 46 | |
pvela | 6:5cc6a9b6f60e | 47 | /** |
pvela | 6:5cc6a9b6f60e | 48 | * Perform calibration routine. It will ... FILL OUT |
pvela | 6:5cc6a9b6f60e | 49 | * |
pvela | 6:5cc6a9b6f60e | 50 | */ |
Josahty | 0:6942f0e2198c | 51 | void Calibrate(); |
pvela | 6:5cc6a9b6f60e | 52 | |
pvela | 6:5cc6a9b6f60e | 53 | /** |
pvela | 6:5cc6a9b6f60e | 54 | * WHAT IS THIS ABOUT? |
pvela | 6:5cc6a9b6f60e | 55 | * |
pvela | 6:5cc6a9b6f60e | 56 | */ |
Josahty | 0:6942f0e2198c | 57 | //void RotateTo(); |
pvela | 6:5cc6a9b6f60e | 58 | |
pvela | 6:5cc6a9b6f60e | 59 | /** |
pvela | 6:5cc6a9b6f60e | 60 | * Move the bed to the fully down position. The down switch should |
pvela | 6:5cc6a9b6f60e | 61 | * engage. |
pvela | 6:5cc6a9b6f60e | 62 | * |
pvela | 6:5cc6a9b6f60e | 63 | */ |
pvela | 6:5cc6a9b6f60e | 64 | void BedDown(); |
pvela | 6:5cc6a9b6f60e | 65 | |
pvela | 6:5cc6a9b6f60e | 66 | /** |
pvela | 6:5cc6a9b6f60e | 67 | * Move the bed to the fully up position. The up switch should |
pvela | 6:5cc6a9b6f60e | 68 | * engage. |
pvela | 6:5cc6a9b6f60e | 69 | * |
pvela | 6:5cc6a9b6f60e | 70 | */ |
pvela | 6:5cc6a9b6f60e | 71 | void BedUp(); |
pvela | 6:5cc6a9b6f60e | 72 | |
pvela | 6:5cc6a9b6f60e | 73 | /** |
pvela | 6:5cc6a9b6f60e | 74 | * Raise the bed to the desired angle. Only effective if the bed angle |
pvela | 6:5cc6a9b6f60e | 75 | * estimate has been zeroed out. |
pvela | 6:5cc6a9b6f60e | 76 | * |
pvela | 6:5cc6a9b6f60e | 77 | */ |
Josahty | 0:6942f0e2198c | 78 | //void raiseTo(); |
pvela | 6:5cc6a9b6f60e | 79 | |
pvela | 6:5cc6a9b6f60e | 80 | |
pvela | 6:5cc6a9b6f60e | 81 | /** |
pvela | 6:5cc6a9b6f60e | 82 | * NOT SURE. HOW DIFFERENT FROM ABOVE? raiseTo should raise to any |
pvela | 6:5cc6a9b6f60e | 83 | * arbitrary angle within limits. |
pvela | 6:5cc6a9b6f60e | 84 | * |
pvela | 6:5cc6a9b6f60e | 85 | */ |
Josahty | 0:6942f0e2198c | 86 | //void LowerBed(); |
Josahty | 3:cd6e2d7c7c9c | 87 | |
Josahty | 0:6942f0e2198c | 88 | |
Josahty | 0:6942f0e2198c | 89 | protected: |
Josahty | 0:6942f0e2198c | 90 | int truckNumber; |
Josahty | 0:6942f0e2198c | 91 | float speed; // desired speed to drive the robot, a number between -1 and 1 |
Josahty | 3:cd6e2d7c7c9c | 92 | float distance; |
Josahty | 3:cd6e2d7c7c9c | 93 | float getDistance(); // input of desired distance to be traveled |
Josahty | 0:6942f0e2198c | 94 | float setTruckSpeed(); // set truck speed |
Josahty | 0:6942f0e2198c | 95 | float setTruckDistance(); // set distance to be traveled |
Josahty | 0:6942f0e2198c | 96 | //getBedAngle(); //Get data from Bed potentiometer, Hari is looking into the component for this |
Josahty | 0:6942f0e2198c | 97 | //getPivotAngle(double PivotAngle); //Get data from potentiometer |
Josahty | 0:6942f0e2198c | 98 | //SetPivotSpeed(double PivotSpeed); //Set arbitrary rotation of servo motor |
Josahty | 0:6942f0e2198c | 99 | //SetBedSpeed(); //Set arbitrary rotation of DC Motor |
Josahty | 0:6942f0e2198c | 100 | //bool GetBedUpperSwitch(); //Checks if bed is all the way up |
Josahty | 0:6942f0e2198c | 101 | //bool GetBedLowerSwitch(); //Checks if bed is all the way down |
Josahty | 0:6942f0e2198c | 102 | //bool SwitchState; //Switch state variable for Up and down bed functions |
Josahty | 0:6942f0e2198c | 103 | //float DesiredPivotAngle; // User Input of desired angle for the bed to be pivoted |
Josahty | 0:6942f0e2198c | 104 | //float DesiredBedAngle; //User Input of desired bed angle to be raised. |
Josahty | 0:6942f0e2198c | 105 | //float BedSpeed; //User input of desired speed for the dump truck's bed to rotate |
Josahty | 0:6942f0e2198c | 106 | //float PivotSpeed; //User input of desired speed for the dump truck to pivot its back at |
Josahty | 0:6942f0e2198c | 107 | |
Josahty | 0:6942f0e2198c | 108 | //bool isCalibrated;// returns 0 and 1 to check if the robot has been calibrated |
Josahty | 0:6942f0e2198c | 109 | }; |
simplyellow | 5:dc4cf6cc24b3 | 110 | #endif |