Skip to content

add read_only parameters to diff_drive_controller #1781

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adhithiyan110
Copy link

This PR adds the read_only attribute to key parameters of diff_drive_controller.Related to #1696

}
open_loop: {
type: bool,
default_value: false,
description: "If set to true the odometry of the robot will be calculated from the commanded values and not from feedback.",
read_only: false,
Copy link
Member

Choose a reason for hiding this comment

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

Do we want this to be false?. Does it make sense to change this online?

Copy link
Author

Choose a reason for hiding this comment

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

can i make this true?

Copy link
Member

Choose a reason for hiding this comment

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

Sure

}
position_feedback: {
type: bool,
default_value: true,
description: "Is there position feedback from hardware.",
read_only: false,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
read_only: false,
read_only: true,

}
publish_rate: {
type: double,
default_value: 50.0, # Hz
description: "Publishing rate (Hz) of the odometry and TF messages.",
read_only: false,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
read_only: false,
read_only: true,

This should be constant too

}
publish_rate: {
type: double,
default_value: 50.0, # Hz
description: "Publishing rate (Hz) of the odometry and TF messages.",
read_only: false,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
read_only: false,
read_only: true,

This should be constant too

@adhithiyan110 adhithiyan110 requested a review from saikishor July 6, 2025 05:11
Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

The parameters itself look good. But we don't update the parameters post on_configure. I propose changing this to a simple get_params() as on_configure is not in the RT thread

// update parameters if they have changed
if (param_listener_->try_update_params(params_))
{
RCLCPP_INFO(logger, "Parameters were updated");
}

but add this try_update_params to the update_reference_from_subscribers or update_and_write_commands method.

Please review then also if we need local copies of the params_-struct members and either remove it or update them after try_update_params. (cmd_vel_timeout_, publish_limited_velocity_,..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants