.. index:: pair: class; NRPGRPCCommunicationController .. _doxid-class_n_r_p_g_r_p_c_communication_controller: class NRPGRPCCommunicationController ==================================== .. toctree:: :hidden: Overview ~~~~~~~~ Manages communication with the NRP. Uses a GRPC server to send/receive data. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class NRPGRPCCommunicationController: public :ref:`EngineGrpcServer` { public: // construction :ref:`NRPGRPCCommunicationController`(const NRPGRPCCommunicationController& other); :ref:`NRPGRPCCommunicationController`(NRPGRPCCommunicationController&& other); // methods NRPGRPCCommunicationController& :ref:`operator =` (const NRPGRPCCommunicationController& other); NRPGRPCCommunicationController&& :ref:`operator =` (NRPGRPCCommunicationController&& other); void :ref:`registerStepController`(:ref:`GazeboStepController`* stepController); void :ref:`registerSensorPlugin`(gazebo::SensorPlugin* sensorPlugin); void :ref:`registerModelPlugin`(gazebo::ModelPlugin* modelPlugin); static NRPGRPCCommunicationController& :ref:`getInstance`(); static NRPGRPCCommunicationController& :ref:`resetInstance`( const std::string& serverURL, const std::string& engineName, const std::string& protobufPluginsPath, const :ref:`nlohmann::json`& protobufPlugins ); static std::string :ref:`createDataPackName`( const std::string& modelName, const std::string& objectName ); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // typedefs typedef std::timed_mutex :ref:`mutex_t`; typedef std::unique_lock<:ref:`EngineGrpcServer::mutex_t`> :ref:`lock_t`; // methods void :ref:`startServer`(); void :ref:`startServerAsync`(); void :ref:`shutdownServer`(); bool :ref:`isServerRunning`() const; const std::string :ref:`serverAddress`() const; void :ref:`registerDataPack`( const std::string& datapackName, :ref:`ProtoDataPackController`* interface ); void :ref:`registerDataPackNoLock`( const std::string& datapackName, :ref:`ProtoDataPackController`* interface ); unsigned :ref:`getNumRegisteredDataPacks`(); const std::string& :ref:`getEngineName`(); .. _details-class_n_r_p_g_r_p_c_communication_controller: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Manages communication with the NRP. Uses a GRPC server to send/receive data. Construction ------------ .. index:: pair: function; NRPGRPCCommunicationController .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1af56cec130eebc15c4df7de19692ed83e: .. ref-code-block:: cpp :class: doxyrest-title-code-block NRPGRPCCommunicationController(const NRPGRPCCommunicationController& other) Delete for singleton. .. index:: pair: function; NRPGRPCCommunicationController .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1ab082ae76aa328f1db0b39d00d40ed06d: .. ref-code-block:: cpp :class: doxyrest-title-code-block NRPGRPCCommunicationController(NRPGRPCCommunicationController&& other) Delete for singleton. Methods ------- .. index:: pair: function; operator= .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1a186305e6d2da291d1e614d9e89b52a8b: .. ref-code-block:: cpp :class: doxyrest-title-code-block NRPGRPCCommunicationController& operator = (const NRPGRPCCommunicationController& other) Delete for singleton. .. index:: pair: function; operator= .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1a0ae7bbcd10f47ad2ceab8d0216e8b3ef: .. ref-code-block:: cpp :class: doxyrest-title-code-block NRPGRPCCommunicationController&& operator = (NRPGRPCCommunicationController&& other) Delete for singleton. .. index:: pair: function; registerStepController .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1a300d82dd0ddeb82496bb5a67b1699c1c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void registerStepController(:ref:`GazeboStepController`* stepController) Register a step controller. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - stepController - Pointer to step controller .. index:: pair: function; registerSensorPlugin .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1a85bed72e2215a3b367e3e20a29eca4ee: .. ref-code-block:: cpp :class: doxyrest-title-code-block void registerSensorPlugin(gazebo::SensorPlugin* sensorPlugin) Register a sensor plugin. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - sensorPlugin - Pointer to sensor plugin .. index:: pair: function; registerModelPlugin .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1aa16e108009049ef0a58817914e49140f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void registerModelPlugin(gazebo::ModelPlugin* modelPlugin) Register a model plugin. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - sensorPlugin - Pointer to model plugin .. index:: pair: function; getInstance .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1a1ad1614a63a4aa343fd8cb6ac43b71fb: .. ref-code-block:: cpp :class: doxyrest-title-code-block static NRPGRPCCommunicationController& getInstance() Get singleton instance. .. rubric:: Returns: Gets instance of :ref:`NRPGRPCCommunicationController ` .. index:: pair: function; resetInstance .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1aae1942b91ccda1505421e972bc3d39d7: .. ref-code-block:: cpp :class: doxyrest-title-code-block static NRPGRPCCommunicationController& resetInstance( const std::string& serverURL, const std::string& engineName, const std::string& protobufPluginsPath, const :ref:`nlohmann::json`& protobufPlugins ) Reset server with the given server URL. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - serverURL - URL used by server * - engineName - Name of this engine .. rubric:: Returns: Returns reference to server instance .. index:: pair: function; createDataPackName .. _doxid-class_n_r_p_g_r_p_c_communication_controller_1a47be20dbecfd8fd0828ffd61d9444ed5: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::string createDataPackName( const std::string& modelName, const std::string& objectName ) Create datapack name from the given plugin and sensor/joint/link. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - modelName - Name of the parent model of the controlled object * - objectName - Name of the controlled object (sensor, joint, link, ...) .. rubric:: Returns: Returns datapack name