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
* Overhauled fall detection node to be able to run on pose messages
* Added to_ros_box in bridge, needed for overhauled fall detection node
* Updated fall detection node section
* Minor fix ros1 fall node
* Added to_rox_box in ros2 bridge
* Updated ros2 fall detection node
* Initial version of ros1 wave detection node
* Renamed class
* Added performance to ros1 wave detection node
* Minor fixes in fall_detection_node.py
* Refactored wave_detection_node.py to work similar to fall detection node
* Applied minor fixes to ros2 fall_detection_node.py
* Removed unused import
* Fall detection ros1 - visualization mode now publishes bboxes too
* Fall detection ros2 - visualization mode now publishes bboxes too, fixed bug
* Fall detection ros1 doc minor updates
* Fall detection ros2 doc updated for newly updated node
* Wave detection ros1, added missing docstring and wave detection messages are published in both modes
* Added wave detection entry in node index list
* Added wave detection section entry and fixed minor thing in fall detection section
* Fixed broken link
* Added ros2 wave detection node entry in setup.py
* Added new ros2 wave detection node
* Fixed broken link
* Added wave detection entry in node index list
* Added wave detection section entry and fixed minor thing in fall detection section
* Removed unused import
* Fixed default ctor argument and simplified if/else as suggested by review
* Fixed default ctor argument as suggested by review
* Fixed default ctor argument as suggested by review
* Fixes as suggested by review
* Re-arranged docstring to match actual order of arguments
* Added performance to fall detection ROS1 node
* Fixed performance topic name
* Added performance topic arg entries for wave and fall detection nodes
* Re-arranged docstring to match actual order of arguments
* Added performance to fall detection ROS2 node
* Added performance topic arg entries for wave and fall detection nodes
* Fixed wrong publisher argument in ros2 wave/fall nodes
* Fixed fall_detection_node.py performance measurement
* Fixed wave_detection_node.py performance measurement
* Fixed ROS2 fall_detection_node.py performance measurement
* Fixed ROS2 wave_detection_node.py performance measurement
Copy file name to clipboardExpand all lines: projects/opendr_ws/src/opendr_perception/README.md
+103-13
Original file line number
Diff line number
Diff line change
@@ -127,33 +127,123 @@ The node publishes the detected poses in [OpenDR's 2D pose message format](../op
127
127
128
128
You can find the fall detection ROS node python script [here](./scripts/fall_detection_node.py) to inspect the code and modify it as you wish to fit your needs.
129
129
The node makes use of the toolkit's [fall detection tool](../../../../src/opendr/perception/fall_detection/fall_detector_learner.py) whose documentation can be found [here](../../../../docs/reference/fall-detection.md).
130
-
Fall detection uses the toolkit's pose estimation tool internally.
130
+
Fall detection is rule-based and works on top of pose estimation.
131
131
132
-
<!-- TODO Should add information about taking advantage of the pose estimation ros node when running fall detection, see issue https://github.com/opendr-eu/opendr/issues/282 -->
132
+
This node normally runs on `detection mode` where it subscribes to a topic of OpenDR poses and detects whether the poses are fallen persons or not.
133
+
By providing an image topic the node runs on `visualization mode`. It also gets images, performs pose estimation internally and visualizes the output on an output image topic.
134
+
Note that when providing an image topic the node has significantly worse performance in terms of speed, due to running pose estimation internally.
133
135
134
-
#### Instructions for basic usage:
136
+
- #### Instructions for basic usage in `detection mode`:
135
137
136
-
1. Start the node responsible for publishing images. If you have a USB camera, then you can use the `usb_cam_node` as explained in the [prerequisites above](#prerequisites).
138
+
1. Start the node responsible for publishing poses. Refer to the [pose estimation node above](#pose-estimation-ros-node).
137
139
138
140
2. You are then ready to start the fall detection node:
139
141
140
142
```shell
141
143
rosrun opendr_perception fall_detection_node.py
142
144
```
143
-
The following optional arguments are available:
145
+
The following optional arguments are available and relevant for running fall detection on pose messages only:
144
146
- `-h or --help`: show a help message and exit
145
-
- `-i or --input_rgb_image_topic INPUT_RGB_IMAGE_TOPIC`: topic name for input RGB image (default=`/usb_cam/image_raw`)
146
-
- `-o or --output_rgb_image_topic OUTPUT_RGB_IMAGE_TOPIC`: topic name for output annotated RGB image, `None` to stop the node from publishing on this topic (default=`/opendr/image_fallen_annotated`)
147
-
- `-d or --detections_topic DETECTIONS_TOPIC`: topic name for detection messages, `None` to stop the node from publishing on this topic (default=`/opendr/fallen`)
148
-
- `--performance_topic PERFORMANCE_TOPIC`: topic name for performance messages (default=`None`, disabled)
147
+
- `-ip or --input_pose_topic INPUT_POSE_TOPIC`: topic name for input pose, `None` to stop the node from running detections on pose messages (default=`/opendr/poses`)
148
+
- `-d or --detections_topic DETECTIONS_TOPIC`: topic name for detection messages (default=`/opendr/fallen`)
149
+
- `--performance_topic PERFORMANCE_TOPIC`: topic name for performance messages, note that performance will be published to `PERFORMANCE_TOPIC/fallen` (default=`None`, disabled)
150
+
151
+
3. Detections are published on the `detections_topic`
152
+
153
+
- #### Instructions for `visualization mode`:
154
+
155
+
1. Start the node responsible forpublishing images. If you have a USB camera, then you can use the `usb_cam_node` as explainedin the [prerequisites above](#prerequisites).
156
+
157
+
2. You are then ready to start the fall detection node in`visualization mode`, which needs an input image topic to be provided:
The following optional arguments are available and relevant for running fall detection on images. Note that the
163
+
`input_rgb_image_topic` is required forrunningin`visualization mode`:
164
+
- `-h or --help`: show a help message and exit
165
+
- `-ii or --input_rgb_image_topic INPUT_RGB_IMAGE_TOPIC`: topic name for input RGB image (default=`None`)
166
+
- `-o or --output_rgb_image_topic OUTPUT_RGB_IMAGE_TOPIC`: topic name for output annotated RGB image (default=`/opendr/image_fallen_annotated`)
167
+
- `-d or --detections_topic DETECTIONS_TOPIC`: topic name for detection messages (default=`/opendr/fallen`)
168
+
- `--performance_topic PERFORMANCE_TOPIC`: topic name for performance messages, note that performance will be published to `PERFORMANCE_TOPIC/image` (default=`None`, disabled)
149
169
- `--device DEVICE`: device to use, either `cpu` or `cuda`, falls back to `cpu`if GPU or CUDA is not found (default=`cuda`)
150
170
- `--accelerate`: acceleration flag that causes pose estimation that runs internally to run faster but with less accuracy
151
171
152
-
3. Default output topics:
153
-
- Output images: `/opendr/image_fallen_annotated`
154
-
- Detection messages: `/opendr/fallen`
172
+
- Default output topics:
173
+
- Detection messages: `/opendr/fallen`
174
+
- Output images: `/opendr/image_fallen_annotated`
155
175
156
-
For viewing the output, refer to the [notes above.](#notes)
176
+
For viewing the output, refer to the [notes above.](#notes)
177
+
178
+
**Notes**
179
+
180
+
Note that when the node runs on the default `detection mode` it is significantly faster than when it is provided with an
181
+
input image topic. However, pose estimation needs to be performed externally on another node which publishes poses.
182
+
When an input image topic is provided and the node runs in`visualization mode`, it runs pose estimation internally, and
183
+
consequently it is recommended to only use it fortesting purposes and not run other pose estimation nodesin parallel.
184
+
The node can run in both modes in parallel or only on one of the two. To run the node only on `visualization mode` provide
185
+
the argument `-ip None` to disable the `detection mode`. Detection messages on `detections_topic` are published in both modes.
186
+
187
+
### Wave Detection ROS Node
188
+
189
+
You can find the wave detection ROS node python script [here](./scripts/wave_detection_node.py) to inspect the code and modify it as you wish to fit your needs.
190
+
The node is based on a [wave detection demo of the Lightweight OpenPose tool](../../../../projects/python/perception/pose_estimation/lightweight_open_pose/demos/wave_detection_demo.py).
191
+
Wave detection is rule-based and works on top of pose estimation.
192
+
193
+
This node normally runs on `detection mode` where it subscribes to a topic of OpenDR poses and detects whether the poses are waving or not.
194
+
By providing an image topic the node runs on `visualization mode`. It also gets images, performs pose estimation internally and visualizes the output on an output image topic.
195
+
Note that when providing an image topic the node has significantly worse performance in terms of speed, due to running pose estimation internally.
196
+
197
+
- #### Instructions for basic usage in `detection mode`:
198
+
199
+
1. Start the node responsible for publishing poses. Refer to the [pose estimation node above](#pose-estimation-ros-node).
200
+
201
+
2. You are then ready to start the wave detection node:
202
+
203
+
```shell
204
+
rosrun opendr_perception wave_detection_node.py
205
+
```
206
+
The following optional arguments are available and relevant for running fall detection on pose messages only:
207
+
- `-h or --help`: show a help message and exit
208
+
- `-ip or --input_pose_topic INPUT_POSE_TOPIC`: topic name for input pose, `None` to stop the node from running detections on pose messages (default=`/opendr/poses`)
209
+
- `-d or --detections_topic DETECTIONS_TOPIC`: topic name for detection messages (default=`/opendr/wave`)
210
+
- `--performance_topic PERFORMANCE_TOPIC`: topic name for performance messages, note that performance will be published to `PERFORMANCE_TOPIC/wave` (default=`None`, disabled)
211
+
212
+
3. Detections are published on the `detections_topic`
213
+
214
+
- #### Instructions for `visualization mode`:
215
+
216
+
1. Start the node responsible forpublishing images. If you have a USB camera, then you can use the `usb_cam_node` as explainedin the [prerequisites above](#prerequisites).
217
+
218
+
2. You are then ready to start the wave detection node in`visualization mode`, which needs an input image topic to be provided:
The following optional arguments are available and relevant for running wave detection on images. Note that the
224
+
`input_rgb_image_topic` is required forrunningin`visualization mode`:
225
+
- `-h or --help`: show a help message and exit
226
+
- `-ii or --input_rgb_image_topic INPUT_RGB_IMAGE_TOPIC`: topic name for input RGB image (default=`None`)
227
+
- `-o or --output_rgb_image_topic OUTPUT_RGB_IMAGE_TOPIC`: topic name for output annotated RGB image (default=`/opendr/image_wave_annotated`)
228
+
- `-d or --detections_topic DETECTIONS_TOPIC`: topic name for detection messages (default=`/opendr/wave`)
229
+
- `--performance_topic PERFORMANCE_TOPIC`: topic name for performance messages, note that performance will be published to `PERFORMANCE_TOPIC/image` (default=`None`, disabled)
230
+
- `--device DEVICE`: device to use, either `cpu` or `cuda`, falls back to `cpu`if GPU or CUDA is not found (default=`cuda`)
231
+
- `--accelerate`: acceleration flag that causes pose estimation that runs internally to run faster but with less accuracy
232
+
233
+
- Default output topics:
234
+
- Detection messages: `/opendr/wave`
235
+
- Output images: `/opendr/image_wave_annotated`
236
+
237
+
For viewing the output, refer to the [notes above.](#notes)
238
+
239
+
**Notes**
240
+
241
+
Note that when the node runs on the default `detection mode` it is significantly faster than when it is provided with an
242
+
input image topic. However, pose estimation needs to be performed externally on another node which publishes poses.
243
+
When an input image topic is provided and the node runs in`visualization mode`, it runs pose estimation internally, and
244
+
consequently it is recommended to only use it fortesting purposes and not run other pose estimation nodesin parallel.
245
+
The node can run in both modes in parallel or only on one of the two. To run the node only on `visualization mode` provide
246
+
the argument `-ip None` to disable the `detection mode`. Detection messages on `detections_topic` are published in both modes.
0 commit comments