change API to encourage users to specify history depth always (#713)
* improve interoperability with rclcpp::Duration and std::chrono Signed-off-by: William Woodall <william@osrfoundation.org> * add to_rmw_time to Duration Signed-off-by: William Woodall <william@osrfoundation.org> * add new QoS class to rclcpp Signed-off-by: William Woodall <william@osrfoundation.org> * changes to NodeBase, NodeTopics, etc in preparation for changes to pub/sub Signed-off-by: William Woodall <william@osrfoundation.org> * refactor publisher creation to use new QoS class Signed-off-by: William Woodall <william@osrfoundation.org> * refactor subscription creation to use new QoS class Signed-off-by: William Woodall <william@osrfoundation.org> * fixing fallout from changes to pub/sub creation Signed-off-by: William Woodall <william@osrfoundation.org> * fixed Windows error: no appropriate default constructor available why? who knows Signed-off-by: William Woodall <william@osrfoundation.org> * fixed Windows error: could not deduce template argument for 'PublisherT' Signed-off-by: William Woodall <william@osrfoundation.org> * fix missing vftable linker error on Windows Signed-off-by: William Woodall <william@osrfoundation.org> * fix more cases of no suitable default constructor errors... Signed-off-by: William Woodall <william@osrfoundation.org> * prevent msvc from trying to interpret some cases as functions Signed-off-by: William Woodall <william@osrfoundation.org> * uncrustify Signed-off-by: William Woodall <william@osrfoundation.org> * cpplint Signed-off-by: William Woodall <william@osrfoundation.org> * add C++ version of default action qos Signed-off-by: William Woodall <william@osrfoundation.org> * fixing lifecycle subscription signatures Signed-off-by: William Woodall <william@osrfoundation.org> * fix allocators (we actually use this already in the pub/sub factory) Signed-off-by: William Woodall <william@osrfoundation.org> * suppress cppcheck on false positive syntax error Signed-off-by: William Woodall <william@osrfoundation.org> * fix more cppcheck syntax error false positives Signed-off-by: William Woodall <william@osrfoundation.org> * fix case where sub-type of QoS is used Signed-off-by: William Woodall <william@osrfoundation.org> * fixup get_node_topics_interface.hpp according to reviews and tests Signed-off-by: William Woodall <william@osrfoundation.org> * additional fixes based on local testing and CI Signed-off-by: William Woodall <william@osrfoundation.org> * another trick to avoid 'no appropriate default constructor available' Signed-off-by: William Woodall <william@osrfoundation.org> * fix compiler error with clang on macOS Signed-off-by: William Woodall <william@osrfoundation.org> * disable build failure tests until we can get Jenkins to ignore their output Signed-off-by: William Woodall <william@osrfoundation.org> * suppress more cppcheck false positives Signed-off-by: William Woodall <william@osrfoundation.org> * add missing visibility macros to default QoS profile classes Signed-off-by: William Woodall <william@osrfoundation.org> * fix another case of 'no appropriate default constructor available' Signed-off-by: William Woodall <william@osrfoundation.org> * unfortunately this actaully fixes a build error on Windows... Signed-off-by: William Woodall <william@osrfoundation.org> * fix typos Signed-off-by: William Woodall <william@osrfoundation.org>
This commit is contained in:
parent
385cccc2cc
commit
c769b1b030
53 changed files with 1908 additions and 454 deletions
|
@ -20,6 +20,7 @@ include_directories(include)
|
|||
|
||||
set(${PROJECT_NAME}_SRCS
|
||||
src/client.cpp
|
||||
src/qos.cpp
|
||||
src/server.cpp
|
||||
src/server_goal_handle.cpp
|
||||
src/types.cpp
|
||||
|
|
34
rclcpp_action/include/rclcpp_action/qos.hpp
Normal file
34
rclcpp_action/include/rclcpp_action/qos.hpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Copyright 2019 Open Source Robotics Foundation, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef RCLCPP_ACTION__QOS_HPP_
|
||||
#define RCLCPP_ACTION__QOS_HPP_
|
||||
|
||||
#include <rclcpp/qos.hpp>
|
||||
|
||||
#include "rclcpp_action/visibility_control.hpp"
|
||||
|
||||
namespace rclcpp_action
|
||||
{
|
||||
|
||||
class DefaultActionStatusQoS : public rclcpp::QoS
|
||||
{
|
||||
public:
|
||||
RCLCPP_ACTION_PUBLIC
|
||||
DefaultActionStatusQoS();
|
||||
};
|
||||
|
||||
} // namespace rclcpp_action
|
||||
|
||||
#endif // RCLCPP_ACTION__QOS_HPP_
|
28
rclcpp_action/src/qos.cpp
Normal file
28
rclcpp_action/src/qos.cpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2019 Open Source Robotics Foundation, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <rclcpp_action/qos.hpp>
|
||||
|
||||
#include <rcl_action/default_qos.h>
|
||||
|
||||
namespace rclcpp_action
|
||||
{
|
||||
|
||||
DefaultActionStatusQoS::DefaultActionStatusQoS()
|
||||
: rclcpp::QoS(rclcpp::QoSInitialization::from_rmw(rcl_action_qos_profile_status_default))
|
||||
{
|
||||
this->get_rmw_qos_profile() = rcl_action_qos_profile_status_default;
|
||||
}
|
||||
|
||||
} // namespace rclcpp_action
|
|
@ -42,6 +42,7 @@
|
|||
#include "rclcpp_action/exceptions.hpp"
|
||||
#include "rclcpp_action/create_client.hpp"
|
||||
#include "rclcpp_action/client.hpp"
|
||||
#include "rclcpp_action/qos.hpp"
|
||||
#include "rclcpp_action/types.hpp"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
@ -196,7 +197,8 @@ protected:
|
|||
ret = rcl_action_get_feedback_topic_name(
|
||||
action_name, allocator, &feedback_topic_name);
|
||||
ASSERT_EQ(RCL_RET_OK, ret);
|
||||
feedback_publisher = server_node->create_publisher<ActionFeedbackMessage>(feedback_topic_name);
|
||||
feedback_publisher =
|
||||
server_node->create_publisher<ActionFeedbackMessage>(feedback_topic_name, 10);
|
||||
ASSERT_TRUE(feedback_publisher != nullptr);
|
||||
allocator.deallocate(feedback_topic_name, allocator.state);
|
||||
|
||||
|
@ -205,7 +207,7 @@ protected:
|
|||
action_name, allocator, &status_topic_name);
|
||||
ASSERT_EQ(RCL_RET_OK, ret);
|
||||
status_publisher = server_node->create_publisher<ActionStatusMessage>(
|
||||
status_topic_name, rcl_action_qos_profile_status_default);
|
||||
status_topic_name, rclcpp_action::DefaultActionStatusQoS());
|
||||
ASSERT_TRUE(status_publisher != nullptr);
|
||||
allocator.deallocate(status_topic_name, allocator.state);
|
||||
server_executor.add_node(server_node);
|
||||
|
|
|
@ -367,7 +367,8 @@ TEST_F(TestServer, publish_status_accepted)
|
|||
// Subscribe to status messages
|
||||
std::vector<action_msgs::msg::GoalStatusArray::SharedPtr> received_msgs;
|
||||
auto subscriber = node->create_subscription<action_msgs::msg::GoalStatusArray>(
|
||||
"fibonacci/_action/status", [&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
"fibonacci/_action/status", 10,
|
||||
[&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
{
|
||||
received_msgs.push_back(list);
|
||||
});
|
||||
|
@ -428,7 +429,8 @@ TEST_F(TestServer, publish_status_canceling)
|
|||
// Subscribe to status messages
|
||||
std::vector<action_msgs::msg::GoalStatusArray::SharedPtr> received_msgs;
|
||||
auto subscriber = node->create_subscription<action_msgs::msg::GoalStatusArray>(
|
||||
"fibonacci/_action/status", [&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
"fibonacci/_action/status", 10,
|
||||
[&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
{
|
||||
received_msgs.push_back(list);
|
||||
});
|
||||
|
@ -483,7 +485,8 @@ TEST_F(TestServer, publish_status_canceled)
|
|||
// Subscribe to status messages
|
||||
std::vector<action_msgs::msg::GoalStatusArray::SharedPtr> received_msgs;
|
||||
auto subscriber = node->create_subscription<action_msgs::msg::GoalStatusArray>(
|
||||
"fibonacci/_action/status", [&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
"fibonacci/_action/status", 10,
|
||||
[&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
{
|
||||
received_msgs.push_back(list);
|
||||
});
|
||||
|
@ -540,7 +543,8 @@ TEST_F(TestServer, publish_status_succeeded)
|
|||
// Subscribe to status messages
|
||||
std::vector<action_msgs::msg::GoalStatusArray::SharedPtr> received_msgs;
|
||||
auto subscriber = node->create_subscription<action_msgs::msg::GoalStatusArray>(
|
||||
"fibonacci/_action/status", [&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
"fibonacci/_action/status", 10,
|
||||
[&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
{
|
||||
received_msgs.push_back(list);
|
||||
});
|
||||
|
@ -595,7 +599,8 @@ TEST_F(TestServer, publish_status_aborted)
|
|||
// Subscribe to status messages
|
||||
std::vector<action_msgs::msg::GoalStatusArray::SharedPtr> received_msgs;
|
||||
auto subscriber = node->create_subscription<action_msgs::msg::GoalStatusArray>(
|
||||
"fibonacci/_action/status", [&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
"fibonacci/_action/status", 10,
|
||||
[&received_msgs](action_msgs::msg::GoalStatusArray::SharedPtr list)
|
||||
{
|
||||
received_msgs.push_back(list);
|
||||
});
|
||||
|
@ -651,7 +656,7 @@ TEST_F(TestServer, publish_feedback)
|
|||
using FeedbackT = Fibonacci::Impl::FeedbackMessage;
|
||||
std::vector<FeedbackT::SharedPtr> received_msgs;
|
||||
auto subscriber = node->create_subscription<FeedbackT>(
|
||||
"fibonacci/_action/feedback", [&received_msgs](FeedbackT::SharedPtr msg)
|
||||
"fibonacci/_action/feedback", 10, [&received_msgs](FeedbackT::SharedPtr msg)
|
||||
{
|
||||
received_msgs.push_back(msg);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue