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

#include <rtt_rostopic_ros_msg_transporter.hpp>

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

Public Member Functions

virtual bool data_sample (typename RTT::base::ChannelElement< T >::param_t sample)
 
virtual std::string getElementName () const
 
virtual std::string getRemoteURI () const
 
virtual bool inputReady ()
 
virtual bool isRemoteElement () const
 
void publish ()
 
 RosPubChannelElement (RTT::base::PortInterface *port, const RTT::ConnPolicy &policy)
 
bool signal ()
 
bool write (typename RTT::base::ChannelElement< T >::param_t sample)
 
 ~RosPubChannelElement ()
 
- 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 signalFrom (ChannelElementBase *)
 
virtual ~ChannelElementBase ()
 

Private Types

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

Private Attributes

RosPublishActivity::shared_ptr act
 We must cache the RosPublishActivity object. More...
 
char hostname [1024]
 
ros::NodeHandle ros_node
 
ros::NodeHandle ros_node_private
 
ros::Publisher ros_pub
 
RTT::base::ChannelElement< T >::value_t sample
 
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::RosPubChannelElement< T >

A ChannelElement implementation to publish data over a ros topic

Definition at line 87 of file rtt_rostopic_ros_msg_transporter.hpp.

Member Typedef Documentation

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

Definition at line 89 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Definition at line 90 of file rtt_rostopic_ros_msg_transporter.hpp.

Constructor & Destructor Documentation

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

Contructor of to create ROS publisher ChannelElement, it will create a topic from the name given by the policy.name_id, if this is empty a default is created as hostname/componentname/portname/pid

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 114 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Definition at line 149 of file rtt_rostopic_ros_msg_transporter.hpp.

Member Function Documentation

template<typename T>
virtual bool rtt_roscomm::RosPubChannelElement< T >::data_sample ( typename RTT::base::ChannelElement< T >::param_t  sample)
inlinevirtual

Create a data sample, this could be used to allocate the necessary memory

Parameters
sample
Returns
always true/WriteSuccess

Definition at line 190 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 168 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 172 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Function to see if the ChannelElement is ready to receive inputs

Returns
always true in our case

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 160 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 164 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
void rtt_roscomm::RosPubChannelElement< T >::publish ( )
inlinevirtual

Publish all data in the channel to a ROS topic.

Implements rtt_roscomm::RosPublisher.

Definition at line 208 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
bool rtt_roscomm::RosPubChannelElement< T >::signal ( )
inlinevirtual

signal from the port that new data is availabe to publish

Returns
true if publishing succeeded

Reimplemented from RTT::base::ChannelElementBase.

Definition at line 202 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
bool rtt_roscomm::RosPubChannelElement< T >::write ( typename RTT::base::ChannelElement< T >::param_t  sample)
inline

Definition at line 218 of file rtt_rostopic_ros_msg_transporter.hpp.

Member Data Documentation

template<typename T>
RosPublishActivity::shared_ptr rtt_roscomm::RosPubChannelElement< T >::act
private

We must cache the RosPublishActivity object.

Definition at line 98 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
char rtt_roscomm::RosPubChannelElement< T >::hostname[1024]
private

Definition at line 92 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Definition at line 94 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Definition at line 95 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
ros::Publisher rtt_roscomm::RosPubChannelElement< T >::ros_pub
private

Definition at line 96 of file rtt_rostopic_ros_msg_transporter.hpp.

template<typename T>
RTT::base::ChannelElement<T>::value_t rtt_roscomm::RosPubChannelElement< T >::sample
private

Definition at line 100 of file rtt_rostopic_ros_msg_transporter.hpp.

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

Definition at line 93 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 Thu Jan 16 2020 03:47:11