.. index:: pair: class; EngineJSONNRPClient .. _doxid-class_engine_j_s_o_n_n_r_p_client: template class EngineJSONNRPClient ================================== .. toctree:: :hidden: Overview ~~~~~~~~ NRP - Gazebo Communicator on the NRP side. Converts :ref:`DataPackInterface ` classes from/to JSON objects. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template class EngineJSONNRPClient: public :ref:`EngineClient` { public: // construction :ref:`EngineJSONNRPClient`( :ref:`nlohmann::json`& config, :ref:`ProcessLauncherInterface::unique_ptr`&& launcher ); :ref:`EngineJSONNRPClient`( const std::string& serverAddress, :ref:`nlohmann::json`& config, :ref:`ProcessLauncherInterface::unique_ptr`&& launcher ); // methods virtual pid_t :ref:`launchEngine`(); virtual void :ref:`sendDataPacksToEngine`(const :ref:`datapacks_set_t`& dataPacks); virtual const std::vector :ref:`engineProcStartParams`() const; virtual :ref:`datapacks_vector_t` :ref:`getDataPacksFromEngine`(const :ref:`datapack_identifiers_set_t`& datapackIdentifiers); }; // direct descendants template class :ref:`PythonEngineJSONNRPClientBase`; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // typedefs typedef std::shared_ptr :ref:`shared_ptr`; typedef std::shared_ptr :ref:`const_shared_ptr`; typedef std::unique_ptr :ref:`unique_ptr`; typedef std::unique_ptr :ref:`const_unique_ptr`; typedef ENGINE :ref:`engine_t`; // classes template class :ref:`EngineLauncher`; // methods virtual const std::string :ref:`engineName`() const = 0; virtual const :ref:`nlohmann::json`& :ref:`engineConfig`() const = 0; virtual :ref:`nlohmann::json`& :ref:`engineConfig`() = 0; virtual const std::vector :ref:`engineProcStartParams`() const = 0; virtual pid_t :ref:`launchEngine`(); virtual void :ref:`initialize`() = 0; virtual void :ref:`reset`() = 0; virtual void :ref:`shutdown`() = 0; virtual :ref:`SimulationTime` :ref:`getEngineTimestep`() const = 0; virtual :ref:`SimulationTime` :ref:`getEngineTime`() const = 0; virtual const std::string :ref:`engineSchema`() const = 0; virtual void :ref:`runLoopStepAsync`(:ref:`SimulationTime` timeStep) = 0; virtual void :ref:`runLoopStepAsyncGet`(:ref:`SimulationTime` timeOut) = 0; virtual void :ref:`sendDataPacksToEngine`(const :ref:`datapacks_set_t`& dataPacks) = 0; virtual :ref:`datapacks_vector_t` :ref:`getDataPacksFromEngine`(const :ref:`datapack_identifiers_set_t`& datapackIdentifiers) = 0; virtual const std::string :ref:`engineName`() const; virtual :ref:`SimulationTime` :ref:`getEngineTimestep`() const; virtual const :ref:`nlohmann::json`& :ref:`engineConfig`() const; virtual :ref:`nlohmann::json`& :ref:`engineConfig`(); virtual const std::string :ref:`engineSchema`() const; virtual :ref:`SimulationTime` :ref:`getEngineTime`() const; virtual void :ref:`runLoopStepAsync`(:ref:`SimulationTime` timeStep); virtual void :ref:`runLoopStepAsyncGet`(:ref:`SimulationTime` timeOut); .. _details-class_engine_j_s_o_n_n_r_p_client: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ NRP - Gazebo Communicator on the NRP side. Converts :ref:`DataPackInterface ` classes from/to JSON objects. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ENGINE_INTERFACE - Class derived from GeneralInterface. Currently either PhysicsInterface or BrainInterface Construction ------------ .. index:: pair: function; EngineJSONNRPClient .. _doxid-class_engine_j_s_o_n_n_r_p_client_1aad4f4671aebfc4e464bc2e67c07f4ff4: .. ref-code-block:: cpp :class: doxyrest-title-code-block EngineJSONNRPClient( :ref:`nlohmann::json`& config, :ref:`ProcessLauncherInterface::unique_ptr`&& launcher ) Constructor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - config - Engine Config * - launcher - Process launcher .. index:: pair: function; EngineJSONNRPClient .. _doxid-class_engine_j_s_o_n_n_r_p_client_1a793895ec1eb4e4202917d045150429f1: .. ref-code-block:: cpp :class: doxyrest-title-code-block EngineJSONNRPClient( const std::string& serverAddress, :ref:`nlohmann::json`& config, :ref:`ProcessLauncherInterface::unique_ptr`&& launcher ) Constructor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - serverAddress - Server Address to send requests to * - config - Engine Config * - launcher - Process launcher Methods ------- .. index:: pair: function; launchEngine .. _doxid-class_engine_j_s_o_n_n_r_p_client_1a3c4dc2c99e6e1c488cd31a99a9cec44e: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual pid_t launchEngine() Launch the engine. .. rubric:: Returns: Returns engine process ID on success, throws on failure .. index:: pair: function; sendDataPacksToEngine .. _doxid-class_engine_j_s_o_n_n_r_p_client_1abdd0cff14bf392654fc56651e29a5553: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void sendDataPacksToEngine(const :ref:`datapacks_set_t`& dataPacks) Sends datapacks to engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - datapacksArray - Array of datapacks that will be send to the engine * - Throws - on error .. rubric:: Returns: Returns SUCCESS if all datapacks could be handles, ERROR otherwise .. index:: pair: function; engineProcStartParams .. _doxid-class_engine_j_s_o_n_n_r_p_client_1a81048fdcb2719ef3e74e67ba42142ca4: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const std::vector engineProcStartParams() const Get all Engine Process Startup parameters. .. index:: pair: function; getDataPacksFromEngine .. _doxid-class_engine_j_s_o_n_n_r_p_client_1a22cec43a25513e7850d17178c76edd46: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`datapacks_vector_t` getDataPacksFromEngine(const :ref:`datapack_identifiers_set_t`& datapackIdentifiers) Gets requested datapacks from engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - datapackNames - All requested datapack ids * - Throws - on error .. rubric:: Returns: Returns all requested datapacks