#include <fhw_interface.h>
Public Types | |
| enum | { FRONT_RIGHT = 0, FRONT_LEFT = 1, BACK_RIGHT = 2, BACK_LEFT = 3 } |
Public Member Functions | |
| fhwInterface (int write, const char *servo_dev="/dev/ttyS1") | |
| Constructor. | |
| ~fhwInterface (void) | |
| Destructor. | |
| void | readStatus (void) |
| Fake Read Status. | |
| void | writeControl (void) |
| Fake Writing to share memory. | |
| void | wait (void) |
| Simulate hwInterface Wait. | |
| void | reset (void) |
| Simulate hwInterface Reset. | |
| int | encTicks (int encNum) |
| returns the cumulative number of ticks a wheel has moved | |
| int | encTicksFR (void) |
| Reads Encoder Value for Front Right Encoder. | |
| int | encTicksFL (void) |
| Reads Encoder Value for Front Left Encoder. | |
| int | encTicksBR (void) |
| Reads Encoder Value for Back Right Encoder. | |
| int | encTicksBL (void) |
| Reads Encoder Value for Back Left Encoder. | |
| int | a2d (int adNum) |
| returns the A2D value for a certain input | |
| float | getAngle (void) |
| return the current steering angle | |
| void | setAngle (float angle) |
| Set Truck Steering Angle. | |
| void | setSCPower (float power) |
| Set Speed Controller Power. | |
| void | setAdjustedSCPower (float power) |
| This function linearizes the SC power output. | |
| void | setSCValue (int value) |
| Set speed Controller Value. | |
| void | safeStop (void) |
| Stop Speed Controller. | |
Protected Attributes | |
| status_t | status |
| int | driver_fd |
| int | servo_fd |
| int | writeEn |
| SSC | speedController |
| Servo | steeringServo |
| SSC | shiftingServo |
| float | valueErr |
This is a fake Hardware interface that does not require being on the truck. This is written so that we can test components that depend on this class without having to load everything on to the truck.
Definition at line 47 of file fhw_interface.h.
|
|
Definition at line 70 of file fhw_interface.h. |
|
||||||||||||
|
Constructor.
Definition at line 30 of file fhw_interface.cpp. |
|
|
Destructor.
Definition at line 53 of file fhw_interface.cpp. |
|
|
returns the A2D value for a certain input
Definition at line 166 of file fhw_interface.h. References status_t::encoder, and status. |
|
|
returns the cumulative number of ticks a wheel has moved Long Description if necessary.
Definition at line 100 of file fhw_interface.h. References status_t::encoder, and status. |
|
|
Reads Encoder Value for Back Left Encoder. Long Description if necessary.
Definition at line 152 of file fhw_interface.h. References BACK_LEFT, status_t::encoder, and status. |
|
|
Reads Encoder Value for Back Right Encoder.
Definition at line 138 of file fhw_interface.h. References BACK_RIGHT, status_t::encoder, and status. |
|
|
Reads Encoder Value for Front Left Encoder.
Definition at line 126 of file fhw_interface.h. References status_t::encoder, FRONT_LEFT, and status. |
|
|
Reads Encoder Value for Front Right Encoder.
Definition at line 114 of file fhw_interface.h. References status_t::encoder, FRONT_RIGHT, and status. |
|
|
return the current steering angle
Definition at line 180 of file fhw_interface.h. References Servo::getAngle(), and steeringServo. |
|
|
Fake Read Status. A stuf for the readStatus function to emulate the hwInterface class.
Definition at line 97 of file fhw_interface.cpp. |
|
|
Simulate hwInterface Reset. Zero out the a2d and encoder values as if the truck was being reset.
Definition at line 123 of file fhw_interface.cpp. References status_t::a2d, status_t::encoder, status, and wait(). |
|
|
Stop Speed Controller.
Definition at line 64 of file fhw_interface.cpp. References setSCPower(). |
|
|
This function linearizes the SC power output.
Definition at line 162 of file fhw_interface.cpp. References SSC::setValue(), speedController, and valueErr. |
|
|
Set Truck Steering Angle.
Definition at line 193 of file fhw_interface.h. References Servo::setAngle(), and steeringServo. |
|
|
Set Speed Controller Power.
Definition at line 145 of file fhw_interface.cpp. References SSC::setValue(), and speedController. Referenced by safeStop(). |
|
|
Set speed Controller Value.
Definition at line 206 of file fhw_interface.h. References SSC::setValue(), and speedController. |
|
|
Simulate hwInterface Wait. Sleep for half a second.
Definition at line 110 of file fhw_interface.cpp. Referenced by reset(). |
|
|
Fake Writing to share memory. Change Local data values to qusi-simulate what might happen to them after control has been written.
Definition at line 78 of file fhw_interface.cpp. References status_t::a2d, status_t::encoder, SSC::getValue(), speedController, and status. |
|
|
Definition at line 50 of file fhw_interface.h. Referenced by fhwInterface(). |
|
|
Definition at line 51 of file fhw_interface.h. Referenced by fhwInterface(). |
|
|
Definition at line 56 of file fhw_interface.h. |
|
|
Definition at line 54 of file fhw_interface.h. Referenced by setAdjustedSCPower(), setSCPower(), setSCValue(), and writeControl(). |
|
|
Definition at line 49 of file fhw_interface.h. Referenced by a2d(), encTicks(), encTicksBL(), encTicksBR(), encTicksFL(), encTicksFR(), reset(), and writeControl(). |
|
|
Definition at line 55 of file fhw_interface.h. Referenced by getAngle(), and setAngle(). |
|
|
Definition at line 58 of file fhw_interface.h. Referenced by setAdjustedSCPower(). |
|
|
Definition at line 52 of file fhw_interface.h. Referenced by fhwInterface(). |
1.4.6