Skip to content

Separate declare and get params #1

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 19 commits into
base: main
Choose a base branch
from

Conversation

saikishor
Copy link
Owner

No description provided.

Copy link
Collaborator

@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.

Looks clean, and it should be compatible with existing code?!


private:
void update_interal_params(Params updated_params) {
std::lock_guard<std::mutex> lock(mutex_);
params_ = updated_params;
}

Params get_internal_params_copy() const{
std::lock_guard<std::mutex> lock(mutex_);
Copy link
Collaborator

Choose a reason for hiding this comment

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

so we need the mutex here?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I think as we are accessing the the params_ variable which could be modified by the callback at the same time

Co-authored-by: Christoph Fröhlich <christophfroehlich@users.noreply.github.com>
@saikishor
Copy link
Owner Author

Looks clean, and it should be compatible with existing code?!

@christophfroehlich I ran the tests after compiling with this library, in principle they are passing on the ros2_control and ros2_controllers side. I tried to leave it backward compatible. That's why I left it to get the parameters on construction by default

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.

2 participants