You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/055_ros_parameter_design.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,17 +109,31 @@ Each parameter consists of a key and a value.
109
109
The key is a string value.
110
110
The value can be one of the following datatypes:
111
111
112
-
-`float64`
112
+
-`bool`
113
113
-`int64`
114
+
-`float64`
114
115
-`string`
115
-
-`bool`
116
-
-`bytes[]`
116
+
-`byte[]`
117
+
-`bool[]`
118
+
-`int64[]`
119
+
-`float64[]`
120
+
-`string[]`
117
121
118
-
The datatypes are chosen as non-complex datatypes, as defined in the [interface definitions article](articles/interface_definition.html)
122
+
The datatypes are chosen as non-complex datatypes, as defined in the [interface definitions article](interface_definition.html).
119
123
The full complement of datatypes of different bitdepth and unsigned types are avoided to allow interpretation from text based configuration files.
120
124
121
-
`bytes` are included to allow the storage of binary blobs.
122
-
It's use is not recommended but can be very convenient, and explicitly supporting it is better than having people try to abuse other datatypes such as strings.
125
+
Array datatypes support a variety of use cases, e.g.,
126
+
-`byte[]` is included to allow the storage of binary blobs.
127
+
Its use is not recommended but can be very convenient, and explicitly supporting it is better than having people try to abuse other datatypes such as strings.
128
+
-`bool[]` can be useful as a mask for other array parameters.
129
+
-`int64[]` and `float64[]` can be used to express numerical vector and matrix parameters.
130
+
-`string[]` can be used to express groups of names, such as a set of robots in a multi-robot context.
131
+
132
+
While the use of array parameters increases the complexity of the API, their omission would necessitate complex naming schemes for parameters like matrices, which are common in robotics.
133
+
134
+
Only homogenous arrays of datatypes will be supported. This is to avoid the unnecessary complexity of the introspection needed to handle multidimensionality and heterogeneity within the arrays.
135
+
136
+
Arrays should not be abused, however; users should rely on namespacing and explicit variable names wherever possible.
123
137
124
138
### Required functionality
125
139
@@ -210,13 +224,6 @@ A few to highlight:
210
224
There are several ways to load parameters at startup including command line arguments, roslaunch arguments, and potentially parameter files.
211
225
This is something which should be addressed in conjunction with the new launch system.
212
226
213
-
### Support for arrays of primitives
214
-
215
-
During the API discussions supporting arrays of primitives was discussed and deferred.
216
-
Adding support for arrays in the interface is relatively straight forward.
217
-
It slightly increases the complexity of the API for users, but can support several use cases.
218
-
A use case for arrays of numbers is expressing a matrix or vector, addressing each position in a matrix by some sort of row-column naming scheme can get very cumbersome.
219
-
220
227
### Predeclared interface to support static checking/validation
221
228
222
229
The ability to declare an API which can help with static checks and prevent logical errors which arise from setting the wrong parameter based on a typo.
0 commit comments