AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
RosPublisherNode< MessageT > Class Template Reference

#include <auto_apms_behavior_tree/node/ros_publisher_node.hpp>

Inheritance diagram for RosPublisherNode< MessageT >:

Public Types

using MessageType = MessageT
 
using Config = BT::NodeConfig
 
using Context = RosNodeContext
 

Public Member Functions

 RosPublisherNode (const std::string &instance_name, const Config &config, const Context &context, const rclcpp::QoS &qos={ 10 })
 
virtual ~RosPublisherNode ()=default
 
BT::NodeStatus tick () override final
 
virtual bool setMessage (MessageT &msg)
 
std::string getFullName () const
 

Static Public Member Functions

static BT::PortsList providedBasicPorts (BT::PortsList addition)
 
static BT::PortsList providedPorts ()
 

Protected Member Functions

const ContextgetRosContext ()
 

Protected Attributes

const rclcpp::Logger logger_
 

Detailed Description

template<class MessageT>
class auto_apms_behavior_tree::RosPublisherNode< MessageT >

Abstract class to wrap a ROS publisher.

Definition at line 33 of file ros_publisher_node.hpp.

Member Typedef Documentation

◆ MessageType

template<class MessageT >
using MessageType = MessageT

Definition at line 38 of file ros_publisher_node.hpp.

◆ Config

template<class MessageT >
using Config = BT::NodeConfig

Definition at line 39 of file ros_publisher_node.hpp.

◆ Context

template<class MessageT >
using Context = RosNodeContext

Definition at line 40 of file ros_publisher_node.hpp.

Constructor & Destructor Documentation

◆ RosPublisherNode()

template<class MessageT >
RosPublisherNode ( const std::string & instance_name,
const Config & config,
const Context & context,
const rclcpp::QoS & qos = { 10 } )
inlineexplicit

Definition at line 104 of file ros_publisher_node.hpp.

◆ ~RosPublisherNode()

template<class MessageT >
virtual ~RosPublisherNode ( )
virtualdefault

Member Function Documentation

◆ providedBasicPorts()

template<class MessageT >
static BT::PortsList providedBasicPorts ( BT::PortsList addition)
inlinestatic

Any subclass of RosPublisherNode that has additinal ports must provide a providedPorts method and call providedBasicPorts in it.

Parameters
additionAdditional ports to add to BT port list
Returns
BT::PortsList Containing basic ports along with node-specific ports

Definition at line 54 of file ros_publisher_node.hpp.

◆ providedPorts()

template<class MessageT >
static BT::PortsList providedPorts ( )
inlinestatic

Creates list of BT ports.

Returns
BT::PortsList Containing basic ports along with node-specific ports

Definition at line 65 of file ros_publisher_node.hpp.

◆ tick()

template<class MessageT >
BT::NodeStatus tick ( )
inlinefinaloverride

Definition at line 155 of file ros_publisher_node.hpp.

◆ setMessage()

template<class MessageT >
bool setMessage ( MessageT & msg)
inlinevirtual

setMessage is a callback invoked in tick to allow the user to pass the message to be published.

Parameters
msgthe message.
Returns
return false if anything is wrong and we must not send the message. the Condition will return FAILURE.

Definition at line 187 of file ros_publisher_node.hpp.

◆ getFullName()

template<class MessageT >
std::string getFullName ( ) const
inline

Definition at line 193 of file ros_publisher_node.hpp.

◆ getRosContext()

template<class MessageT >
const RosPublisherNode< MessageT >::Context & getRosContext ( )
inlineprotected

Definition at line 205 of file ros_publisher_node.hpp.

Member Data Documentation

◆ logger_

template<class MessageT >
const rclcpp::Logger logger_
protected

Definition at line 87 of file ros_publisher_node.hpp.


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