YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
GenericSensor_nwc_ros2< ROS_MSG > Class Template Referenceabstract

This abstract template needs to be specialized in a ROS2 subscription, for a specific ROS2 message/sensor type. More...

#include </home/runner/work/yarp-documentation/yarp-documentation/yarp/opt-modules/yarp-devices-ros2/src/devices/multipleAnalogSensors_nwc_ros2/GenericSensor_nwc_ros2.h>

+ Inheritance diagram for GenericSensor_nwc_ros2< ROS_MSG >:

Public Member Functions

 GenericSensor_nwc_ros2 ()
 
virtual ~GenericSensor_nwc_ros2 ()
 
bool open (yarp::os::Searchable &params) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 

Protected Member Functions

virtual void subscription_callback (const std::shared_ptr< ROS_MSG > msg)=0
 
- Protected Member Functions inherited from GenericSensor_nwc_ros2_ParamsParser
 GenericSensor_nwc_ros2_ParamsParser ()
 
 ~GenericSensor_nwc_ros2_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
- Protected Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Protected Attributes

double m_periodInS {0.01}
 
double m_timestamp
 
std::string m_framename
 
Ros2Spinnerm_spinner {nullptr}
 
const size_t m_sens_index = 0
 
std::mutex m_dataMutex
 
yarp::dev::MAS_status m_internalStatus
 
rclcpp::Node::SharedPtr m_node
 
rclcpp::Subscription< ROS_MSG >::SharedPtr m_subscription
 
- Protected Attributes inherited from GenericSensor_nwc_ros2_ParamsParser
const std::string m_device_classname = {"GenericSensor_nwc_ros2"}
 
const std::string m_device_name = {"genericSensor_nwc_ros2"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_node_name_defaultValue = {""}
 
const std::string m_topic_name_defaultValue = {""}
 
const std::string m_sensor_name_defaultValue = {""}
 
std::string m_node_name = {}
 
std::string m_topic_name = {}
 
std::string m_sensor_name = {}
 

Detailed Description

template<class ROS_MSG>
class GenericSensor_nwc_ros2< ROS_MSG >

This abstract template needs to be specialized in a ROS2 subscription, for a specific ROS2 message/sensor type.

YARP device name
genericSensor_nwc_ros2

The parameters accepted by this device are shown in class: GenericSensor_nwc_ros2_ParamsParser

Definition at line 42 of file GenericSensor_nwc_ros2.h.

Constructor & Destructor Documentation

◆ GenericSensor_nwc_ros2()

template<class ROS_MSG >
GenericSensor_nwc_ros2< ROS_MSG >::GenericSensor_nwc_ros2 ( )

Definition at line 70 of file GenericSensor_nwc_ros2.h.

◆ ~GenericSensor_nwc_ros2()

template<class ROS_MSG >
GenericSensor_nwc_ros2< ROS_MSG >::~GenericSensor_nwc_ros2 ( )
virtualdefault

Member Function Documentation

◆ close()

template<class ROS_MSG >
bool GenericSensor_nwc_ros2< ROS_MSG >::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 121 of file GenericSensor_nwc_ros2.h.

◆ open()

template<class ROS_MSG >
bool GenericSensor_nwc_ros2< ROS_MSG >::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 81 of file GenericSensor_nwc_ros2.h.

◆ subscription_callback()

template<class ROS_MSG >
virtual void GenericSensor_nwc_ros2< ROS_MSG >::subscription_callback ( const std::shared_ptr< ROS_MSG >  msg)
protectedpure virtual

Implemented in Imu_nwc_ros2.

Member Data Documentation

◆ m_dataMutex

template<class ROS_MSG >
std::mutex GenericSensor_nwc_ros2< ROS_MSG >::m_dataMutex
mutableprotected

Definition at line 52 of file GenericSensor_nwc_ros2.h.

◆ m_framename

template<class ROS_MSG >
std::string GenericSensor_nwc_ros2< ROS_MSG >::m_framename
protected

Definition at line 49 of file GenericSensor_nwc_ros2.h.

◆ m_internalStatus

template<class ROS_MSG >
yarp::dev::MAS_status GenericSensor_nwc_ros2< ROS_MSG >::m_internalStatus
protected

Definition at line 53 of file GenericSensor_nwc_ros2.h.

◆ m_node

template<class ROS_MSG >
rclcpp::Node::SharedPtr GenericSensor_nwc_ros2< ROS_MSG >::m_node
protected

Definition at line 54 of file GenericSensor_nwc_ros2.h.

◆ m_periodInS

template<class ROS_MSG >
double GenericSensor_nwc_ros2< ROS_MSG >::m_periodInS {0.01}
protected

Definition at line 47 of file GenericSensor_nwc_ros2.h.

◆ m_sens_index

template<class ROS_MSG >
const size_t GenericSensor_nwc_ros2< ROS_MSG >::m_sens_index = 0
protected

Definition at line 51 of file GenericSensor_nwc_ros2.h.

◆ m_spinner

template<class ROS_MSG >
Ros2Spinner* GenericSensor_nwc_ros2< ROS_MSG >::m_spinner {nullptr}
protected

Definition at line 50 of file GenericSensor_nwc_ros2.h.

◆ m_subscription

template<class ROS_MSG >
rclcpp::Subscription<ROS_MSG>::SharedPtr GenericSensor_nwc_ros2< ROS_MSG >::m_subscription
protected

Definition at line 55 of file GenericSensor_nwc_ros2.h.

◆ m_timestamp

template<class ROS_MSG >
double GenericSensor_nwc_ros2< ROS_MSG >::m_timestamp
protected

Definition at line 48 of file GenericSensor_nwc_ros2.h.


The documentation for this class was generated from the following file: