Public Member Functions | Private Types | Private Attributes | List of all members
rtt_roscomm::RosSubChannelElement< T > Class Template Reference

#include <rtt_rostopic_ros_msg_transporter.hpp>

Inheritance diagram for rtt_roscomm::RosSubChannelElement< T >:
Inheritance graph
[legend]

Public Member Functions

virtual std::string getElementName () const
 
virtual std::string getRemoteURI () const
 
virtual bool inputReady ()
 
virtual bool isRemoteElement () const
 
void newData (const RosType &msg)
 
 RosSubChannelElement (RTT::base::PortInterface *port, const RTT::ConnPolicy &policy)
 
 ~RosSubChannelElement ()
 
- Public Member Functions inherited from RTT::base::ChannelElement< T >
virtual WriteStatus data_sample (param_t sample, bool reset=true)
 
virtual value_t data_sample ()
 
shared_ptr getInput ()
 
shared_ptr getOutput ()
 
virtual FlowStatus read (reference_t sample, bool copy_old_data=true)
 
virtual WriteStatus write (param_t sample)
 
- Public Member Functions inherited from RTT::base::ChannelElementBase
 ChannelElementBase ()
 
virtual bool channelReady (ChannelElementBase::shared_ptr const &caller, ConnPolicy const &policy, internal::ConnID *conn_id=0)
 
virtual void clear ()
 
virtual bool connected ()
 
virtual bool connectFrom (ChannelElementBase::shared_ptr const &input)
 
virtual bool connectTo (ChannelElementBase::shared_ptr const &output, bool mandatory=true)
 
virtual bool disconnect (ChannelElementBase::shared_ptr const &channel, bool forward)
 
virtual void disconnect (bool forward)
 
virtual const ConnPolicygetConnPolicy () const
 
shared_ptr getInput ()
 
virtual shared_ptr getInputEndPoint ()
 
virtual std::string getLocalURI () const
 
shared_ptr getOutput ()
 
virtual shared_ptr getOutputEndPoint ()
 
virtual PortInterfacegetPort () const
 
virtual bool inputReady (ChannelElementBase::shared_ptr const &caller)
 
ChannelElement< T > * narrow ()
 
RTT_DEPRECATED void setInput (const ChannelElementBase::shared_ptr &input)
 
RTT_DEPRECATED void setOutput (const ChannelElementBase::shared_ptr &output)
 
virtual bool signal ()
 
virtual bool signalFrom (ChannelElementBase *)
 
virtual ~ChannelElementBase ()
 

Private Types

typedef RosMessageAdapter< T > adapter
 
typedef adapter::RosType RosType
 

Private Attributes

ros::NodeHandle ros_node
 
ros::NodeHandle ros_node_private
 
ros::Subscriber ros_sub
 
std::string topicname
 

Additional Inherited Members

- Public Types inherited from RTT::base::ChannelElement< T >
typedef boost::call_traits< T >::param_type param_t
 
typedef boost::call_traits< T >::reference reference_t
 
typedef boost::intrusive_ptr< ChannelElement< T > > shared_ptr
 
typedef T value_t
 
- Public Types inherited from RTT::base::ChannelElementBase
typedef boost::intrusive_ptr< ChannelElementBaseshared_ptr
 
- Static Public Member Functions inherited from RTT::base::ChannelElementBase
static ChannelElement< T > * narrow (ChannelElementBase *e)
 
- Protected Member Functions inherited from RTT::base::ChannelElementBase
virtual bool addInput (shared_ptr const &input)
 
virtual bool addOutput (shared_ptr const &output, bool mandatory=true)
 
void deref ()
 
void ref ()
 
virtual void removeInput (shared_ptr const &input)
 
virtual void removeOutput (shared_ptr const &output)
 
- Protected Attributes inherited from RTT::base::ChannelElementBase
shared_ptr input
 
RTT::os::SharedMutex input_lock
 
shared_ptr output
 
RTT::os::SharedMutex output_lock
 

Detailed Description

template<typename T>
class rtt_roscomm::RosSubChannelElement< T >

A ChannelElement implementation to subscribe to data over a ros topic

Definition at line 216 of file rtt_rostopic_ros_msg_transporter.hpp.

Member Typedef Documentation

template<typename T>
typedef RosMessageAdapter<T> rtt_roscomm::RosSubChannelElement< T >::adapter
private

Definition at line 218 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
typedef adapter::RosType rtt_roscomm::RosSubChannelElement< T >::RosType
private

Definition at line 219 of file rtt_rostopic_ros_msg_transporter.hpp.

Constructor & Destructor Documentation

template<typename T>
rtt_roscomm::RosSubChannelElement< T >::RosSubChannelElement ( RTT::base::PortInterface port,
const RTT::ConnPolicy policy 
)
inline

Contructor of to create ROS subscriber ChannelElement, it will subscribe to a topic with the name given by the policy.name_id

Parameters
portport for which we will create a the ROS publisher
policyconnection policy containing the topic name and buffer size
Returns
ChannelElement that will publish data to topics

Definition at line 236 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
rtt_roscomm::RosSubChannelElement< T >::~RosSubChannelElement ( )
inline

Definition at line 254 of file rtt_rostopic_ros_msg_transporter.hpp.

Member Function Documentation

template<typename T>
virtual std::string rtt_roscomm::RosSubChannelElement< T >::getElementName ( ) const
inlinevirtual

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 267 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
virtual std::string rtt_roscomm::RosSubChannelElement< T >::getRemoteURI ( ) const
inlinevirtual

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 271 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
virtual bool rtt_roscomm::RosSubChannelElement< T >::inputReady ( )
inlinevirtual

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 259 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
virtual bool rtt_roscomm::RosSubChannelElement< T >::isRemoteElement ( ) const
inlinevirtual

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 263 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
void rtt_roscomm::RosSubChannelElement< T >::newData ( const RosType msg)
inline

Callback function for the ROS subscriber, it will trigger the ChannelElement's signal function

Parameters
msgThe received message

Definition at line 280 of file rtt_rostopic_ros_msg_transporter.hpp.

Member Data Documentation

template<typename T>
ros::NodeHandle rtt_roscomm::RosSubChannelElement< T >::ros_node
private

Definition at line 222 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
ros::NodeHandle rtt_roscomm::RosSubChannelElement< T >::ros_node_private
private

Definition at line 223 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
ros::Subscriber rtt_roscomm::RosSubChannelElement< T >::ros_sub
private

Definition at line 224 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
std::string rtt_roscomm::RosSubChannelElement< T >::topicname
private

Definition at line 221 of file rtt_rostopic_ros_msg_transporter.hpp.


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


rtt_roscomm
Author(s): Ruben Smits, Jonathan Bohren
autogenerated on Mon May 10 2021 02:45:04