chrono::synchrono::SynTrackedVehicleAgent Class Reference

Description

Agent wrapper of a tracked vehicle, in particular holds a reference to a SynTrackedVehicle and sends out SynTrackedVehicleMessage-s to synchronize its state.

#include <SynTrackedVehicleAgent.h>

Inheritance diagram for chrono::synchrono::SynTrackedVehicleAgent:
Collaboration diagram for chrono::synchrono::SynTrackedVehicleAgent:

Public Member Functions

 SynTrackedVehicleAgent (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...
 
 SynTrackedVehicleAgent (unsigned int rank, ChCoordsys<> coord_sys, const std::string &filename, ChSystem *system)
 Construct a tracked vehicle agent with a json specification file. More...
 
 SynTrackedVehicleAgent (unsigned int rank, ChCoordsys<> coord_sys, const std::string &filename, ChContactMethod contact_method)
 Construct a tracked vehicle agent with a json specification file. More...
 
 SynTrackedVehicleAgent (unsigned int rank, const std::string &filename)
 Construct a zombie vehicle agent from the specified json configuration and the ChSystem. More...
 
virtual ~SynTrackedVehicleAgent ()
 Destroy the SynTrackedVehicleAgent.
 
virtual void Synchronize (double step, vehicle::ChDriver::Inputs driver_inputs) override
 Synchronize the underlying vehicle. More...
 
virtual std::shared_ptr< SynMessageStateGetState () override
 Get the state of this agent. More...
 
virtual std::shared_ptr< SynAgentMessageGetMessage () override
 Get the this agent's message to be pass to other ranks. More...
 
virtual void GenerateMessagesToSend (std::vector< SynMessage * > &messages) override
 Generates messages to be sent to other ranks Will create or get messages and pass them into the referenced message vector. More...
 
virtual std::shared_ptr< SynVehicleGetVehicle () override
 Get/Set this agent's vehicle.
 
std::shared_ptr< SynTrackedVehicle > GetTrackedVehicle ()
 
void SetVehicle (std::shared_ptr< SynTrackedVehicle > tracked_vehicle)
 
- Public Member Functions inherited from 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. More...
 
virtual ~SynVehicleAgent ()
 Destructor.
 
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...
 
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.
 
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.
 

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...
 
- Protected Member Functions inherited from chrono::synchrono::SynVehicleAgent
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 inherited from chrono::synchrono::SynVehicleAgent
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
 

Constructor & Destructor Documentation

◆ SynTrackedVehicleAgent() [1/4]

chrono::synchrono::SynTrackedVehicleAgent::SynTrackedVehicleAgent ( 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.

Parameters
rankthe rank of this agent
systeman optional argument of the ChSystem to build the vehicle with

◆ SynTrackedVehicleAgent() [2/4]

chrono::synchrono::SynTrackedVehicleAgent::SynTrackedVehicleAgent ( unsigned int  rank,
ChCoordsys<>  coord_sys,
const std::string &  filename,
ChSystem system 
)

Construct a tracked vehicle agent with a json specification file.

Parameters
rankthe rank of this agent
coord_systhe initial position and orientation of the vehicle
filenamethe json specification file
systemthe system to build the vehicle with

◆ SynTrackedVehicleAgent() [3/4]

chrono::synchrono::SynTrackedVehicleAgent::SynTrackedVehicleAgent ( unsigned int  rank,
ChCoordsys<>  coord_sys,
const std::string &  filename,
ChContactMethod  contact_method 
)

Construct a tracked vehicle agent with a json specification file.

Parameters
rankthe rank of this agent
coord_systhe initial position and orientation of the vehicle
filenamethe json specification file
systemthe contact method used to build the vehicle

◆ SynTrackedVehicleAgent() [4/4]

chrono::synchrono::SynTrackedVehicleAgent::SynTrackedVehicleAgent ( unsigned int  rank,
const std::string &  filename 
)

Construct a zombie vehicle agent from the specified json configuration and the ChSystem.

Parameters
rankthe rank of the zombie agent
filenamethe json specification file

Member Function Documentation

◆ GenerateMessagesToSend()

void chrono::synchrono::SynTrackedVehicleAgent::GenerateMessagesToSend ( std::vector< SynMessage * > &  messages)
overridevirtual

Generates messages to be sent to other ranks Will create or get messages and pass them into the referenced message vector.

Parameters
messagesa referenced vector containing messages to be distributed from this rank

Implements chrono::synchrono::SynAgent.

◆ GetMessage()

virtual std::shared_ptr<SynAgentMessage> chrono::synchrono::SynTrackedVehicleAgent::GetMessage ( )
inlineoverridevirtual

Get the this agent's message to be pass to other ranks.

Returns
std::shared_ptr<SynMessageState>

Implements chrono::synchrono::SynAgent.

◆ GetState()

std::shared_ptr< SynMessageState > chrono::synchrono::SynTrackedVehicleAgent::GetState ( )
overridevirtual

Get the state of this agent.

Returns
std::shared_ptr<SynMessageState>

Implements chrono::synchrono::SynAgent.

◆ Synchronize()

void chrono::synchrono::SynTrackedVehicleAgent::Synchronize ( double  step,
vehicle::ChDriver::Inputs  driver_inputs 
)
overridevirtual

Synchronize the underlying vehicle.

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

Implements chrono::synchrono::SynVehicleAgent.


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