chrono::synchrono::SynQueryEnvBrain Class Reference

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>

Inheritance diagram for chrono::synchrono::SynQueryEnvBrain:
Collaboration diagram for chrono::synchrono::SynQueryEnvBrain:

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::ChDriverGetDriver ()
 Get the attached driver.
 
void SetDriver (std::shared_ptr< vehicle::ChDriver > driver)
 Set the attached driver.
 
vehicle::ChVehicleGetVehicle ()
 
- 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::ChDriverm_driver
 handle to the ChDriver
 
vehicle::ChVehiclem_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
rankThe MPI rank that this brain is associated with
driverACCPathFollowerDriver that will be used to steer this vehicle
vehicleThe Chrono Vehicle that is driven by this Brain
veh_ranksA vector of the other ranks in simulation who should be checked for proximity

Member Function Documentation

◆ Advance()

void chrono::synchrono::SynQueryEnvBrain::Advance ( double  step)
virtual

Calls the advance function of the underlying driver.

Parameters
stepSee the ACCPathFollowerDriver::Advance

Reimplemented from chrono::synchrono::SynVehicleBrain.

◆ ProcessMessage()

void chrono::synchrono::SynQueryEnvBrain::ProcessMessage ( SynMessage msg)
virtual

Updates state variables with information from the passed in message.

Parameters
msgThe 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()

void chrono::synchrono::SynQueryEnvBrain::Synchronize ( double  time)
virtual

Updates the CurrentDistance of the underlying ACC Driver based on traffic light and vehicle proximity data.

Parameters
timeThe 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