Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
491475f232 | ||
|
|
b8b64b4c08 | ||
|
|
ee67c211c5 | ||
|
|
82ddd44140 | ||
|
|
a1980678ae |
@@ -2,6 +2,17 @@
|
||||
Changelog for package rclcpp
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
16.2.0 (2022-05-03)
|
||||
-------------------
|
||||
* Update get_parameter_from_event to follow the function description (`#1922 <https://github.com/ros2/rclcpp/issues/1922>`_)
|
||||
* Add 'best available' QoS enum values and methods (`#1920 <https://github.com/ros2/rclcpp/issues/1920>`_)
|
||||
* Contributors: Barry Xu, Jacob Perron
|
||||
|
||||
16.1.0 (2022-04-29)
|
||||
-------------------
|
||||
* use reinterpret_cast for function pointer conversion. (`#1919 <https://github.com/ros2/rclcpp/issues/1919>`_)
|
||||
* Contributors: Tomoya Fujita
|
||||
|
||||
16.0.1 (2022-04-13)
|
||||
-------------------
|
||||
* remove DEFINE_CONTENT_FILTER cmake option (`#1914 <https://github.com/ros2/rclcpp/issues/1914>`_)
|
||||
|
||||
@@ -268,6 +268,7 @@ public:
|
||||
* \param[in] parameter_name Name of parameter.
|
||||
* \param[in] node_name Name of node which hosts the parameter.
|
||||
* \returns The resultant rclcpp::Parameter from the event.
|
||||
* \throws std::runtime_error if input node name doesn't match the node name in parameter event.
|
||||
*/
|
||||
RCLCPP_PUBLIC
|
||||
static rclcpp::Parameter
|
||||
|
||||
@@ -44,6 +44,7 @@ enum class ReliabilityPolicy
|
||||
BestEffort = RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT,
|
||||
Reliable = RMW_QOS_POLICY_RELIABILITY_RELIABLE,
|
||||
SystemDefault = RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT,
|
||||
BestAvailable = RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE,
|
||||
Unknown = RMW_QOS_POLICY_RELIABILITY_UNKNOWN,
|
||||
};
|
||||
|
||||
@@ -52,6 +53,7 @@ enum class DurabilityPolicy
|
||||
Volatile = RMW_QOS_POLICY_DURABILITY_VOLATILE,
|
||||
TransientLocal = RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL,
|
||||
SystemDefault = RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT,
|
||||
BestAvailable = RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE,
|
||||
Unknown = RMW_QOS_POLICY_DURABILITY_UNKNOWN,
|
||||
};
|
||||
|
||||
@@ -60,6 +62,7 @@ enum class LivelinessPolicy
|
||||
Automatic = RMW_QOS_POLICY_LIVELINESS_AUTOMATIC,
|
||||
ManualByTopic = RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC,
|
||||
SystemDefault = RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT,
|
||||
BestAvailable = RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE,
|
||||
Unknown = RMW_QOS_POLICY_LIVELINESS_UNKNOWN,
|
||||
};
|
||||
|
||||
@@ -180,6 +183,10 @@ public:
|
||||
QoS &
|
||||
best_effort();
|
||||
|
||||
/// Set the reliability setting to best available.
|
||||
QoS &
|
||||
reliability_best_available();
|
||||
|
||||
/// Set the durability setting.
|
||||
QoS &
|
||||
durability(rmw_qos_durability_policy_t durability);
|
||||
@@ -199,6 +206,10 @@ public:
|
||||
QoS &
|
||||
transient_local();
|
||||
|
||||
/// Set the durability setting to best available.
|
||||
QoS &
|
||||
durability_best_available();
|
||||
|
||||
/// Set the deadline setting.
|
||||
QoS &
|
||||
deadline(rmw_time_t deadline);
|
||||
@@ -488,6 +499,36 @@ public:
|
||||
));
|
||||
};
|
||||
|
||||
/**
|
||||
* Best available QoS class
|
||||
*
|
||||
* Match majority of endpoints currently available while maintaining the highest level of service.
|
||||
* Policies are chosen at the time of creating a subscription or publisher.
|
||||
* The middleware is not expected to update policies after creating a subscription or publisher,
|
||||
* even if one or more policies are incompatible with newly discovered endpoints.
|
||||
* Therefore, this profile should be used with care since non-deterministic behavior can occur due
|
||||
* to races with discovery.
|
||||
*
|
||||
* - History: Keep last,
|
||||
* - Depth: 10,
|
||||
* - Reliability: Best available,
|
||||
* - Durability: Best available,
|
||||
* - Deadline: Best available,
|
||||
* - Lifespan: Default,
|
||||
* - Liveliness: Best available,
|
||||
* - Liveliness lease duration: Best available,
|
||||
* - avoid ros namespace conventions: false
|
||||
*/
|
||||
class RCLCPP_PUBLIC BestAvailableQoS : public QoS
|
||||
{
|
||||
public:
|
||||
explicit
|
||||
BestAvailableQoS(
|
||||
const QoSInitialization & qos_initialization = (
|
||||
QoSInitialization::from_rmw(rmw_qos_profile_best_available)
|
||||
));
|
||||
};
|
||||
|
||||
} // namespace rclcpp
|
||||
|
||||
#endif // RCLCPP__QOS_HPP_
|
||||
|
||||
@@ -189,10 +189,10 @@ public:
|
||||
TRACEPOINT(
|
||||
rclcpp_timer_callback_added,
|
||||
static_cast<const void *>(get_timer_handle().get()),
|
||||
static_cast<const void *>(&callback_));
|
||||
reinterpret_cast<const void *>(&callback_));
|
||||
TRACEPOINT(
|
||||
rclcpp_callback_register,
|
||||
static_cast<const void *>(&callback_),
|
||||
reinterpret_cast<const void *>(&callback_),
|
||||
tracetools::get_symbol(callback_));
|
||||
}
|
||||
|
||||
@@ -226,9 +226,9 @@ public:
|
||||
void
|
||||
execute_callback() override
|
||||
{
|
||||
TRACEPOINT(callback_start, static_cast<const void *>(&callback_), false);
|
||||
TRACEPOINT(callback_start, reinterpret_cast<const void *>(&callback_), false);
|
||||
execute_callback_delegate<>();
|
||||
TRACEPOINT(callback_end, static_cast<const void *>(&callback_));
|
||||
TRACEPOINT(callback_end, reinterpret_cast<const void *>(&callback_));
|
||||
}
|
||||
|
||||
// void specialization
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="2">
|
||||
<name>rclcpp</name>
|
||||
<version>16.0.1</version>
|
||||
<version>16.2.0</version>
|
||||
<description>The ROS client library in C++.</description>
|
||||
<maintainer email="ivanpauno@ekumenlabs.com">Ivan Paunovic</maintainer>
|
||||
<maintainer email="jacob@openrobotics.org">Jacob Perron</maintainer>
|
||||
|
||||
@@ -133,9 +133,13 @@ ParameterEventHandler::get_parameter_from_event(
|
||||
{
|
||||
rclcpp::Parameter p;
|
||||
if (!get_parameter_from_event(event, p, parameter_name, node_name)) {
|
||||
throw std::runtime_error(
|
||||
"Parameter '" + parameter_name + "' of node '" + node_name +
|
||||
"' is not part of parameter event");
|
||||
if (event.node == node_name) {
|
||||
return rclcpp::Parameter(parameter_name, rclcpp::PARAMETER_NOT_SET);
|
||||
} else {
|
||||
throw std::runtime_error(
|
||||
"The node name '" + node_name + "' of parameter '" + parameter_name +
|
||||
+"' doesn't match the node name '" + event.node + "' in parameter event");
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -150,6 +150,12 @@ QoS::best_effort()
|
||||
return this->reliability(RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT);
|
||||
}
|
||||
|
||||
QoS &
|
||||
QoS::reliability_best_available()
|
||||
{
|
||||
return this->reliability(RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE);
|
||||
}
|
||||
|
||||
QoS &
|
||||
QoS::durability(rmw_qos_durability_policy_t durability)
|
||||
{
|
||||
@@ -176,6 +182,12 @@ QoS::transient_local()
|
||||
return this->durability(RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL);
|
||||
}
|
||||
|
||||
QoS &
|
||||
QoS::durability_best_available()
|
||||
{
|
||||
return this->durability(RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE);
|
||||
}
|
||||
|
||||
QoS &
|
||||
QoS::deadline(rmw_time_t deadline)
|
||||
{
|
||||
@@ -380,4 +392,8 @@ SystemDefaultsQoS::SystemDefaultsQoS(const QoSInitialization & qos_initializatio
|
||||
: QoS(qos_initialization, rmw_qos_profile_system_default)
|
||||
{}
|
||||
|
||||
BestAvailableQoS::BestAvailableQoS(const QoSInitialization & qos_initialization)
|
||||
: QoS(qos_initialization, rmw_qos_profile_best_available)
|
||||
{}
|
||||
|
||||
} // namespace rclcpp
|
||||
|
||||
@@ -116,3 +116,20 @@ TEST(TestCreateTimer, call_wall_timer_with_bad_arguments)
|
||||
std::invalid_argument);
|
||||
rclcpp::shutdown();
|
||||
}
|
||||
|
||||
static void test_timer_callback(void) {}
|
||||
|
||||
TEST(TestCreateTimer, timer_function_pointer)
|
||||
{
|
||||
rclcpp::init(0, nullptr);
|
||||
auto node = std::make_shared<rclcpp::Node>("timer_function_pointer_node");
|
||||
|
||||
// make sure build succeeds with function pointer instead of lambda
|
||||
auto some_timer = rclcpp::create_timer(
|
||||
node,
|
||||
node->get_clock(),
|
||||
rclcpp::Duration(0ms),
|
||||
test_timer_callback);
|
||||
|
||||
rclcpp::shutdown();
|
||||
}
|
||||
|
||||
@@ -202,9 +202,17 @@ TEST_F(TestNode, GetParameterFromEvent)
|
||||
EXPECT_THROW(
|
||||
ParameterEventHandler::get_parameter_from_event(*multiple, "my_int", wrong_name),
|
||||
std::runtime_error);
|
||||
// Throws if parameter not part of event
|
||||
|
||||
// Parameter not part of event
|
||||
// with correct node
|
||||
rclcpp::Parameter expect_notset_ret("my_notset", rclcpp::PARAMETER_NOT_SET);
|
||||
rclcpp::Parameter ret;
|
||||
EXPECT_NO_THROW(
|
||||
ret = ParameterEventHandler::get_parameter_from_event(*multiple, "my_notset", node_name););
|
||||
EXPECT_EQ(ret, expect_notset_ret);
|
||||
// with incorrect node
|
||||
EXPECT_THROW(
|
||||
ParameterEventHandler::get_parameter_from_event(*diff_ns_bool, "my_int", node_name),
|
||||
ParameterEventHandler::get_parameter_from_event(*multiple, "my_notset", wrong_name),
|
||||
std::runtime_error);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,9 @@ TEST(TestQoS, setters_and_getters) {
|
||||
qos.reliable();
|
||||
EXPECT_EQ(rclcpp::ReliabilityPolicy::Reliable, qos.reliability());
|
||||
|
||||
qos.reliability_best_available();
|
||||
EXPECT_EQ(rclcpp::ReliabilityPolicy::BestAvailable, qos.reliability());
|
||||
|
||||
qos.reliability(rclcpp::ReliabilityPolicy::BestEffort);
|
||||
EXPECT_EQ(rclcpp::ReliabilityPolicy::BestEffort, qos.reliability());
|
||||
|
||||
@@ -102,6 +105,9 @@ TEST(TestQoS, setters_and_getters) {
|
||||
qos.transient_local();
|
||||
EXPECT_EQ(rclcpp::DurabilityPolicy::TransientLocal, qos.durability());
|
||||
|
||||
qos.durability_best_available();
|
||||
EXPECT_EQ(rclcpp::DurabilityPolicy::BestAvailable, qos.durability());
|
||||
|
||||
qos.durability(rclcpp::DurabilityPolicy::Volatile);
|
||||
EXPECT_EQ(rclcpp::DurabilityPolicy::Volatile, qos.durability());
|
||||
|
||||
@@ -183,6 +189,9 @@ TEST(TestQoS, DerivedTypes) {
|
||||
const rclcpp::KeepLast expected_initialization(RMW_QOS_POLICY_DEPTH_SYSTEM_DEFAULT);
|
||||
const rclcpp::QoS expected_default(expected_initialization);
|
||||
EXPECT_EQ(expected_default.get_rmw_qos_profile(), system_default_qos.get_rmw_qos_profile());
|
||||
|
||||
rclcpp::BestAvailableQoS best_available_qos;
|
||||
EXPECT_EQ(rmw_qos_profile_best_available, best_available_qos.get_rmw_qos_profile());
|
||||
}
|
||||
|
||||
TEST(TestQoS, policy_name_from_kind) {
|
||||
|
||||
@@ -3,6 +3,12 @@ Changelog for package rclcpp_action
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
16.2.0 (2022-05-03)
|
||||
-------------------
|
||||
|
||||
16.1.0 (2022-04-29)
|
||||
-------------------
|
||||
|
||||
16.0.1 (2022-04-13)
|
||||
-------------------
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="2">
|
||||
<name>rclcpp_action</name>
|
||||
<version>16.0.1</version>
|
||||
<version>16.2.0</version>
|
||||
<description>Adds action APIs for C++.</description>
|
||||
<maintainer email="ivanpauno@ekumenlabs.com">Ivan Paunovic</maintainer>
|
||||
<maintainer email="jacob@openrobotics.org">Jacob Perron</maintainer>
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
Changelog for package rclcpp_components
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
16.2.0 (2022-05-03)
|
||||
-------------------
|
||||
|
||||
16.1.0 (2022-04-29)
|
||||
-------------------
|
||||
|
||||
16.0.1 (2022-04-13)
|
||||
-------------------
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="2">
|
||||
<name>rclcpp_components</name>
|
||||
<version>16.0.1</version>
|
||||
<version>16.2.0</version>
|
||||
<description>Package containing tools for dynamically loadable components</description>
|
||||
<maintainer email="ivanpauno@ekumenlabs.com">Ivan Paunovic</maintainer>
|
||||
<maintainer email="jacob@openrobotics.org">Jacob Perron</maintainer>
|
||||
|
||||
@@ -3,6 +3,12 @@ Changelog for package rclcpp_lifecycle
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
16.2.0 (2022-05-03)
|
||||
-------------------
|
||||
|
||||
16.1.0 (2022-04-29)
|
||||
-------------------
|
||||
|
||||
16.0.1 (2022-04-13)
|
||||
-------------------
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="2">
|
||||
<name>rclcpp_lifecycle</name>
|
||||
<version>16.0.1</version>
|
||||
<version>16.2.0</version>
|
||||
<description>Package containing a prototype for lifecycle implementation</description>
|
||||
<maintainer email="ivanpauno@ekumenlabs.com">Ivan Paunovic</maintainer>
|
||||
<maintainer email="jacob@openrobotics.org">Jacob Perron</maintainer>
|
||||
|
||||
Reference in New Issue
Block a user