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
The types of parameters supported by the ROS tooling are the following:
4
+
5
+
* Boolean (true or false)
6
+
* Integer
7
+
* Double
8
+
* String
9
+
* Base64
10
+
* List
11
+
* Array
12
+
* Struct
13
+
14
+
and their description is allowed at ROS and ROSSystem model level.
15
+
16
+
For the complete definition of parameters the user has to open the ROS model editor, where the language format is the following:
17
+
```
18
+
**parameters:**
19
+
ParameterName:
20
+
**type:** ParameterType
21
+
**value:** ParameterValue
22
+
```
23
+
24
+
For example (for a .ros2 file):
25
+
26
+
```
27
+
test_parameters:
28
+
artifacts:
29
+
test_parameters:
30
+
node: params_example
31
+
parameters:
32
+
string_test:
33
+
type: String
34
+
bool_test:
35
+
type: Boolean
36
+
array_test:
37
+
type: Array [String]
38
+
base64_test:
39
+
type: Base64
40
+
double_test:
41
+
type: Double
42
+
integer_test:
43
+
type: Integer
44
+
list_test:
45
+
type: List [Integer,Integer,String]
46
+
array_test:
47
+
type: Array [String]
48
+
struct_test:
49
+
type: Struct [hello Integer, what String]
50
+
```
51
+
52
+
These parameters can be re-set at Rossystem level (that means for ROS developers, the case of the set of a new parameter value within a node include on a ROS launch file). For the tooling the format is the following:
53
+
54
+
```
55
+
- ParameterName : ParameterReferenceInRos2File
56
+
**value:** ParameterValue
57
+
```
58
+
59
+
Continuing the previous example, the parameters redefinition looks:
60
+
61
+
```
62
+
test:
63
+
nodes:
64
+
params_node:
65
+
from: "test_parameters.params_example"
66
+
parameters:
67
+
- test_s : "test_parameters::string_test"
68
+
value: "hello"
69
+
- test_b : "test_parameters::bool_test"
70
+
value: true
71
+
- test_d : "test_parameters::double_test"
72
+
value: 1.1
73
+
- test_i : "test_parameters::integer_test"
74
+
value: 1
75
+
- test_l: "test_parameters::list_test"
76
+
value: [1,1,"hello"]
77
+
- test_a: "test_parameters::array_test"
78
+
value: ["hello", "hola", "hallo"]
79
+
- test_st: "test_parameters::struct_test"
80
+
value: [
81
+
hello: 1
82
+
what: "test"]
83
+
```
84
+
The model definition of parameters is also consider for the autogeneration of launch files and the component interfaces. Complementarily, and because of the complexity of the format, the .ros, the .componentinterface and the .rossystem language validators contain rules to check that the value given to the parameter has the correct type and also help messages that together with the auto-complete function (Ctrl+Space) facilitate to the user the creation of parameters.
Copy file name to clipboardExpand all lines: plugins/de.fraunhofer.ipa.ros.xtext.ide/src-gen/de/fraunhofer/ipa/ros/ide/contentassist/antlr/BasicsParser.java
Copy file name to clipboardExpand all lines: plugins/de.fraunhofer.ipa.ros.xtext.ide/src-gen/de/fraunhofer/ipa/ros/ide/contentassist/antlr/RosParser.java
Copy file name to clipboardExpand all lines: plugins/de.fraunhofer.ipa.ros.xtext.ide/src-gen/de/fraunhofer/ipa/ros/ide/contentassist/antlr/internal/InternalBasicsParser.g
0 commit comments