Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ParamListener::try_get_params to Avoid Blocking in Real-Time Contexts #1198

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ controller_interface::return_type JointTrajectoryController::update(
}
auto logger = this->get_node()->get_logger();
// update dynamic parameters
if (param_listener_->is_old(params_))
if (param_listener_->try_get_params(params_))
{
params_ = param_listener_->get_params();
default_tolerances_ = get_segment_tolerances(logger, params_);
// update the PID gains
// variable use_closed_loop_pid_adapter_ is updated in on_configure only
Expand Down
2 changes: 1 addition & 1 deletion pid_controller/src/pid_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ controller_interface::return_type PidController::update_and_write_commands(
const rclcpp::Time & time, const rclcpp::Duration & period)
{
// check for any parameter updates
update_parameters();
param_listener_->try_get_params(params_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove update_parameters() method and use just get_params() in the on_configure() method (not in the RT loop).


if (params_.use_external_measured_states)
{
Expand Down
Loading