Skip to content

first draft of parameter design doc - #58

Merged
tfoote merged 20 commits into
gh-pagesfrom
parameter_design
Nov 4, 2015
Merged

tfoote merged 20 commits into
gh-pagesfrom
parameter_design

Conversation

@tfoote

@tfoote tfoote commented Sep 15, 2015

Copy link
Copy Markdown
Contributor

Connects to #57

@tfoote tfoote added the in progress Actively being worked on (Kanban column) label Sep 15, 2015
Comment thread articles/055_ros_parameter_design.md Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If I understand correctly, this would be the method for enforcing parameter ranges (among other things). And 'be able to communicate the preconditions' would refers to a mechanism that could be used to, for instance, display valid parameter values or ranges, as rqt_reconfigure currently does. Is my interpretation correct?

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.

Exactly.

Comment thread articles/055_ros_parameter_design.md Outdated

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.

Return as well as unset need to support groups of parameters atomically if setting those is supported.

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.

Added a line after to clarify it will return unset explicitly.

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.

My comment was referring to the need to query a set of parameters atomically. The new sentence does not yet cover that.

Comment thread articles/055_ros_parameter_design.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is meant by an "entire system"? The entire ROS 2 graph? Or can it be a subset of the nodes involved in getting/setting parameters?

Comment thread articles/055_ros_parameter_design.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be a subsection of "Topics not covered at the moment"? It should probably have 3 leading #s.

Comment thread articles/055_ros_parameter_design.md Outdated

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.

I'd call this section "set" and the next "get" parameter values. This makes it line up with "unset" and it avoids "accept" which implies that it could have not been accepted ("reject"), which is not covered in the following paragraph.

Comment thread articles/055_ros_parameter_design.md Outdated

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.

I'd say "the owner of the parameter should be able to reject ...", using "parameter server" implies how it should be implemented since server invokes the idea of a centralized client-server relationship.

@mikeferguson

Copy link
Copy Markdown
Contributor

The concept seems useful in its own right. Some parameters like use_sim_time and the old tf_prefix are inherently global, they do not apply to just one node.

Or, even more common: the robot_description URDF parameter.

@tfoote

tfoote commented Sep 22, 2015

Copy link
Copy Markdown
Contributor Author

I think that the unowned parameters are a pattern that generally should be discouraged. The example of the robot_description is a good example where it should have a more clearly defined interface to deal with changing values. ros/robot_state_publisher#29

There are very few pieces of data which are truely global and unchaning like use_sim_time.

@jack-oquin

Copy link
Copy Markdown

How will unowned parameters be discouraged?

Fairly often, I find it useful to define parameters at a higher level in the namespace for use by more than one node. Isn't that what searchParam() is for?

In most cases, there can be a node that "owns" each of those parameters. But, what happens if that node should terminate unexpectedly? Will the parameter persist across a respawn? It would in ROS 1.

Instead of dismissing them as a backwards compatibility option, I think global parameters deserve some serious design treatment.

@wjwwood

wjwwood commented Sep 22, 2015

Copy link
Copy Markdown
Member

Fairly often, I find it useful to define parameters at a higher level in the namespace for use by more than one node. Isn't that what searchParam() is for?

@jack-oquin It would be fine to have something like searchParam() which works in combination with the "list params" function we described here. One of the things we've avoided discussing so far is addressing in ROS 2. I think there is a need for a more formal addressing scheme in ROS, but that's a topic for another article. The only reason I bring it up is that it should be possible to have hierarchies of nodes and parameters within namespaces and a tool like searchParam() will still be useful.

In most cases, there can be a node that "owns" each of those parameters. But, what happens if that node should terminate unexpectedly? Will the parameter persist across a respawn? It would in ROS 1.

I know that's a useful feature that a lot of people use and we've talked about how to preserve that behavior if it is desired, but it's not mentioned explicitly here either as a use case or as something that needs addressing.

@tfoote we should add that point, or I can if you don't have time.

My personal opinion is that for ROS 2 it should be done by a tool which is actually a normal node. This node would act similar to how it's done in ROS 1, but would not use any special interfaces or features if possible. In ROS 1 a node starts up, then contacts the parameter server and gets the current values (either defaults or what was set from a previous run). The generic parameter server node in ROS 2 could provide the same service, which nodes could optionally query before taking the hard coded defaults in their code. Like the ROS 1 parameter server, this generic parameter server node in ROS 2 could provide a global namespace which all nodes could reference and search through and could hold common global parameters like robot_description (though I've long thought that should be a latched topic in ROS 1 so it could be captured by a bag file). In both cases parameters are lost if the parameter server is shutdown or crashes and in both cases nodes could store parameters in it and recover them after the node crashes or restarts.

So I think that even if all parameters must be owned by a node, i.e. no true global parameters, you can model this pattern using nodes. We just need to provide the right tools and we could include an instance of this parameter server node in something like the roscore command.

Instead of dismissing them as a backwards compatibility option, I think global parameters deserve some serious design treatment.

I agree, we should describe the motivation for this feature and describe how it can be accomplished with the proposed solution and let people comment on that.

@tfoote

tfoote commented Oct 20, 2015

Copy link
Copy Markdown
Contributor Author

I've added some more details about how to use a parameter server node in parent namespaces and added a section on searchParam to address the above comments.

wjwwood and others added 3 commits October 20, 2015 18:10
@dirk-thomas

Copy link
Copy Markdown
Member

The bullet Check what parameters are expected to be set for a particular Node listed under Ideal System doen't comes from the capabilities in ROS 1. I don't see a reason to consider this necessary for an "ideal system". Having a node prepopulate all its valid parameters and reject others seems to be sufficient. The valid parameter names can also be exposed as "constants" to other entities (if they don't want to hard code the values into their code). Therefore I would propose to remove that specific bullet (and the later remark that it hasn't been implemented anyway).

If the part should stay in the article (which I think it shouldn't) it would be better suited in the "Topics not covered at the moment" section at the end.

Comment thread articles/055_ros_parameter_design.md Outdated

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.

The wording of this sentence sounds very fuzzy to me. It could be interpreted that external entities can register these validation callbacks which I think is not the case?

@dirk-thomas

Copy link
Copy Markdown
Member

Beside my comments I added a few commits to the PR rephrasing little things and adding a some additional information.

@tfoote

tfoote commented Oct 29, 2015

Copy link
Copy Markdown
Contributor Author

@BobDean

(also, why can i not get my comment to trail the post i am responding to?)

Github doesn't support branching "threading" of replies. If you want to reply to something specific the best thing to do is to quote it and then reply. You get specific sub-threads from line comments, but they're kind of volatile as if the line of code is updated the whole sub-thread can vanish.

@tfoote

tfoote commented Nov 2, 2015

Copy link
Copy Markdown
Contributor Author

I've addressed @dirk-thomas 's comments. I'd like to suggest we merge this now and get it posted on the site for others to find. I'm sure there will be more updates to come but it's at a relatively self consistent state at the moment.

tfoote added a commit that referenced this pull request Nov 4, 2015
first draft of parameter design doc
@tfoote
tfoote merged commit 242c147 into gh-pages Nov 4, 2015
@tfoote tfoote removed the in progress Actively being worked on (Kanban column) label Nov 4, 2015
@tfoote
tfoote deleted the parameter_design branch November 4, 2015 21:22
@tfoote

tfoote commented Nov 4, 2015

Copy link
Copy Markdown
Contributor Author

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.

10 participants