Skip to content

Commit

Permalink
init catch
Browse files Browse the repository at this point in the history
  • Loading branch information
mhubii committed May 9, 2024
1 parent ff8582b commit dd17a0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lbr_ros2_control/src/system_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ SystemInterface::on_deactivate(const rclcpp_lifecycle::State &) {

hardware_interface::return_type SystemInterface::read(const rclcpp::Time & /*time*/,
const rclcpp::Duration &period) {
if (!async_client_ptr_->get_state_interface().is_initialized()) {
return hardware_interface::return_type::OK;
}

hw_lbr_state_ = async_client_ptr_->get_state_interface().get_state();

if (period.seconds() - hw_lbr_state_.sample_time * 0.2 > hw_lbr_state_.sample_time) {
Expand Down

0 comments on commit dd17a0e

Please sign in to comment.