Interface to engines. More...
#include <engine_client_interface.h>
Public Member Functions | |
EngineClientInterface (ProcessLauncherInterface::unique_ptr &&launcher) | |
virtual | ~EngineClientInterface () |
virtual const std::string | engineName () const =0 |
Get Engine Name. More... | |
virtual const nlohmann::json & | engineConfig () const =0 |
Get engine config data. More... | |
virtual nlohmann::json & | engineConfig ()=0 |
Get engine config data. More... | |
virtual const std::vector< std::string > | engineProcStartParams () const =0 |
Get all Engine Process Startup parameters. More... | |
virtual pid_t | launchEngine () |
Launch the engine. More... | |
virtual void | initialize ()=0 |
Initialize engine. More... | |
virtual void | reset ()=0 |
Reset engine. More... | |
virtual void | shutdown ()=0 |
Shutdown engine. More... | |
virtual SimulationTime | getEngineTimestep () const =0 |
Get engine timestep. More... | |
virtual SimulationTime | getEngineTime () const =0 |
Get current engine time. More... | |
virtual const std::string | engineSchema () const =0 |
Get json schema for this specific engine type. More... | |
virtual void | runLoopStepAsync (SimulationTime timeStep)=0 |
Starts a single loop step in a separate thread. More... | |
virtual void | runLoopStepAsyncGet (SimulationTime timeOut)=0 |
Waits and gets the results of the loop step started by EngineClientInterface::runLoopStepAsync() More... | |
virtual void | sendDataPacksToEngine (const datapacks_set_t &dataPacks)=0 |
Sends datapacks to engine. More... | |
virtual datapacks_vector_t | getDataPacksFromEngine (const datapack_identifiers_set_t &datapackIdentifiers)=0 |
Gets requested datapacks from engine. More... | |
Protected Attributes | |
ProcessLauncherInterface::unique_ptr | _process |
Process Launcher. Will be used to stop process at end. More... | |
Additional Inherited Members | |
![]() | |
using | shared_ptr = std::shared_ptr< EngineClientInterface > |
using | const_shared_ptr = std::shared_ptr< const EngineClientInterface > |
using | unique_ptr = std::unique_ptr< EngineClientInterface > |
using | const_unique_ptr = std::unique_ptr< const EngineClientInterface > |
Interface to engines.
|
explicit |
|
virtualdefault |
|
pure virtual |
Get engine config data.
Implemented in EngineClient< ENGINE, SCHEMA >.
|
pure virtual |
Get engine config data.
Implemented in EngineClient< ENGINE, SCHEMA >, EngineClient< PySimNRPClient, SCHEMA >, EngineClient< GazeboEngineGrpcNRPClient, SCHEMA >, EngineClient< NestEngineJSONNRPClient, SCHEMA >, EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >, EngineClient< GazeboEngineJSONNRPClient, SCHEMA >, EngineClient< PythonEngineJSONNRPClient, SCHEMA >, EngineClient< PythonEngineGRPCNRPClient, SCHEMA >, EngineClient< PySimNRPClient, SCHEMA >, EngineClient< GazeboEngineGrpcNRPClient, SCHEMA >, EngineClient< NestEngineJSONNRPClient, SCHEMA >, EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >, EngineClient< GazeboEngineJSONNRPClient, SCHEMA >, EngineClient< PythonEngineJSONNRPClient, SCHEMA >, and EngineClient< PythonEngineGRPCNRPClient, SCHEMA >.
|
pure virtual |
|
pure virtual |
Get all Engine Process Startup parameters.
Implemented in EngineGrpcClient< ENGINE, SCHEMA >, EngineJSONNRPClient< ENGINE, SCHEMA >, PythonEngineGRPCNRPClient, NestEngineServerNRPClient, GazeboEngineGrpcNRPClient, and GazeboEngineJSONNRPClient.
|
pure virtual |
Get json schema for this specific engine type.
Throws | on error |
Implemented in EngineClient< ENGINE, SCHEMA >.
|
pure virtual |
Gets requested datapacks from engine.
datapackNames | All requested datapack ids |
Throws | on error |
Implemented in EngineGrpcClient< ENGINE, SCHEMA >, EngineGrpcClient< PythonEngineGRPCNRPClient, PythonGrpcConfigConst::EngineSchema >, EngineGrpcClient< GazeboEngineGrpcNRPClient, GazeboGrpcConfigConst::EngineSchema >, EngineJSONNRPClient< ENGINE, SCHEMA >, EngineJSONNRPClient< NestEngineJSONNRPClient, NestConfigConst::EngineSchema >, EngineJSONNRPClient< PySimNRPClient, SCHEMA >, EngineJSONNRPClient< PythonEngineJSONNRPClient, SCHEMA >, EngineJSONNRPClient< GazeboEngineJSONNRPClient, GazeboJSONConfigConst::EngineSchema >, and NestEngineServerNRPClient.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Initialize engine.
Throws | on error |
Implemented in PythonEngineJSONNRPClientBase< ENGINE, SCHEMA >, PythonEngineGRPCNRPClient, PythonEngineJSONNRPClientBase< PythonEngineJSONNRPClient, PythonConfigConst::EngineSchema >, PythonEngineJSONNRPClientBase< PySimNRPClient, PySimConfigConst::EngineSchema >, NestEngineServerNRPClient, NestEngineJSONNRPClient, GazeboEngineGrpcNRPClient, and GazeboEngineJSONNRPClient.
|
virtual |
Launch the engine.
Reimplemented in EngineGrpcClient< ENGINE, SCHEMA >, EngineGrpcClient< PythonEngineGRPCNRPClient, PythonGrpcConfigConst::EngineSchema >, EngineGrpcClient< GazeboEngineGrpcNRPClient, GazeboGrpcConfigConst::EngineSchema >, EngineJSONNRPClient< ENGINE, SCHEMA >, EngineJSONNRPClient< NestEngineJSONNRPClient, NestConfigConst::EngineSchema >, EngineJSONNRPClient< PySimNRPClient, SCHEMA >, EngineJSONNRPClient< PythonEngineJSONNRPClient, SCHEMA >, and EngineJSONNRPClient< GazeboEngineJSONNRPClient, GazeboJSONConfigConst::EngineSchema >.
|
pure virtual |
Reset engine.
Throws | on error |
Implemented in PythonEngineJSONNRPClientBase< ENGINE, SCHEMA >, PythonEngineGRPCNRPClient, PythonEngineJSONNRPClientBase< PythonEngineJSONNRPClient, PythonConfigConst::EngineSchema >, PythonEngineJSONNRPClientBase< PySimNRPClient, PySimConfigConst::EngineSchema >, NestEngineServerNRPClient, NestEngineJSONNRPClient, GazeboEngineGrpcNRPClient, and GazeboEngineJSONNRPClient.
|
pure virtual |
Starts a single loop step in a separate thread.
The function should be called in tandem with EngineClientInterface::runLoopStepAsyncGet(), which will join the worker thread and retrieve the results of the loop step.
[in] | timeStep | Requested duration of the simulation loop step. |
Implemented in EngineClient< ENGINE, SCHEMA >, EngineClient< PySimNRPClient, SCHEMA >, EngineClient< GazeboEngineGrpcNRPClient, SCHEMA >, EngineClient< NestEngineJSONNRPClient, SCHEMA >, EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >, EngineClient< GazeboEngineJSONNRPClient, SCHEMA >, EngineClient< PythonEngineJSONNRPClient, SCHEMA >, and EngineClient< PythonEngineGRPCNRPClient, SCHEMA >.
|
pure virtual |
Waits and gets the results of the loop step started by EngineClientInterface::runLoopStepAsync()
The function should be called after calling EngineClientInterface::runLoopStepAsync(). It should join the worker thread and retrieve the results of the loop step.
timeOut | Timeout of the loop step. If it's less or equal to 0, the function will wait indefinitely. |
Implemented in EngineClient< ENGINE, SCHEMA >, EngineClient< PySimNRPClient, SCHEMA >, EngineClient< GazeboEngineGrpcNRPClient, SCHEMA >, EngineClient< NestEngineJSONNRPClient, SCHEMA >, EngineClient< NestEngineServerNRPClient, NestServerConfigConst::EngineSchema >, EngineClient< GazeboEngineJSONNRPClient, SCHEMA >, EngineClient< PythonEngineJSONNRPClient, SCHEMA >, and EngineClient< PythonEngineGRPCNRPClient, SCHEMA >.
|
pure virtual |
Sends datapacks to engine.
datapacksArray | Array of datapacks that will be send to the engine |
Throws | on error |
Implemented in NestEngineServerNRPClient, EngineGrpcClient< ENGINE, SCHEMA >, EngineGrpcClient< PythonEngineGRPCNRPClient, PythonGrpcConfigConst::EngineSchema >, EngineGrpcClient< GazeboEngineGrpcNRPClient, GazeboGrpcConfigConst::EngineSchema >, EngineJSONNRPClient< ENGINE, SCHEMA >, EngineJSONNRPClient< NestEngineJSONNRPClient, NestConfigConst::EngineSchema >, EngineJSONNRPClient< PySimNRPClient, SCHEMA >, EngineJSONNRPClient< PythonEngineJSONNRPClient, SCHEMA >, and EngineJSONNRPClient< GazeboEngineJSONNRPClient, GazeboJSONConfigConst::EngineSchema >.
|
pure virtual |
Shutdown engine.
Throws | on error |
Implemented in PythonEngineJSONNRPClientBase< ENGINE, SCHEMA >, PythonEngineJSONNRPClientBase< PythonEngineJSONNRPClient, PythonConfigConst::EngineSchema >, PythonEngineJSONNRPClientBase< PySimNRPClient, PySimConfigConst::EngineSchema >, PythonEngineGRPCNRPClient, NestEngineServerNRPClient, NestEngineJSONNRPClient, GazeboEngineGrpcNRPClient, and GazeboEngineJSONNRPClient.
|
protected |
Process Launcher. Will be used to stop process at end.