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 Attributes

double m_periodInS {0.01}
 
double m_timestamp
 
std::string m_subscriptionName
 
std::string m_rosNodeName
 
std::string m_framename
 
std::string m_sensorName
 
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
 

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:

Parameter name SubParameter Type Units Default Value Required Description Notes
topic_name - string - - Yes The name of the ROS topic opened by this device. MUST start with a '/' character
node_name - string - - Yes The name of the ROS node opened by this device Autogenerated by default
sensor_name - string - - Yes The name of the sensor the data are coming from

Definition at line 45 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 75 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 143 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 86 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 57 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 53 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 58 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 59 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 49 of file GenericSensor_nwc_ros2.h.

◆ m_rosNodeName

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

Definition at line 52 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 56 of file GenericSensor_nwc_ros2.h.

◆ m_sensorName

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

Definition at line 54 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 55 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 60 of file GenericSensor_nwc_ros2.h.

◆ m_subscriptionName

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

Definition at line 51 of file GenericSensor_nwc_ros2.h.

◆ m_timestamp

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

Definition at line 50 of file GenericSensor_nwc_ros2.h.


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