Description
Vehicle Brain instance that instructs its vehicle to follow a given curve and stop based on zombie agent and traffic light message data.
#include <SynQueryEnvBrain.h>
Public Member Functions | |
SynQueryEnvBrain (int rank, std::shared_ptr< vehicle::ChDriver > driver, vehicle::ChVehicle &vehicle, std::vector< int > veh_ranks) | |
Construct a new QueryEnvBrain object. More... | |
~SynQueryEnvBrain () | |
Destroy the QueryEnvBrain object. | |
virtual void | Synchronize (double time) |
Updates the CurrentDistance of the underlying ACC Driver based on traffic light and vehicle proximity data. More... | |
virtual void | Advance (double step) |
Calls the advance function of the underlying driver. More... | |
virtual void | ProcessMessage (SynMessage *msg) |
Updates state variables with information from the passed in message. More... | |
Public Member Functions inherited from chrono::synchrono::SynVehicleBrain | |
SynVehicleBrain (int rank, std::shared_ptr< vehicle::ChDriver > driver, vehicle::ChVehicle &vehicle) | |
Constructor which takes and sets this brains ChDriver and ChVehicle. | |
~SynVehicleBrain () | |
Destructor. | |
virtual void | GenerateMessagesToSend (std::vector< SynMessage * > &messages) override |
Generate vector of SynMessage's to send. | |
vehicle::ChDriver::Inputs | GetDriverInputs () |
Get the driver inputs from the attached driver. | |
std::shared_ptr< vehicle::ChDriver > | GetDriver () |
Get the attached driver. | |
void | SetDriver (std::shared_ptr< vehicle::ChDriver > driver) |
Set the attached driver. | |
vehicle::ChVehicle & | GetVehicle () |
Public Member Functions inherited from chrono::synchrono::SynBrain | |
SynBrain (int rank) | |
Constructor. | |
virtual | ~SynBrain () |
Destructor. | |
int | GetRank () |
Get this brain's rank. | |
Public Attributes | |
const double | FAR_DISTANCE = 1000 |
Default distance to pass to ACC Driver. | |
const double | BOX_WIDTH = 2.5 |
Width of the box used for detecting other vehicles. | |
const double | BOX_LENGTH = 25 |
Length (ahead of the ego vehicle) of the box used for detecting other vehicles. | |
const double | BOX_OFFSET = 2.5 |
Distance ahead of this vehicle to start the box. | |
Additional Inherited Members | |
Protected Attributes inherited from chrono::synchrono::SynVehicleBrain | |
std::shared_ptr< vehicle::ChDriver > | m_driver |
handle to the ChDriver | |
vehicle::ChVehicle & | m_vehicle |
Protected Attributes inherited from chrono::synchrono::SynBrain | |
int | m_rank |
rank of this brain | |
Constructor & Destructor Documentation
◆ SynQueryEnvBrain()
chrono::synchrono::SynQueryEnvBrain::SynQueryEnvBrain | ( | int | rank, |
std::shared_ptr< vehicle::ChDriver > | driver, | ||
vehicle::ChVehicle & | vehicle, | ||
std::vector< int > | veh_ranks | ||
) |
Construct a new QueryEnvBrain object.
- Parameters
-
rank The MPI rank that this brain is associated with driver ACCPathFollowerDriver that will be used to steer this vehicle vehicle The Chrono Vehicle that is driven by this Brain veh_ranks A vector of the other ranks in simulation who should be checked for proximity
Member Function Documentation
◆ Advance()
|
virtual |
Calls the advance function of the underlying driver.
- Parameters
-
step See the ACCPathFollowerDriver::Advance
Reimplemented from chrono::synchrono::SynVehicleBrain.
◆ ProcessMessage()
|
virtual |
Updates state variables with information from the passed in message.
- Parameters
-
msg The message to be processed. If a vehicle message, the position will be set in the m_other_vehicles structure, if a MAP or SPAT message, the traffic light varibles will be updated
Reimplemented from chrono::synchrono::SynVehicleBrain.
◆ Synchronize()
|
virtual |
Updates the CurrentDistance of the underlying ACC Driver based on traffic light and vehicle proximity data.
- Parameters
-
time The time in simulation that should be synchronized to
Reimplemented from chrono::synchrono::SynVehicleBrain.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_synchrono/brain/SynQueryEnvBrain.h
- /builds/uwsbel/chrono/src/chrono_synchrono/brain/SynQueryEnvBrain.cpp