Skip to content

Parameter Review Roundup #46

Closed
Closed

Description

@wjwwood

GetParameters.srv

# A list of parameter names to get.
# TODO(wjwwood): Decide on the rules for grouping, nodes, and parameter "names" in general, then link to that.
string[] names

---

# List of values which is the same length and order as the provided names.
# If a parameter was not set yet, the value will have PARAMETER_NOT_SET as the parameter_type.
ParameterValue[] values

ParameterType.msg

uint8 PARAMETER_NOT_SET=0
uint8 BOOL_PARAMETER=1
uint8 INTEGER_PARAMETER=2
uint8 DOUBLE_PARAMETER=3
uint8 STRING_PARAMETER=4
uint8 BYTES_PARAMETER=5

ParameterValue.msg

# Used to determine which of the next *_value fields are set.
# ParameterType.PARAMETER_NOT_SET indicates that the parameter was not set
# (if gotten) or is uninitialized.
uint8 parameter_type  # wjwwood: was there a reason to not use just type here?

# "Variant" style storage of the parameter value.
bool bool_value
int64 integer_value
float64 double_value
string string_value
int8[] bytes_value

GetParameterTypes.srv

# A list of parameter names.
# TODO(wjwwood): link to parameter naming rules.
string[] parameter_names

---

# List of types which is the same length and order as the provided names.
# ParameterType.PARAMETER_NOT_SET indicates that the parameter is not currently set.
uint8[] parameter_types

SetParameterResult.msg

# A true value of the same index indicates that the parameter was set successfully.
# A false value indicates the change was rejected.
bool successful
# Reason why the setting was either successful or a failure.
# Should only be used for logging and user interfaces.
string reason

SetParameters.srv

# A list of parameters to set.
Parameter[] parameters

---

# An order list of results of the same size as the given parameters.
SetParameterResult[] results

SetParametersAtomically.srv

# A list of parameters to set.
Parameter[] parameters

---

SetParameterResult result

Parameter.msg

string name
ParameterValue value

ListParameters.srv

uint64 DEPTH_RECURSIVE=0

# The list of parameter prefixes to query.
string[] parameter_prefixes
# Relative depth from given prefixes to return.
# Use DEPTH_RECURSIVE to get the recursive parameters and prefixes for each prefix.
uint64 depth

---

# All parameters under the given prefixes.
string[] parameter_names
# All prefixes under the given prefixes.
# TODO(wjwwood): link to prefix definition and rules.
string[] parameter_prefixes

DescribeParameters.srv

# A list of parameters of which to get the description.
string[] parameter_names

---

# An ordered list of parameter descriptions of the same size as the list requested.
# If the parameter_type is set to PARAMETER_NOT_SET, then the parameter requested was not set.
ParameterDescription[] parameter_descriptions

ParameterDescription.msg

string parameter_name
uint8 parameter_type  # wjwwood: same note, seems like just type would be better.
# TODO: add additional meta data.
  • [impl] ParameterContainer should use the generated ParameterValue.msg as storage
  • [api] ParameterContainer should be renamed to avoid confusion that it only holds one value and to show that it is related to the ParameterValue.msg
  • [api] the parameter API should take a node not be part of the node class.
  • [api] refactor examples and design information based on our discussion:
auto node = ...;
auto pc = ParameterClient(node, node_name="");
auto pc = ParameterClient(node, remote_node_name="other");
auto pc = node->createParameterClient(remote_node_name="other");
pc.set...;
pc.get...;
pc.list...;

The handle approach:

auto node = ...;
auto my_node_pc = ParameterClient(node, node_name="");
auto remote_node_pc = ParameterClient(node, remote_node_name="other");
pc.set...;
pc.get...;
pc.list...;

The single client approach:

auto node = ...;
auto pc = ParameterClient(node);
pc.searchForAll('*/foo/*')
pc.setP(fqpn)
pc.setP(parameter_name, node_name)
pc.setP(parameter_name)
pc.setLocalP(parameter_name)
pc.set...(node_name, ...);
pc.set...('parameter://node.ping/foo/bar');
pc.get...;
pc.list...;

AsyncParameterClient apc = pc->get_async...

auto node = Node(parameter_server=true)
auto ps = node->getParameterServer();

  • [api] Draft (header/examples) of user's Server side of the parameters.

Activity

  1. dirk-thomas commented on Apr 28, 2015

    @dirk-thomas
    Member

    After re-reading our summary from the last meeting I would suggest the following changes:

    • ParameterType.msg: rename the enum types to exact types, e.g. INT64 vs INTEGER to clarify what exact value range they can store and keeping the option to add further primitive types in the future.
    • instead of the term Description (which could also refer to textual description) change it to Descriptor which is a common term for a class containing meta information like this.
  2. wjwwood commented on Apr 28, 2015

    @wjwwood
    MemberAuthor

    ParameterType.msg: rename the enum types to exact types, e.g. INT64 vs INTEGER to clarify what exact value range they can store and keeping the option to add further primitive types in the future.

    +0, the int in most programming languages doesn't describe the exact size of the integer. So I think there is precedence for this, but I'm not passionate about it one way or the other.

    instead of the term Description (which could also refer to textual description) change it to Descriptor which is a common term for a class containing meta information like this.

    +1 That sounds good to me.

  3. added
    in progress
    on Apr 28, 2015
  4. added a commit that references this issue on Apr 28, 2015
  5. dirk-thomas commented on Apr 28, 2015

    @dirk-thomas
    Member

    The current ParameterEvent message uses ParameterDescriptor for the deleted parameters. Should we change this to just use the Parameter type?

  6. dirk-thomas commented on Apr 28, 2015

    @dirk-thomas
    Member

    One message definition is still called ParameterEventDescriptions and should probably be named ParameterEventDescriptors?

  7. dirk-thomas commented on Apr 28, 2015

    @dirk-thomas
    Member

    Suggestion to change the field parameter_names in GetParameterTypes to match other services like DescribeParameters / GetParameters. Same for fields in ListParameters.

  8. tfoote commented on May 5, 2015

    @tfoote
    Contributor

    @esteve @tfoote confirm checkboxes covered and close

  9. added
    in review
    and removed
    in progress
    on May 5, 2015
  10. esteve commented on May 26, 2015

    @esteve
    Member

    Naming: we're going to use name and type for ParameterDescriptor.

  11. wjwwood commented on Jun 11, 2015

    @wjwwood
    MemberAuthor

    @esteve ping

  12. self-assigned this
    on Jun 12, 2015
  13. removed
    in review
    on Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions