Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

Dynamic parameters for kobuki_node - #4

Closed
rohbotics wants to merge 7 commits into
ros2:masterfrom
rohbotics:dynamic_parameters
Closed

rohbotics wants to merge 7 commits into
ros2:masterfrom
rohbotics:dynamic_parameters

Conversation

@rohbotics

Copy link
Copy Markdown
Contributor

Support changing some parameters dynamically

Comment thread joy/joy_node.cpp Outdated
printf("Warning: ignoring attempt to set parameter %s with type %d\n",
changed_parameter.name.c_str(), changed_parameter.value.type);
// printf("Warning: ignoring attempt to set parameter %s with type %d\n",
// changed_parameter.name.c_str(), changed_parameter.value.type);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why remove this? Is it because there is no way to detect which parameter changes were intended for this node (the node is not implicitly in the name)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes.

It was printing every time there was a parameter change for any other node, at least with opensplice.
This print was getting pretty noisy when I was changing a bunch of kobuki parameters

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok. I'd have to look at the Parameter API's current state, but I think there should be a better way to update the parameters other than listening to the ParameterEvents, which also doesn't have this problem. This is probably fine for now.

@rohbotics

Copy link
Copy Markdown
Contributor Author

I updated this PR to work with the new parameter API,
it can be merged when alpha8 is out.

@rohbotics

Copy link
Copy Markdown
Contributor Author

Rebased onto #3

@rohbotics

Copy link
Copy Markdown
Contributor Author

Fixed rebase

rcl_interfaces::msg::ParameterType::PARAMETER_DOUBLE) {
result.successful = false;
result.reason = "max_vyaw has to be a double";
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These repeated conditions are hard to read. I would suggest to extract the common conditions into a first level and then use a condition and an else block for the second level, e.g.:

if ("device_port" == param.get_name()) {
  if (param.get_type() == rcl_interfaces::msg::ParameterType::PARAMETER_STRING) {
    ...
  } else {
    ...
  }
}

@rohbotics

Copy link
Copy Markdown
Contributor Author

This should be mergeable now with alpha8.

@rohbotics rohbotics mentioned this pull request Mar 6, 2017
@mikaelarguedas mikaelarguedas added the ready Work is about to start (Kanban column) label Apr 5, 2017
@mikaelarguedas mikaelarguedas removed the ready Work is about to start (Kanban column) label Jul 26, 2017
@rohbotics rohbotics closed this Dec 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants