chrono::synchrono::SynTrackedVehicleAgent Class Reference

Description

Agent wrapper of a tracked vehicle, in particular holds a pointer to a ChTrackedVehicle 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 (chrono::vehicle::ChTrackedVehicle *vehicle=nullptr, const std::string &filename="")
 Construct a tracked vehicle agent with the specified node_id. More...
 
virtual ~SynTrackedVehicleAgent ()
 Destructor.
 
virtual void InitializeZombie (ChSystem *system) override
 Initialize this agents zombie representation Bodies are added and represented in the lead agent's world. More...
 
virtual void SynchronizeZombie (std::shared_ptr< SynMessage > message) override
 Synchronize this agents zombie with the rest of the simulation. More...
 
virtual void Update () override
 Update this agent Typically used to update the state representation of the agent to be distributed to other agents. More...
 
virtual void GatherMessages (SynMessageList &messages) override
 Generates messages to be sent to other nodes Will create or get messages and pass them into the referenced message vector. More...
 
virtual void GatherDescriptionMessages (SynMessageList &messages) override
 Get the description messages for this agent A single agent may have multiple description messages. More...
 
void SetZombieVisualizationFilesFromJSON (const std::string &filename)
 Set the zombie visualization files from a JSON specification file. More...
 
void SetZombieVisualizationFiles (const std::string &chassis_vis_file, const std::string &track_shoe_vis_file, const std::string &left_sprocket_vis_file, const std::string &right_sprocket_vis_file, const std::string &left_idler_vis_file, const std::string &right_idler_vis_file, const std::string &left_road_wheel_vis_file, const std::string &right_road_wheel_vis_file)
 Set the zombie visualization files. More...
 
void SetNumAssemblyComponents (int num_track_shoes, int num_sprockets, int num_idlers, int num_road_wheels)
 Set the number of assembly components. More...
 
virtual void SetID (SynAgentID aid) override
 Set the Agent ID. More...
 
- Public Member Functions inherited from chrono::synchrono::SynAgent
 SynAgent (SynAgentID aid=0)
 Construct a agent with the specified node_id. More...
 
virtual ~SynAgent ()
 Destructor.
 
virtual void ProcessMessage (std::shared_ptr< SynMessage > msg)
 Process an incoming message. More...
 
virtual void RegisterZombie (std::shared_ptr< SynAgent > zombie)
 Register a new zombie. More...
 
void SetProcessMessageCallback (std::function< void(std::shared_ptr< SynMessage >)> callback)
 
SynAgentID GetID ()
 

Additional Inherited Members

- Protected Attributes inherited from chrono::synchrono::SynAgent
SynAgentID m_aid
 
std::function< void(std::shared_ptr< SynMessage >)> m_process_message_callback
 

Constructor & Destructor Documentation

◆ SynTrackedVehicleAgent()

chrono::synchrono::SynTrackedVehicleAgent::SynTrackedVehicleAgent ( chrono::vehicle::ChTrackedVehicle vehicle = nullptr,
const std::string &  filename = "" 
)

Construct a tracked vehicle agent with the specified node_id.

Parameters
vehiclethe vehicle this agent is responsible for (will be null if agent's a zombie)
filenamejson specification file for zombie visualization

Member Function Documentation

◆ GatherDescriptionMessages()

virtual void chrono::synchrono::SynTrackedVehicleAgent::GatherDescriptionMessages ( SynMessageList &  messages)
inlineoverridevirtual

Get the description messages for this agent A single agent may have multiple description messages.

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

Implements chrono::synchrono::SynAgent.

◆ GatherMessages()

virtual void chrono::synchrono::SynTrackedVehicleAgent::GatherMessages ( SynMessageList &  messages)
inlineoverridevirtual

Generates messages to be sent to other nodes 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.

◆ InitializeZombie()

void chrono::synchrono::SynTrackedVehicleAgent::InitializeZombie ( ChSystem system)
overridevirtual

Initialize this agents zombie representation Bodies are added and represented in the lead agent's world.

Parameters
systemthe ChSystem used to initialize the zombie

Implements chrono::synchrono::SynAgent.

◆ SetID()

void chrono::synchrono::SynTrackedVehicleAgent::SetID ( SynAgentID  aid)
overridevirtual

Set the Agent ID.

Reimplemented from chrono::synchrono::SynAgent.

◆ SetNumAssemblyComponents()

void chrono::synchrono::SynTrackedVehicleAgent::SetNumAssemblyComponents ( int  num_track_shoes,
int  num_sprockets,
int  num_idlers,
int  num_road_wheels 
)
inline

Set the number of assembly components.

Parameters
num_track_shoesnumber of track shoes
num_sprocketsnumber of sprockets
num_idlersnumber of idlers
num_road_wheelsnumber of road_wheels

◆ SetZombieVisualizationFiles()

void chrono::synchrono::SynTrackedVehicleAgent::SetZombieVisualizationFiles ( const std::string &  chassis_vis_file,
const std::string &  track_shoe_vis_file,
const std::string &  left_sprocket_vis_file,
const std::string &  right_sprocket_vis_file,
const std::string &  left_idler_vis_file,
const std::string &  right_idler_vis_file,
const std::string &  left_road_wheel_vis_file,
const std::string &  right_road_wheel_vis_file 
)
inline

Set the zombie visualization files.

Parameters
chassis_vis_filethe file used for chassis visualization
track_shoe_vis_filethe file used for track shoe visualization
left_sprocket_vis_filethe file used for left sprocket visualization
right_sprocket_vis_filethe file used for right sprocket visualization
left_idler_vis_filethe file used for left idler visualization
right_idler_vis_filethe file used for right idler visualization
left_road_wheel_vis_filethe file used for left road_wheel visualization
right_road_wheel_vis_filethe file used for right road_wheel visualization

◆ SetZombieVisualizationFilesFromJSON()

void chrono::synchrono::SynTrackedVehicleAgent::SetZombieVisualizationFilesFromJSON ( const std::string &  filename)

Set the zombie visualization files from a JSON specification file.

Parameters
filenamethe json specification file

◆ SynchronizeZombie()

void chrono::synchrono::SynTrackedVehicleAgent::SynchronizeZombie ( std::shared_ptr< SynMessage message)
overridevirtual

Synchronize this agents zombie with the rest of the simulation.

Updates agent based on the passed message. Any message can be passed, so a check should be done to ensure this message was intended for this agent.

Parameters
messagethe message to process and is used to update the position of the zombie

Implements chrono::synchrono::SynAgent.

◆ Update()

void chrono::synchrono::SynTrackedVehicleAgent::Update ( )
overridevirtual

Update this agent Typically used to update the state representation of the agent to be distributed to other agents.

Implements chrono::synchrono::SynAgent.


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