libpandac
0.0.0
A library designed for a comm.ai Panda.
|
Handles USB communication and parsing with a comma.ai Panda. More...
Classes | |
struct | _CanFrame |
struct | _GpsData |
struct | _GpsInfo |
struct | _GpsMotion |
struct | _GpsPosition |
struct | _GpsQuality |
struct | _GpsSatellite |
class | Can |
A class that handles the CAN data. More... | |
class | CanListener |
An abstract class for new data notifications for new CAN data. More... | |
class | Gps |
A class that handles the GPS data. More... | |
class | GpsListener |
An abstract class for new data notifications for new GPS data. More... | |
class | Handler |
A class that handles the Usb, GPS, and CAN data. More... | |
class | ObdPidRequest |
class | SetSystemTimeObserver |
class | ToyotaHandler |
A threaded interface class that handles sending contorl commands to a Panda via a Panda::Handler. More... | |
class | Usb |
class | UsbListener |
class | VinReader |
Typedefs | |
typedef struct Panda::_CanFrame | CanFrame |
typedef struct Panda::_GpsPosition | GpsPosition |
typedef struct Panda::_GpsMotion | GpsMotion |
typedef struct Panda::_GpsQuality | GpsQuality |
typedef struct Panda::_GpsSatellite | GpsSatellite |
typedef struct Panda::_GpsInfo | GpsInfo |
typedef struct Panda::_GpsData | GpsData |
Functions | |
CanFrame | bufferToCanFrame (char *buffer, int bufferLength) |
Converts a buffer from Panda to CanFrame data. More... | |
void | canFrameToBuffer (CanFrame &frame, unsigned char *buffer) |
Converts a CanFrame into a buffer for sending to the Panda. More... | |
CanFrame | buildLkasHud (bool lkaAlert, unsigned char leftLane, unsigned char rightLane, bool barrier, bool twoBeeps, bool repeatedBeeps) |
Constructs the LKAS_HUS command that works on a Toyota RAV4. More... | |
CanFrame | buildSteeringLKA (unsigned char count, int16_t steerTorque, bool steerRequest, unsigned char lkaState) |
Constructs the STEERING_LKA command, used for sending steering torque. More... | |
CanFrame | buildACC_CONTROL (double acc, bool permitBraking, bool releaseStandstill, bool miniCar, bool cancelRequest) |
Constructs the ACC_CONTROL command, used for sending cruise cntrol accelerations. More... | |
CanFrame | buildTRACK_B_1 (unsigned char count) |
Constructs the TRACK_B_1 command, needed to fake adaptive cruise controller operation. Note that there could be more things to fake in this command, but for use of ACC_CONTROL this command is intercepted to prevent run-time faults of the ACC. More... | |
CanFrame | buildPCM_CRUISE_2 (unsigned char SET_SPEED) |
Unused by ToyotaHandler. Also untested. | |
CanFrame | buildDSU_CRUISE (unsigned char SET_SPEED) |
Unused by ToyotaHandler. Also untested. | |
uint8_t | toyotaChecksum (Panda::CanFrame &frame) |
Computes particular checksums within the CAN message, and is not the CRC for the CAN frame itself. More... | |
void | printFrame (Panda::CanFrame frame) |
This funciton is helpful for debugging but should either not live in toyota.h or shoul dbe removed: More... | |
const char * | safetyModelToString (int safetyModel) |
const char * | carHarnessStatusToString (int car_harness_status) |
const char * | faultStatusToString (int fault_status) |
std::string | faultsToString (int faults) |
const char * | usbPowerModeToString (int usb_power_mode) |
void | printPandaHealth (const PandaHealth &health) |
Handles USB communication and parsing with a comma.ai Panda.
CanFrame Panda::bufferToCanFrame | ( | char * | buffer, |
int | bufferLength | ||
) |
CanFrame Panda::buildACC_CONTROL | ( | double | acc, |
bool | permitBraking, | ||
bool | releaseStandstill, | ||
bool | miniCar, | ||
bool | cancelRequest | ||
) |
Constructs the ACC_CONTROL command, used for sending cruise cntrol accelerations.
permitBraking | Unsure of purpose outside of name. Should be 1 when sending control commands, perhaps. |
releaseStandstill | Unsure of purpose outside of name. Should be 1 when sending control commands when car has been commanded to stop and is desired to let the car continue to be controlle dout of a stop, perhaps. |
miniCar | Will display the "Mini Car" on the HUD, but only works when the cruise control is activated and operating. |
cancelRequest | Will cancel the cruise controller, informing the driver to regain control of the vehicle. |
CanFrame Panda::buildLkasHud | ( | bool | lkaAlert, |
unsigned char | leftLane, | ||
unsigned char | rightLane, | ||
bool | barrier, | ||
bool | twoBeeps, | ||
bool | repeatedBeeps | ||
) |
Constructs the LKAS_HUS command that works on a Toyota RAV4.
lkaAlert | Will invoke a "Please grab steering wheel" notification on the car HUD. |
leftlane | Can be 0-3, and will show different left lane visuals on the HUD. |
rightlane | Can be 0-3, and will show different right lane visuals on the HUD. |
barrier | Will display a barrier on the right and left lanes. |
twoBeeps | Will cause a single two-beep audible alert in the car. If called too frequently then it may not trigger. |
repeatedBeeps | Will cause a continuous audible beeping alert. |
CanFrame Panda::buildSteeringLKA | ( | unsigned char | count, |
int16_t | steerTorque, | ||
bool | steerRequest, | ||
unsigned char | lkaState | ||
) |
Constructs the STEERING_LKA command, used for sending steering torque.
count | This needs to increase by 1 on each send, probably for error checking. |
steerTorque | In unknown units, but is valid from -1500:1500. |
steerRequest | Should be set to 1 when a steering torque is sent. This is shown by CAN reading of the built-in LKA. |
lkaState | Unknown, labeled in the DBC. Stays 0 based on CAN data. |
CanFrame Panda::buildTRACK_B_1 | ( | unsigned char | count | ) |
Constructs the TRACK_B_1 command, needed to fake adaptive cruise controller operation. Note that there could be more things to fake in this command, but for use of ACC_CONTROL this command is intercepted to prevent run-time faults of the ACC.
count | Needs to be increment on each call. It may be only 6 bits long even though the DBC states 8-bits. See ToyotaHandler for how this is handeled. |
void Panda::canFrameToBuffer | ( | CanFrame & | frame, |
unsigned char * | buffer | ||
) |
void Panda::printFrame | ( | Panda::CanFrame | frame | ) |
This funciton is helpful for debugging but should either not live in toyota.h or shoul dbe removed:
frame | The frame to be printed to the console |
uint8_t Panda::toyotaChecksum | ( | Panda::CanFrame & | frame | ) |
Computes particular checksums within the CAN message, and is not the CRC for the CAN frame itself.
frame | The frame for the checksum to be computer |