Skip to content

Commit

Permalink
add steady clock to nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
mamueluth committed Jun 14, 2023
1 parent 59de6ff commit a9a5998
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ void ControllerManager::init_distributed_sub_controller_manager()
{
// create node for publishing/subscribing
rclcpp::NodeOptions node_options;
node_options.clock_type(rcl_clock_type_t::RCL_STEADY_TIME);
distributed_pub_sub_node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
std::string(get_name()) + "_pub_sub_node", get_namespace(), node_options, false);
//try to add to executor
Expand Down Expand Up @@ -567,6 +568,7 @@ void ControllerManager::init_distributed_central_controller_manager()
if (!use_multiple_nodes())
{
rclcpp::NodeOptions node_options;
node_options.clock_type(rcl_clock_type_t::RCL_STEADY_TIME);
distributed_pub_sub_node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
std::string(get_name()) + "_pub_sub_node", get_namespace(), node_options, false);
//try to add to executor
Expand Down
2 changes: 2 additions & 0 deletions hardware_interface/include/hardware_interface/handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class DistributedReadOnlyHandle : public ReadOnlyHandle
if (!node_.get())
{
rclcpp::NodeOptions node_options;
node_options.clock_type(rcl_clock_type_t::RCL_STEADY_TIME);
node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
get_underscore_separated_name() + "_state_interface_subscriber", namespace_, node_options,
false);
Expand Down Expand Up @@ -354,6 +355,7 @@ class DistributedReadWriteHandle : public ReadWriteHandle
if (!node_.get())
{
rclcpp::NodeOptions node_options;
node_options.clock_type(rcl_clock_type_t::RCL_STEADY_TIME);
node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
get_underscore_separated_name() + "_distributed_command_interface", namespace_,
node_options, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ CommandForwarder::CommandForwarder(
if (!node_.get())
{
rclcpp::NodeOptions node_options;
node_options.clock_type(rcl_clock_type_t::RCL_STEADY_TIME);
node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
loaned_command_interface_ptr_->get_underscore_separated_name() + "_command_forwarder",
namespace_, node_options, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ StatePublisher::StatePublisher(
if (!node_.get())
{
rclcpp::NodeOptions node_options;
node_options.clock_type(rcl_clock_type_t::RCL_STEADY_TIME);
node_ = std::make_shared<rclcpp_lifecycle::LifecycleNode>(
loaned_state_interface_ptr_->get_underscore_separated_name() + "_state_publisher", namespace_,
node_options, false);
Expand Down

0 comments on commit a9a5998

Please sign in to comment.