chrono::synchrono::SynVehicleAgent Class Referenceabstract

Description

Base class for wheeled and tracked SynVehicleAgents. Both know about ChTerrains, ChDrivers and ChVehicleBrains.

#include <SynVehicleAgent.h>

Inheritance diagram for chrono::synchrono::SynVehicleAgent:
Collaboration diagram for chrono::synchrono::SynVehicleAgent:

Public Member Functions

 SynVehicleAgent (unsigned int rank, ChSystem *system=0)
 Construct a vehicle agent with the specified rank and system Underlying agent is set to a vehicle type automatically. More...
 
virtual ~SynVehicleAgent ()
 Destructor.
 
virtual void Synchronize (double time, vehicle::ChDriver::Inputs driver_inputs)=0
 Synchronize the underlying vehicle. More...
 
virtual void InitializeZombie (ChSystem *system=0) override
 Initialize the zombie representation of the underlying vehicle. More...
 
virtual void SynchronizeZombie (SynMessage *message) override
 Synchronoize this agents zombie with the rest of the simulation. More...
 
virtual void Advance (double time_of_next_sync) override
 Advance the state of this vehicle agent until agent time syncs with passed time. More...
 
virtual void ProcessMessage (SynMessage *msg) override
 Process an incoming message. More...
 
virtual std::shared_ptr< SynVehicleGetVehicle ()=0
 Get this agent's vehicle.
 
std::shared_ptr< SynTerrainGetTerrain ()
 Get/Set the underlying terrain.
 
void SetTerrain (std::shared_ptr< SynTerrain > terrain)
 
std::shared_ptr< SynVehicleBrainGetBrain ()
 Get/Set the underlying brain for this agent.
 
void SetBrain (std::shared_ptr< SynVehicleBrain > brain)
 
std::shared_ptr< vehicle::ChDriverGetDriver ()
 Helper method to get the Chrono driver from the brain.
 
vehicle::ChVehicleGetChVehicle ()
 Helper method to get the ChVehicle from the SynVehicle.
 
- Public Member Functions inherited from chrono::synchrono::SynAgent
 SynAgent (unsigned int rank, SynAgentType type, ChSystem *system=nullptr)
 Construct a agent with the specified rank and type. More...
 
virtual ~SynAgent ()
 Destructor.
 
virtual std::shared_ptr< SynMessageStateGetState ()=0
 Get the state of this agent. More...
 
virtual std::shared_ptr< SynAgentMessageGetMessage ()=0
 Get the this agent's message to be pass to other ranks. More...
 
virtual void GenerateMessagesToSend (std::vector< SynMessage * > &messages)=0
 Generates messages to be sent to other ranks Will create or get messages and pass them into the referenced message vector. More...
 
void SetVisualizationManager (std::shared_ptr< SynVisualizationManager > vis_manager)
 Set the VisualizationManager for this agent.
 
std::shared_ptr< SynBrainGetBrain ()
 Get/Set this agent's brain.
 
void SetBrain (std::shared_ptr< SynBrain > brain)
 
unsigned int GetRank ()
 Get/Set this agent's rank.
 
void SetRank (unsigned int rank)
 
ChSystemGetSystem ()
 Get/Set the Chrono system associated with this agent.
 
void SetSystem (ChSystem *system)
 
double GetStepSize ()
 Get/Set this agent's step size.
 
void SetStepSize (double step_size)
 
SynAgentType GetType () const
 Get the type of this agent.
 

Protected Member Functions

rapidjson::Document ParseVehicleAgentFileJSON (const std::string &filename)
 Parse a vehicle agent json specification file. More...
 
void VehicleAgentFromJSON (rapidjson::Document &d)
 Construct a VehicleAgent from the document. More...
 

Protected Attributes

std::shared_ptr< SynTerrainm_terrain
 handle to this agent's terrain
 
std::shared_ptr< SynVehicleBrainm_brain
 handle to this agent's brain
 
- Protected Attributes inherited from chrono::synchrono::SynAgent
unsigned int m_rank
 agent rank
 
SynAgentType m_type
 agent type
 
double m_step_size
 Step size of the underlying agent.
 
std::shared_ptr< SynBrainm_brain
 handle to this agent's brain
 
std::shared_ptr< SynVisualizationManagerm_vis_manager
 handle to this agent's visualization manager
 
ChSystemm_system
 pointer to the Chrono system
 

Additional Inherited Members

- Static Public Member Functions inherited from chrono::synchrono::SynAgent
static rapidjson::Document ParseAgentFileJSON (const std::string &filename)
 Parse an agent json specification file. More...
 

Constructor & Destructor Documentation

◆ SynVehicleAgent()

chrono::synchrono::SynVehicleAgent::SynVehicleAgent ( unsigned int  rank,
ChSystem system = 0 
)

Construct a vehicle agent with the specified rank and system Underlying agent is set to a vehicle type automatically.

Construct a vehicle agent with the specified rank and system Underlying agent is set to a vehicle type automatically

Parameters
rankthe rank of this agent
systeman optional argument of a ChSystem to build zombies and get the Time

Member Function Documentation

◆ Advance()

void chrono::synchrono::SynVehicleAgent::Advance ( double  time_of_next_sync)
overridevirtual

Advance the state of this vehicle agent until agent time syncs with passed time.

Advance the state of this agent until agent time syncs with passed time.

Parameters
time_of_next_synctime at which this agent should stop advancing

Implements chrono::synchrono::SynAgent.

◆ InitializeZombie()

virtual void chrono::synchrono::SynVehicleAgent::InitializeZombie ( ChSystem system = 0)
inlineoverridevirtual

Initialize the zombie representation of the underlying vehicle.

Simply calls the same method on the underlying vehicle.

Parameters
systemthe system used to add bodies to for consistent visualization

Implements chrono::synchrono::SynAgent.

◆ ParseVehicleAgentFileJSON()

Document chrono::synchrono::SynVehicleAgent::ParseVehicleAgentFileJSON ( const std::string &  filename)
protected

Parse a vehicle agent json specification file.

Parameters
filenamethe json specification file
Returns
rapidjson::Document the parsed rapidjson document

◆ ProcessMessage()

void chrono::synchrono::SynVehicleAgent::ProcessMessage ( SynMessage msg)
overridevirtual

Process an incoming message.

Will pass the message directly to this agent's brain.

Parameters
msgthe received message to be processed

Reimplemented from chrono::synchrono::SynAgent.

◆ Synchronize()

virtual void chrono::synchrono::SynVehicleAgent::Synchronize ( double  time,
vehicle::ChDriver::Inputs  driver_inputs 
)
pure virtual

Synchronize the underlying vehicle.

Parameters
timethe time to synchronize to
driver_inputsthe driver inputs (i.e. throttle, braking, steering)

Implemented in chrono::synchrono::SynTrackedVehicleAgent, and chrono::synchrono::SynWheeledVehicleAgent.

◆ SynchronizeZombie()

virtual void chrono::synchrono::SynVehicleAgent::SynchronizeZombie ( SynMessage message)
inlineoverridevirtual

Synchronoize this agents zombie with the rest of the simulation.

Updates agent based on specified message.

Synchronize the position and orientation of this vehicle with other ranks. Simply calls the same method on the underlying vehicle.

Parameters
messagethe received message that describes the position and orientation.

Implements chrono::synchrono::SynAgent.

◆ VehicleAgentFromJSON()

void chrono::synchrono::SynVehicleAgent::VehicleAgentFromJSON ( rapidjson::Document &  d)
protected

Construct a VehicleAgent from the document.

Parameters
da rapidjson document that contains the required elements

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