Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
roncapat authored Mar 27, 2024
1 parent a105607 commit d372af4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gz_ros2_control/src/gz_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,12 @@ bool GazeboSimSystem::initSim(

constexpr double default_gain = 0.1;

this->dataPtr->position_proportional_gain_ = this->nh_->declare_parameter<double>(
"position_proportional_gain", default_gain);
try {
this->dataPtr->position_proportional_gain_ = this->nh_->declare_parameter<double>(
"position_proportional_gain", default_gain);
} catch (rclcpp::exceptions::ParameterAlreadyDeclaredException & ex) {
/* avoid redeclaration */
}

RCLCPP_INFO_STREAM(
this->nh_->get_logger(),
Expand Down

0 comments on commit d372af4

Please sign in to comment.