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@6:5cc6a9b6f60e, 2017-02-14 (annotated)
- Committer:
- pvela
- Date:
- Tue Feb 14 14:37:05 2017 -0500
- Revision:
- 6:5cc6a9b6f60e
- Parent:
- 5:dc4cf6cc24b3
- Child:
- 7:dd3a7dcc5c84
Adding doxygen tags to test out.
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 | |
Josahty | 0:6942f0e2198c | 17 | class DumpTruck { |
Josahty | 0:6942f0e2198c | 18 | public: |
pvela | 6:5cc6a9b6f60e | 19 | |
pvela | 6:5cc6a9b6f60e | 20 | /** |
pvela | 6:5cc6a9b6f60e | 21 | * Constructor for the DumpTruck object. |
pvela | 6:5cc6a9b6f60e | 22 | * |
pvela | 6:5cc6a9b6f60e | 23 | * @param[in] truckId Not sure. |
pvela | 6:5cc6a9b6f60e | 24 | */ |
Josahty | 0:6942f0e2198c | 25 | DumpTruck(int truckId); |
pvela | 6:5cc6a9b6f60e | 26 | |
pvela | 6:5cc6a9b6f60e | 27 | /** |
pvela | 6:5cc6a9b6f60e | 28 | * Command the dump truck to drive with a desired sped for a specified |
pvela | 6:5cc6a9b6f60e | 29 | * distance. |
pvela | 6:5cc6a9b6f60e | 30 | * |
pvela | 6:5cc6a9b6f60e | 31 | * @param[in] mSpeed The desired motor speed. |
pvela | 6:5cc6a9b6f60e | 32 | * @param[in] dDist The desired driver distance. |
pvela | 6:5cc6a9b6f60e | 33 | */ |
Josahty | 0:6942f0e2198c | 34 | void drive(); // Drive DC motors with a desired motor speed and distance |
pvela | 6:5cc6a9b6f60e | 35 | |
pvela | 6:5cc6a9b6f60e | 36 | /** |
pvela | 6:5cc6a9b6f60e | 37 | * Command the dump truck to stop. |
pvela | 6:5cc6a9b6f60e | 38 | * |
pvela | 6:5cc6a9b6f60e | 39 | */ |
Josahty | 0:6942f0e2198c | 40 | void stop(); |
pvela | 6:5cc6a9b6f60e | 41 | |
pvela | 6:5cc6a9b6f60e | 42 | /** |
pvela | 6:5cc6a9b6f60e | 43 | * Perform calibration routine. It will ... FILL OUT |
pvela | 6:5cc6a9b6f60e | 44 | * |
pvela | 6:5cc6a9b6f60e | 45 | */ |
Josahty | 0:6942f0e2198c | 46 | void Calibrate(); |
pvela | 6:5cc6a9b6f60e | 47 | |
pvela | 6:5cc6a9b6f60e | 48 | /** |
pvela | 6:5cc6a9b6f60e | 49 | * WHAT IS THIS ABOUT? |
pvela | 6:5cc6a9b6f60e | 50 | * |
pvela | 6:5cc6a9b6f60e | 51 | */ |
Josahty | 0:6942f0e2198c | 52 | //void RotateTo(); |
pvela | 6:5cc6a9b6f60e | 53 | |
pvela | 6:5cc6a9b6f60e | 54 | /** |
pvela | 6:5cc6a9b6f60e | 55 | * Move the bed to the fully down position. The down switch should |
pvela | 6:5cc6a9b6f60e | 56 | * engage. |
pvela | 6:5cc6a9b6f60e | 57 | * |
pvela | 6:5cc6a9b6f60e | 58 | */ |
pvela | 6:5cc6a9b6f60e | 59 | void BedDown(); |
pvela | 6:5cc6a9b6f60e | 60 | |
pvela | 6:5cc6a9b6f60e | 61 | /** |
pvela | 6:5cc6a9b6f60e | 62 | * Move the bed to the fully up position. The up switch should |
pvela | 6:5cc6a9b6f60e | 63 | * engage. |
pvela | 6:5cc6a9b6f60e | 64 | * |
pvela | 6:5cc6a9b6f60e | 65 | */ |
pvela | 6:5cc6a9b6f60e | 66 | void BedUp(); |
pvela | 6:5cc6a9b6f60e | 67 | |
pvela | 6:5cc6a9b6f60e | 68 | /** |
pvela | 6:5cc6a9b6f60e | 69 | * Raise the bed to the desired angle. Only effective if the bed angle |
pvela | 6:5cc6a9b6f60e | 70 | * estimate has been zeroed out. |
pvela | 6:5cc6a9b6f60e | 71 | * |
pvela | 6:5cc6a9b6f60e | 72 | */ |
Josahty | 0:6942f0e2198c | 73 | //void raiseTo(); |
pvela | 6:5cc6a9b6f60e | 74 | |
pvela | 6:5cc6a9b6f60e | 75 | |
pvela | 6:5cc6a9b6f60e | 76 | /** |
pvela | 6:5cc6a9b6f60e | 77 | * NOT SURE. HOW DIFFERENT FROM ABOVE? raiseTo should raise to any |
pvela | 6:5cc6a9b6f60e | 78 | * arbitrary angle within limits. |
pvela | 6:5cc6a9b6f60e | 79 | * |
pvela | 6:5cc6a9b6f60e | 80 | */ |
Josahty | 0:6942f0e2198c | 81 | //void LowerBed(); |
Josahty | 3:cd6e2d7c7c9c | 82 | |
Josahty | 0:6942f0e2198c | 83 | |
Josahty | 0:6942f0e2198c | 84 | protected: |
Josahty | 0:6942f0e2198c | 85 | int truckNumber; |
Josahty | 0:6942f0e2198c | 86 | float speed; // desired speed to drive the robot, a number between -1 and 1 |
Josahty | 3:cd6e2d7c7c9c | 87 | float distance; |
Josahty | 3:cd6e2d7c7c9c | 88 | float getDistance(); // input of desired distance to be traveled |
Josahty | 0:6942f0e2198c | 89 | float setTruckSpeed(); // set truck speed |
Josahty | 0:6942f0e2198c | 90 | float setTruckDistance(); // set distance to be traveled |
Josahty | 0:6942f0e2198c | 91 | //getBedAngle(); //Get data from Bed potentiometer, Hari is looking into the component for this |
Josahty | 0:6942f0e2198c | 92 | //getPivotAngle(double PivotAngle); //Get data from potentiometer |
Josahty | 0:6942f0e2198c | 93 | //SetPivotSpeed(double PivotSpeed); //Set arbitrary rotation of servo motor |
Josahty | 0:6942f0e2198c | 94 | //SetBedSpeed(); //Set arbitrary rotation of DC Motor |
Josahty | 0:6942f0e2198c | 95 | //bool GetBedUpperSwitch(); //Checks if bed is all the way up |
Josahty | 0:6942f0e2198c | 96 | //bool GetBedLowerSwitch(); //Checks if bed is all the way down |
Josahty | 0:6942f0e2198c | 97 | //bool SwitchState; //Switch state variable for Up and down bed functions |
Josahty | 0:6942f0e2198c | 98 | //float DesiredPivotAngle; // User Input of desired angle for the bed to be pivoted |
Josahty | 0:6942f0e2198c | 99 | //float DesiredBedAngle; //User Input of desired bed angle to be raised. |
Josahty | 0:6942f0e2198c | 100 | //float BedSpeed; //User input of desired speed for the dump truck's bed to rotate |
Josahty | 0:6942f0e2198c | 101 | //float PivotSpeed; //User input of desired speed for the dump truck to pivot its back at |
Josahty | 0:6942f0e2198c | 102 | |
Josahty | 0:6942f0e2198c | 103 | //bool isCalibrated;// returns 0 and 1 to check if the robot has been calibrated |
Josahty | 0:6942f0e2198c | 104 | }; |
simplyellow | 5:dc4cf6cc24b3 | 105 | #endif |