chrono::synchrono::SynCollisionBrain Class Reference

Description

Detects when this vehicle is "nearby" other (target_rank) vehicles and calls a user-provided callback function in such a case.

#include <SynCollisionBrain.h>

Inheritance diagram for chrono::synchrono::SynCollisionBrain:
Collaboration diagram for chrono::synchrono::SynCollisionBrain:

Public Member Functions

virtual void ProcessMessage (SynMessage *msg) override
 Look through messages and call TrackLoc for ones that match our target rank.
 
void TrackLoc (SynMessage *msg, int sender_rank, ChVector<> location)
 Main function - process a message and determine if we had a collision.
 
void CheckDistanceCircle (ChVector<> pos1, ChVector<> pos2, double radius, int sender_rank)
 Helper function for circular collision detection.
 
void CheckDistanceRec (ChVector<> pos1, ChVector<> pos2, double short_rec_side, double long_rec_side, int sender_rank)
 
void SetVerbosity (bool verbose)
 
void SetMyLocation (ChVector<> location)
 
void TakeUserActionsRectangle ()
 
void TakeUserActionsCircle ()
 
void AddUserActionRectangle (void(*ptr)())
 
void AddUserActionCircle (void(*ptr)())
 
void AddTargetRank (int target)
 
void PrintTargetRanks ()
 
void RemoveTargetRank (int rm_target)
 
- 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 Advance (double step) override
 Advance the state of this brain until brain time syncs with passed time.
 
virtual void Synchronize (double time) override
 Synchronize this brain to the specified time.
 
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.
 

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
 

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_synchrono/brain/SynCollisionBrain.h
  • /builds/uwsbel/chrono/src/chrono_synchrono/brain/SynCollisionBrain.cpp