README.md 13.6 KB
Newer Older
João Reis's avatar
João Reis committed
1
2
3
4
RoAH RSBB Comm ROS
==================

This repository contains a ROS package that can be used to communicate
Enri2077's avatar
Enri2077 committed
5
with the ERL-SR RSBB (Referee, Scoring and Benchmarking Box).
Enri2077's avatar
Enri2077 committed
6
To install and know more about the RSBB, see [this repo](https://github.com/rockin-robot-challenge/rsbb).
João Reis's avatar
João Reis committed
7

Enri2077's avatar
Enri2077 committed
8
The repository *RoAH RSBB Comm* from https://github.com/rockin-robot-challenge/at_home_rsbb_comm is included as a git submodule.
João Reis's avatar
João Reis committed
9
10
11
12

:warning: Please remember to always update right before the competitions!
```bash
git pull
13
git submodule update --init
João Reis's avatar
João Reis committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
```


## Dependencies

You need to have installed a C++11 compiler, CMake, Boost, Protobuf
and OpenSSL.

If you are using Ubuntu, install the dependencies with:
```bash
sudo apt-get install build-essential cmake libboost-all-dev libprotoc-dev protobuf-compiler libssl-dev
```

Furthermore, you need to use at least ROS Hydro, follow the
instructions at http://wiki.ros.org/ROS/Installation/ .

João M. Pereira's avatar
João M. Pereira committed
30
This package was successfully tested on Ubuntu 12, 14, 16 and 18.
João Reis's avatar
João Reis committed
31
32
33
34
35
36


## Compiling

After `git clone` and after every `git pull`, please do:
```bash
37
git submodule update --init
João Reis's avatar
João Reis committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
```

Compile as a normal ROS package in your Catkin workspace.


## Running

Use the launch file `test.launch` as a base to run the node in your
launch files. All parameters except `team_name` and `rsbb_key` have
sensible defaults. You might also want to set `robot_name`. It can
be simplified, you migth use just something like this:
```xml
  <node pkg="roah_rsbb_comm_ros" type="comm" name="roah_rsbb_comm" respawn="true">
    <param name="team_name" type="string" value="WinnerTeam"/>
    <param name="robot_name" type="string" value="Ronaldo"/>
    <param name="rsbb_key" type="string" value="TEAM_PRIVATE_PASSWORD"/>
  </node>
```

To simply test the node, you can use:
```bash
roslaunch roah_rsbb_comm_ros test.launch --screen
```

João Reis's avatar
João Reis committed
62
63
64
65
66
67
To launch a dummy robot implementation to check communication use:
```bash
roslaunch roah_rsbb_comm_ros dummy.launch --screen
```

Both the test and the dummy launch files can take the address of the RSBB as a parameter:
Enri2077's avatar
Enri2077 committed
68
`rsbb_host:=10.2.0.255` . This should be set to the `Bcast` of the interface you want to use, as reported by `ifconfig`. Alternatively, you can use the address of the RSBB directly.
João Reis's avatar
João Reis committed
69

João Reis's avatar
João Reis committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

## Using the Node

During operation, the node always publishes some topics.

| Topic                        | Type                              | Notes                                              |
|:----------------------------:|:---------------------------------:|:--------------------------------------------------:|
| `/roah_rsbb/benchmark`       | `roah_rsbb_comm_ros/Benchmark`    | Latched, always published, defaults to `NONE`      |
| `/roah_rsbb/devices/bell`    | `std_msgs/Empty`                  | Not latched, published when the bell rings         |
| `/roah_rsbb/devices/state`   | `roah_rsbb_comm_ros/DevicesState` | Latched, published on reception                    |
| `/roah_rsbb/tablet/call`     | `std_msgs/Empty`                  | Not latched, published when granny calls           |
| `/roah_rsbb/tablet/position` | `geometry_msgs/Pose2D`            | Not latched, published when a position is selected |
| `/roah_rsbb/tablet/state`    | `roah_rsbb_comm_ros/TabletState`  | Latched, published on reception                    |

Topics and services for the benchmarks are only available when the
benchmark starts and `/roah_rsbb/benchmark` becomes something not
`NONE`.

Some topics are common to all benchmarks:

| Topic                        | Type                                | Notes                                              |
|:----------------------------:|:-----------------------------------:|:--------------------------------------------------:|
92
| `/roah_rsbb/messages_saved`  | `std_msgs/UInt32`                   | Never published, only received.                    |
João Reis's avatar
João Reis committed
93
94
| `/roah_rsbb/benchmark/state` | `roah_rsbb_comm_ros/BenchmarkState` | Latched, always published, defaults to `STOP`      |

95
Topic `/roah_rsbb/messages_saved` should be used to send to the RSBB
João Reis's avatar
João Reis committed
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
some kind of metric that shows that offline messages are being
saved. Number of messages or size of the bag file can be used.
This information is only used to issue a warning as soon as
possible if data is not being recorded.

Topic `/roah_rsbb/benchmark/state` has 3 possibilities:
- **STOP**: Stop the robot.
- **PREPARE**: Prepare for benchmark. Move to position.
- **EXECUTE**: Execute goal.

After `EXECUTE`, for multiple goals (in functionality benchmarks)
`PREPARE` will be issued again until there are no more goals.

The robot can signal that `PREPARE` or `EXECUTE` are complete using
the services:

| Service                  | Type             | Notes                           |
|:------------------------:|:----------------:|:-------------------------------:|
| `/roah_rsbb/end_prepare` | `std_srvs/Empty` | Only available during `PREPARE` |
| `/roah_rsbb/end_execute` | `std_srvs/Empty` | Only available during `EXECUTE` |


#### Getting to know my home

No special topics or services.


#### Welcoming visitors

| Service                       | Type                        | Notes       |
|:-----------------------------:|:---------------------------:|:-----------:|
| `/roah_rsbb/activation_event` | `roah_rsbb_comm_ros/String` | Online data |
| `/roah_rsbb/notifications`    | `roah_rsbb_comm_ros/String` | Online data |
| `/roah_rsbb/visitor`          | `roah_rsbb_comm_ros/String` | Online data |


#### Catering for Granny Annie’s Comfort

| Service                           | Type                            | Notes         |
|:---------------------------------:|:-------------------------------:|:-------------:|
| `/roah_rsbb/devices/blinds/max`   | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/blinds/min`   | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/blinds/set`   | `roah_rsbb_comm_ros/Percentage` | 0 <= % <= 100 |
| `/roah_rsbb/devices/dimmer/max`   | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/dimmer/min`   | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/dimmer/set`   | `roah_rsbb_comm_ros/Percentage` | 0 <= % <= 100 |
| `/roah_rsbb/devices/switch_1/off` | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/switch_1/on`  | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/switch_1/set` | `roah_rsbb_comm_ros/Bool`       |               |
| `/roah_rsbb/devices/switch_2/off` | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/switch_2/on`  | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/switch_2/set` | `roah_rsbb_comm_ros/Bool`       |               |
| `/roah_rsbb/devices/switch_3/off` | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/switch_3/on`  | `std_srvs/Empty`                |               |
| `/roah_rsbb/devices/switch_3/set` | `roah_rsbb_comm_ros/Bool`       |               |
| `/roah_rsbb/tablet/buttons`       | `std_srvs/Empty`                |               |
| `/roah_rsbb/tablet/map`           | `std_srvs/Empty`                |               |
| `/roah_rsbb/final_command`        | `roah_rsbb_comm_ros/String`     | Online data   |


#### Object Perception Functionality

This benchmark has a result, therefore the `/roah_rsbb/end_execute`
João M. Pereira's avatar
João M. Pereira committed
159
service has a different type:
João Reis's avatar
João Reis committed
160
161
162
163
164

| Service                  | Type                            | Notes                           |
|:------------------------:|:-------------------------------:|:-------------------------------:|
| `/roah_rsbb/end_execute` | `roah_rsbb_comm_ros/ResultHOPF` | Only available during `EXECUTE` |

Enri2077's avatar
Enri2077 committed
165
<!---
João Reis's avatar
João Reis committed
166
167
168
169
170
171
172
173
174
175
176
177
178
#### Object Manipulation Functionality

This benchmark has specific goals, therefore a new topic is needed.

| Topic             | Type                           | Notes                           |
|:-----------------:|:------------------------------:|:-------------------------------:|
| `/roah_rsbb/goal` | `roah_rsbb_comm_ros/Benchmark` | Latched, when goal is available |

Note that `/roah_rsbb/benchmark/state` and `/roah_rsbb/goal` change
almost simultaneously but in an undefined order. For this benchmark
alone you can assume that whenever a goal is published the state
has changed to `EXECUTE`. Therefore, you only need to receive the
`STOP` and `PREPARE` states on the state topic.
Enri2077's avatar
Enri2077 committed
179
--->
João Reis's avatar
João Reis committed
180

Enri2077's avatar
Enri2077 committed
181
182

#### Navigation Functionality
João M. Pereira's avatar
João M. Pereira committed
183
184
185
186

In this benchmark, waypoints are sent to the robot one by one. Waypoints are published as Pose2D messages to the `/roah_rsbb/goal` topic.

After the robot calls `end_execute` the next waypoint is sent, and this repeats for all waypoints.
Enri2077's avatar
Enri2077 committed
187

João Reis's avatar
João Reis committed
188
189
190
191
#### Speech Understanding Functionality

No special topics or services.

João M. Pereira's avatar
João M. Pereira committed
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
#### People Perception Functionality

This benchmark has a result (the robot's guess of the person's name and position), therefore the `/roah_rsbb/end_execute`
service has a different type:

| Service                  | Type                            | Notes                           |
|:------------------------:|:-------------------------------:|:-------------------------------:|
| `/roah_rsbb/end_execute` | `roah_rsbb_comm_ros/ResultHPPF` | Only available during `EXECUTE` |

#### Person Following Functionality

No special topics or services. This benchmark is a bit unorthodox: after execution is requested,
the robot should start following the person, and shouldn't call the `end_execute` service: there is no timeout in this challenge.

#### Grasping and Manipulation Functionality

In this benchmark, the type of object to be grasped and the position where it should be placed are sent to the robot
as `GoalHGMF` messages published to the `/roah_rsbb/goal` topic.
João Reis's avatar
João Reis committed
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303

## Overriding benchmark selection for testing

The override service can be used to simulate RSBB input, for testing.

| Service               | Type                          | Notes            |
|:---------------------:|:-----------------------------:|:----------------:|
| `/roah_rsbb/override` | `roah_rsbb_comm_ros/Override` | Always available |

To know if the proper responses are being sent back to the RSBB you
have to use `rqt_logger_level` to set `ros.roah_rsbb_comm_ros` to the
Debug level. Then use `rqt_console` to see if the messages contain
the appropriate content. The robot states and benchmark states used
for communication are more complex than the ones presented here, but
they do not need to be fully understood to check the messages.
Still, full information is available here: https://github.com/joaocgreis/roah_rsbb_comm .

To revert the node to normal operation use:
```bash
rosservice call /roah_rsbb/override "{benchmark_type: 0}"
```

#### Getting to know my home

The benchmarks all follow the same structure.

- Start the benchmark in stop state:
```bash
rosservice call /roah_rsbb/override "{benchmark_type: 1, benchmark_state: 0}"
```

- Start preparing:
```bash
rosservice call /roah_rsbb/override "{benchmark_type: 1, benchmark_state: 1}"
```

- The robot should prepare and then call the end_prepare service as if by
`rosservice call /roah_rsbb/end_prepare`

- Send the goal (nothing in this case, just a start signal):
```bash
rosservice call /roah_rsbb/override "{benchmark_type: 1, benchmark_state: 2}"
```

- As soon as the RSBB detects the robot is executing, it should start
waiting for the result:
```bash
rosservice call /roah_rsbb/override "{benchmark_type: 1, benchmark_state: 3}"
```

The robot should run and then call the end_execute service as if by
`rosservice call /roah_rsbb/end_execute` to complete the goal.

For benchmarks with more goals, the RSBB asks to start preparing
until complete, then stop.

If a timeout occurs, a stop is sent.


#### Welcoming visitors

```bash
rosservice call /roah_rsbb/override "{benchmark_type: 2, benchmark_state: 0}"
rosservice call /roah_rsbb/override "{benchmark_type: 2, benchmark_state: 1}"
rosservice call /roah_rsbb/override "{benchmark_type: 2, benchmark_state: 2}"
rosservice call /roah_rsbb/override "{benchmark_type: 2, benchmark_state: 3}"
```


#### Catering for Granny Annie’s Comfort

```bash
rosservice call /roah_rsbb/override "{benchmark_type: 3, benchmark_state: 0}"
rosservice call /roah_rsbb/override "{benchmark_type: 3, benchmark_state: 1}"
rosservice call /roah_rsbb/override "{benchmark_type: 3, benchmark_state: 2}"
rosservice call /roah_rsbb/override "{benchmark_type: 3, benchmark_state: 3}"
```


#### Object Perception Functionality

```bash
rosservice call /roah_rsbb/override "{benchmark_type: 4, benchmark_state: 0}"
rosservice call /roah_rsbb/override "{benchmark_type: 4, benchmark_state: 1}"
rosservice call /roah_rsbb/override "{benchmark_type: 4, benchmark_state: 2}"
rosservice call /roah_rsbb/override "{benchmark_type: 4, benchmark_state: 3}"
```

The goal should be completed with something like:

```bash
rosservice call /roah_rsbb/end_execute "{object_class: cups, object_name: red_cup, object_pose: {x: 0.1, y: 0.2, theta: 1.23} }"
```

Enri2077's avatar
Enri2077 committed
304
<!--
João Reis's avatar
João Reis committed
305
306
307
308
309
310
311
312
#### Object Manipulation Functionality

```bash
rosservice call /roah_rsbb/override "{benchmark_type: 5, benchmark_state: 0}"
rosservice call /roah_rsbb/override "{benchmark_type: 5, benchmark_state: 1}"
rosservice call /roah_rsbb/override "{benchmark_type: 5, benchmark_state: 2, initial_state: [false, true, false, true, true, false, true, false, false, true], switches: [4, 3, 1, 7, 8]}"
rosservice call /roah_rsbb/override "{benchmark_type: 5, benchmark_state: 3}"
```
Enri2077's avatar
Enri2077 committed
313
-->
João Reis's avatar
João Reis committed
314
315
316
317
318
319
320
321
322

#### Speech Understanding Functionality

```bash
rosservice call /roah_rsbb/override "{benchmark_type: 6, benchmark_state: 0}"
rosservice call /roah_rsbb/override "{benchmark_type: 6, benchmark_state: 1}"
rosservice call /roah_rsbb/override "{benchmark_type: 6, benchmark_state: 2}"
rosservice call /roah_rsbb/override "{benchmark_type: 6, benchmark_state: 3}"
```
João M. Pereira's avatar
João M. Pereira committed
323
324
325
326

## Support

If you have any questions, please add them as issues on this repo.