Skip to content

Commit

Permalink
Move communication setup to on_configure instead of on_activate
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch committed Nov 14, 2023
1 parent 899a7fe commit 86defa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class URPositionHardwareInterface : public hardware_interface::SystemInterface

std::vector<hardware_interface::CommandInterface> export_command_interfaces() final;

hardware_interface::CallbackReturn on_configure(const rclcpp_lifecycle::State& previous_state) final;
hardware_interface::CallbackReturn on_activate(const rclcpp_lifecycle::State& previous_state) final;
hardware_interface::CallbackReturn on_deactivate(const rclcpp_lifecycle::State& previous_state) final;

Expand Down
9 changes: 8 additions & 1 deletion ur_robot_driver/src/hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ std::vector<hardware_interface::CommandInterface> URPositionHardwareInterface::e
}

hardware_interface::CallbackReturn
URPositionHardwareInterface::on_activate(const rclcpp_lifecycle::State& previous_state)
URPositionHardwareInterface::on_configure(const rclcpp_lifecycle::State& previous_state)
{
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"), "Starting ...please wait...");

Expand Down Expand Up @@ -462,6 +462,13 @@ URPositionHardwareInterface::on_activate(const rclcpp_lifecycle::State& previous
return hardware_interface::CallbackReturn::SUCCESS;
}

hardware_interface::CallbackReturn
URPositionHardwareInterface::on_activate(const rclcpp_lifecycle::State& previous_state)
{
RCLCPP_INFO(rclcpp::get_logger("URPositionHardwareInterface"), "Activating HW interface");
return hardware_interface::CallbackReturn::SUCCESS;
}

hardware_interface::CallbackReturn
URPositionHardwareInterface::on_deactivate(const rclcpp_lifecycle::State& previous_state)
{
Expand Down

0 comments on commit 86defa7

Please sign in to comment.