forked from epfl-lasa/modulo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor ComponentInterface to use node interfaces (#33)
* Move ComponentInterface constructor to source file Remove template class NodeT Change ComponentInterface constructor arguments to get all the node interfaces * Pass the publisher type as argument to create_output * Fix logging with logging interface * Fix parameters with parameters interface * Update creation of subscriptions, services and TF helpers * Update ComponentInterface tests * Rebase fixes * 2.2.10 -> 2.2.11 * Update CHANGELOG
- Loading branch information
Showing
14 changed files
with
312 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.2.10 | ||
2.2.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>modulo_component_interfaces</name> | ||
<version>2.2.10</version> | ||
<version>2.2.11</version> | ||
<description>Interface package for communicating with modulo components through the ROS framework</description> | ||
<maintainer email="[email protected]">Enrico Eberhard</maintainer> | ||
<license>GPLv3</license> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
422 changes: 180 additions & 242 deletions
422
source/modulo_components/include/modulo_components/ComponentInterface.hpp
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>modulo_components</name> | ||
<version>2.2.10</version> | ||
<version>2.2.11</version> | ||
<description>Modulo base classes that wrap ROS2 Nodes as modular components for the AICA application framework</description> | ||
<maintainer email="[email protected]">Baptiste Busch</maintainer> | ||
<maintainer email="[email protected]">Enrico Eberhard</maintainer> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "modulo_components/ComponentInterface.hpp" | ||
|
||
using namespace modulo_core::communication; | ||
|
||
namespace modulo_components { | ||
|
||
ComponentInterface::ComponentInterface( | ||
const std::shared_ptr<rclcpp::node_interfaces::NodeInterfaces<ALL_RCLCPP_NODE_INTERFACES>>& interfaces | ||
) : | ||
node_base_(interfaces->get_node_base_interface()), | ||
node_clock_(interfaces->get_node_clock_interface()), | ||
node_logging_(interfaces->get_node_logging_interface()), | ||
node_parameters_(interfaces->get_node_parameters_interface()), | ||
node_services_(interfaces->get_node_services_interface()), | ||
node_timers_(interfaces->get_node_timers_interface()), | ||
node_topics_(interfaces->get_node_topics_interface()) { | ||
this->cb_group_ = node_base_->create_callback_group(rclcpp::CallbackGroupType::Reentrant); | ||
// register the parameter change callback handler | ||
this->parameter_cb_handle_ = this->node_parameters_->add_on_set_parameters_callback( | ||
[this](const std::vector<rclcpp::Parameter>& parameters) -> rcl_interfaces::msg::SetParametersResult { | ||
return this->on_set_parameters_callback(parameters); | ||
}); | ||
this->add_parameter("period", 0.1, "The time interval in seconds for all periodic callbacks", true); | ||
this->predicate_publisher_ = | ||
rclcpp::create_publisher<modulo_component_interfaces::msg::Predicate>(*this, "/predicates", this->qos_); | ||
|
||
this->add_predicate("in_error_state", false); | ||
|
||
this->step_timer_ = rclcpp::create_wall_timer( | ||
std::chrono::nanoseconds(static_cast<int64_t>(this->get_parameter_value<double>("period") * 1e9)), | ||
[this] { this->step(); }, this->cb_group_, this->node_base_.get(), this->node_timers_.get()); | ||
} | ||
}// namespace modulo_components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.