Implement callbacks for liveliness and deadline QoS events (#695)

* implement deadline and liveliness qos callbacks

Signed-off-by: Miaofei <miaofei@amazon.com>

* fix windows build

Signed-off-by: Miaofei <miaofei@amazon.com>

* address feedback from pull request

Signed-off-by: Miaofei <miaofei@amazon.com>

* update formatting to be compatible with ros2 coding style and ament_uncrustify

Signed-off-by: Miaofei <miaofei@amazon.com>

* make QOSEventHandlerBase::add_to_wait_set() throw

Signed-off-by: Miaofei <miaofei@amazon.com>

* mark throw_from_rcl_error as [[noreturn]]

Signed-off-by: Miaofei <miaofei@amazon.com>

* fix windows compilation error

Signed-off-by: Miaofei <miaofei@amazon.com>

* Ignore uncrustify for single [[noreturn]] syntax instance

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
This commit is contained in:
M. M 2019-05-03 10:16:39 -07:00 committed by William Woodall
parent ecf35114b6
commit d399fef9c6
37 changed files with 446 additions and 28 deletions

View file

@ -23,10 +23,12 @@
#include "rclcpp/contexts/default_context.hpp"
#include "rclcpp/intra_process_manager.hpp"
#include "rclcpp/event.hpp"
#include "rclcpp/parameter.hpp"
#include "rclcpp/create_publisher.hpp"
#include "rclcpp/create_service.hpp"
#include "rclcpp/create_subscription.hpp"
#include "rclcpp/subscription_options.hpp"
#include "rclcpp/type_support_decl.hpp"
#include "lifecycle_publisher.hpp"
@ -65,6 +67,8 @@ LifecycleNode::create_publisher(
this->node_topics_.get(),
topic_name,
qos_profile,
rclcpp::PublisherEventCallbacks(),
nullptr,
use_intra_process_comms_,
allocator);
}
@ -99,6 +103,7 @@ LifecycleNode::create_subscription(
topic_name,
std::forward<CallbackT>(callback),
qos_profile,
rclcpp::SubscriptionEventCallbacks(),
group,
ignore_local_publications,
use_intra_process_comms_,
@ -128,6 +133,7 @@ LifecycleNode::create_subscription(
topic_name,
std::forward<CallbackT>(callback),
qos,
rclcpp::SubscriptionEventCallbacks(),
group,
ignore_local_publications,
msg_mem_strat,

View file

@ -61,9 +61,10 @@ public:
rclcpp::node_interfaces::NodeBaseInterface * node_base,
const std::string & topic,
const rcl_publisher_options_t & publisher_options,
const rclcpp::PublisherEventCallbacks event_callbacks,
std::shared_ptr<MessageAlloc> allocator)
: rclcpp::Publisher<MessageT, Alloc>(
node_base, topic, publisher_options, allocator),
node_base, topic, publisher_options, event_callbacks, allocator),
enabled_(false),
logger_(rclcpp::get_logger("LifecyclePublisher"))
{