libpandac
0.0.0
A library designed for a comm.ai Panda.
|
A threaded interface class that handles sending contorl commands to a Panda via a Panda::Handler. More...
#include <toyota.h>
Public Member Functions | |
ToyotaHandler (Panda::Handler *handler) | |
Construction must be done with a Panda::Handler. More... | |
void | setHudLdaAlert (bool enable) |
Tells the driver to grab the steering wheel. More... | |
void | setHudBarrier (bool enable) |
Shows lane barriers on the HUD. More... | |
void | setHudLanes (unsigned char laneLeft, unsigned char laneRight) |
Shows different lanes for the right and left side. Valid values 0-3: More... | |
void | setHudTwoBeeps (bool enable) |
Will cause a double-beep alert. Appears to be inconsistent in operation. More... | |
void | setHudRepeatedBeeps (bool enable) |
Will cause continuous beeping. More... | |
void | setHudMiniCar (bool enable) |
Displays the "Mini Car" on the HUD. More... | |
void | setHudCruiseCancelRequest (bool enable) |
Invokes a cruise control cancel request, for the driver to take control over vehicle. This will disable cruise control. Commands can only be sent to the car again if the driver re-activates cruise control. More... | |
void | setSteerTorque (int steerTorque) |
Sends a steering torque to the steering wheel (non-working). More... | |
void | setAcceleration (double acceleration) |
Sends acceleration to the cruise controller, in units of m/s^2. More... | |
bool | getIgnitionOn () |
Returns the Panda report for whether the ignition is on (line). More... | |
bool | getControlsAllowed () |
Returns the Panda health report for whether controls are allowed. Controls are allowed when the cruise control is turned on and active from a SET press. This will get disabled by many events. Consider the following sequences with the corresponding return result of this function: More... | |
const PandaHealth & | getPandaHealth () const |
Returns the full Panda Health state. controls_allowed and ignition_line can be read form this. More... | |
Public Member Functions inherited from Mogi::Thread | |
bool | start () |
Starts the internal thread method. More... | |
void | stop () |
Stops the internal thread method. More... | |
void | WaitForInternalThreadToExit () |
Will wait until the thread has finished. | |
int | lock () |
Performs a mutual exclusion lock. Will halt if locked by another thread, and will resume when the other thread performs an unlock. More... | |
int | unlock () |
Performs a mutual exclusion unlock. Will allow other threads that have been locked to resume. More... | |
void | pause () |
Performs a pause. More... | |
void | resume () |
Resumes the thread from a pause. More... | |
bool | running () |
Returns the state of the thread. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Mogi::Thread | |
void | checkSuspend () |
Blocks the thread from a pause() call until resume() is called. | |
A threaded interface class that handles sending contorl commands to a Panda via a Panda::Handler.
Panda::ToyotaHandler::ToyotaHandler | ( | Panda::Handler * | handler | ) |
Construction must be done with a Panda::Handler.
handler | The active interface for the Panda. The handler should be initialed with Panda::Handler::initialize() before Toyota::Handler::start() is called. |
bool Panda::ToyotaHandler::getControlsAllowed | ( | ) |
Returns the Panda health report for whether controls are allowed. Controls are allowed when the cruise control is turned on and active from a SET press. This will get disabled by many events. Consider the following sequences with the corresponding return result of this function:
bool Panda::ToyotaHandler::getIgnitionOn | ( | ) |
const PandaHealth& Panda::ToyotaHandler::getPandaHealth | ( | ) | const |
Returns the full Panda Health state. controls_allowed and ignition_line can be read form this.
void Panda::ToyotaHandler::setAcceleration | ( | double | acceleration | ) |
Sends acceleration to the cruise controller, in units of m/s^2.
acceleration | The acceleration to be sent. Units are m/s^2, valid range is always -3.0:1.5 |
void Panda::ToyotaHandler::setHudBarrier | ( | bool | enable | ) |
Shows lane barriers on the HUD.
enable | Whether the barriers should be displayed |
void Panda::ToyotaHandler::setHudCruiseCancelRequest | ( | bool | enable | ) |
Invokes a cruise control cancel request, for the driver to take control over vehicle. This will disable cruise control. Commands can only be sent to the car again if the driver re-activates cruise control.
enable | Whether to invoke the Cancel Request |
void Panda::ToyotaHandler::setHudLanes | ( | unsigned char | laneLeft, |
unsigned char | laneRight | ||
) |
Shows different lanes for the right and left side. Valid values 0-3:
laneLeft | The setting for the left lane |
rightLeft | The setting for the right lane |
void Panda::ToyotaHandler::setHudLdaAlert | ( | bool | enable | ) |
Tells the driver to grab the steering wheel.
enable | Whether the "Grab Steering Wheel" alert should be displayed |
void Panda::ToyotaHandler::setHudMiniCar | ( | bool | enable | ) |
Displays the "Mini Car" on the HUD.
enable | Whether the Mini Car should be displayed in the HUD. |
void Panda::ToyotaHandler::setHudRepeatedBeeps | ( | bool | enable | ) |
Will cause continuous beeping.
enable | Whether the repeated beeping should be played |
void Panda::ToyotaHandler::setHudTwoBeeps | ( | bool | enable | ) |
Will cause a double-beep alert. Appears to be inconsistent in operation.
enable | Whether the Two Beeps should be played |
void Panda::ToyotaHandler::setSteerTorque | ( | int | steerTorque | ) |
Sends a steering torque to the steering wheel (non-working).
steerTorque | The steering torque to be sent. Valid range is -1500:1500 |