Skip to content

Commit 82ed0cc

Browse files
Merge branch 'ros-planning:main' into rewrite_param-multirobot-namespace-topic
2 parents 9b24655 + f1f968b commit 82ed0cc

25 files changed

+1508
-45
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ _commands:
3333
- restore_cache:
3434
name: Restore Cache << parameters.key >>
3535
keys:
36-
- "<< parameters.key >>-v15\
36+
- "<< parameters.key >>-v16\
3737
-{{ arch }}\
3838
-{{ .Branch }}\
3939
-{{ .Environment.CIRCLE_PR_NUMBER }}\
4040
-{{ checksum \"<< parameters.workspace >>/lockfile.txt\" }}"
41-
- "<< parameters.key >>-v15\
41+
- "<< parameters.key >>-v16\
4242
-{{ arch }}\
4343
-main\
4444
-<no value>\
@@ -58,7 +58,7 @@ _commands:
5858
steps:
5959
- save_cache:
6060
name: Save Cache << parameters.key >>
61-
key: "<< parameters.key >>-v15\
61+
key: "<< parameters.key >>-v16\
6262
-{{ arch }}\
6363
-{{ .Branch }}\
6464
-{{ .Environment.CIRCLE_PR_NUMBER }}\

nav2_behavior_tree/include/nav2_behavior_tree/ros_topic_logger.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class RosTopicLogger : public BT::StatusChangeLogger
6969
// before converting to a msg.
7070
event.timestamp = tf2_ros::toMsg(tf2::TimePoint(timestamp));
7171
event.node_name = node.name();
72+
event.uid = node.UID();
7273
event.previous_status = toStr(prev_status, false);
7374
event.current_status = toStr(status, false);
7475
event_log_.push_back(std::move(event));

nav2_bringup/rviz/nav2_default_view.rviz

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ Visualization Manager:
560560
Value: true
561561
Views:
562562
Current:
563-
Angle: -1.6150002479553223
563+
Angle: -1.5708
564564
Class: rviz_default_plugins/TopDownOrtho
565565
Enable Stereo Rendering:
566566
Stereo Eye Separation: 0.05999999865889549
@@ -570,11 +570,11 @@ Visualization Manager:
570570
Invert Z Axis: false
571571
Name: Current View
572572
Near Clip Distance: 0.009999999776482582
573-
Scale: 127.88431549072266
573+
Scale: 160
574574
Target Frame: <Fixed Frame>
575575
Value: TopDownOrtho (rviz_default_plugins)
576-
X: -0.044467076659202576
577-
Y: -0.38726311922073364
576+
X: 0
577+
Y: 0
578578
Saved: ~
579579
Window Geometry:
580580
Displays:

nav2_bringup/rviz/nav2_namespaced_view.rviz

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ Visualization Manager:
342342
Value: true
343343
Views:
344344
Current:
345-
Angle: -1.5700000524520874
345+
Angle: -1.5708
346346
Class: rviz_default_plugins/TopDownOrtho
347347
Enable Stereo Rendering:
348348
Stereo Eye Separation: 0.05999999865889549
@@ -352,11 +352,11 @@ Visualization Manager:
352352
Invert Z Axis: false
353353
Name: Current View
354354
Near Clip Distance: 0.009999999776482582
355-
Scale: 134.638427734375
355+
Scale: 160
356356
Target Frame: <Fixed Frame>
357357
Value: TopDownOrtho (rviz_default_plugins)
358-
X: -0.032615214586257935
359-
Y: -0.0801941454410553
358+
X: 0
359+
Y: 0
360360
Saved: ~
361361
Window Geometry:
362362
Displays:

nav2_bringup/worlds/world_only.model

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<gui fullscreen='0'>
1818
<camera name='user_camera'>
19-
<pose frame=''>0.319654 -0.235002 9.29441 0 1.5138 0.009599</pose>
19+
<pose frame=''>0 0 10 0 1.570796 0</pose>
2020
<view_controller>orbit</view_controller>
2121
<projection_type>perspective</projection_type>
2222
</camera>

nav2_collision_monitor/CMakeLists.txt

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ set(dependencies
3939
nav2_msgs
4040
)
4141

42-
set(executable_name collision_monitor)
43-
set(library_name ${executable_name}_core)
42+
set(monitor_executable_name collision_monitor)
43+
set(detector_executable_name collision_detector)
44+
set(monitor_library_name ${monitor_executable_name}_core)
45+
set(detector_library_name ${detector_executable_name}_core)
4446

45-
add_library(${library_name} SHARED
47+
add_library(${monitor_library_name} SHARED
4648
src/collision_monitor_node.cpp
4749
src/polygon.cpp
4850
src/circle.cpp
@@ -52,34 +54,59 @@ add_library(${library_name} SHARED
5254
src/range.cpp
5355
src/kinematics.cpp
5456
)
57+
add_library(${detector_library_name} SHARED
58+
src/collision_detector_node.cpp
59+
src/polygon.cpp
60+
src/circle.cpp
61+
src/source.cpp
62+
src/scan.cpp
63+
src/pointcloud.cpp
64+
src/range.cpp
65+
src/kinematics.cpp
66+
)
5567

56-
add_executable(${executable_name}
57-
src/main.cpp
68+
add_executable(${monitor_executable_name}
69+
src/collision_monitor_main.cpp
70+
)
71+
add_executable(${detector_executable_name}
72+
src/collision_detector_main.cpp
5873
)
5974

60-
ament_target_dependencies(${library_name}
75+
ament_target_dependencies(${monitor_library_name}
76+
${dependencies}
77+
)
78+
ament_target_dependencies(${detector_library_name}
6179
${dependencies}
6280
)
6381

64-
target_link_libraries(${executable_name}
65-
${library_name}
82+
target_link_libraries(${monitor_executable_name}
83+
${monitor_library_name}
84+
)
85+
target_link_libraries(${detector_executable_name}
86+
${detector_library_name}
87+
)
88+
89+
ament_target_dependencies(${monitor_executable_name}
90+
${dependencies}
6691
)
6792

68-
ament_target_dependencies(${executable_name}
93+
ament_target_dependencies(${detector_executable_name}
6994
${dependencies}
7095
)
7196

72-
rclcpp_components_register_nodes(${library_name} "nav2_collision_monitor::CollisionMonitor")
97+
rclcpp_components_register_nodes(${monitor_library_name} "nav2_collision_monitor::CollisionMonitor")
98+
99+
rclcpp_components_register_nodes(${detector_library_name} "nav2_collision_monitor::CollisionDetector")
73100

74101
### Install ###
75102

76-
install(TARGETS ${library_name}
103+
install(TARGETS ${monitor_library_name} ${detector_library_name}
77104
ARCHIVE DESTINATION lib
78105
LIBRARY DESTINATION lib
79106
RUNTIME DESTINATION bin
80107
)
81108

82-
install(TARGETS ${executable_name}
109+
install(TARGETS ${monitor_executable_name} ${detector_executable_name}
83110
RUNTIME DESTINATION lib/${PROJECT_NAME}
84111
)
85112

@@ -106,7 +133,7 @@ endif()
106133
### Ament stuff ###
107134

108135
ament_export_include_directories(include)
109-
ament_export_libraries(${library_name})
136+
ament_export_libraries(${monitor_library_name} ${detector_library_name})
110137
ament_export_dependencies(${dependencies})
111138

112139
ament_package()

nav2_collision_monitor/README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Nav2 Collision Monitor
22

3+
## Collision Monitor
4+
35
The Collision Monitor is a node providing an additional level of robot safety.
46
It performs several collision avoidance related tasks using incoming data from the sensors, bypassing the costmap and trajectory planners, to monitor for and prevent potential collisions at the emergency-stop level.
57

@@ -12,7 +14,7 @@ The costmaps / trajectory planners will handle most situations, but this is to h
1214

1315
![polygons.png](doc/polygons.png)
1416

15-
## Features
17+
### Features
1618

1719
The Collision Monitor uses polygons relative the robot's base frame origin to define "zones".
1820
Data that fall into these zones trigger an operation depending on the model being used.
@@ -23,7 +25,6 @@ The following models of safety behaviors are employed by Collision Monitor:
2325

2426
* **Stop model**: Define a zone and a point threshold. If more that `N` obstacle points appear inside this area, stop the robot until the obstacles will disappear.
2527
* **Slowdown model**: Define a zone around the robot and slow the maximum speed for a `%S` percent, if more than `N` points will appear inside the area.
26-
* **Limit model**: Define a zone around the robot and clamp the maximum speed below a fixed value, if more than `N` points will appear inside the area.
2728
* **Approach model**: Using the current robot speed, estimate the time to collision to sensor data. If the time is less than `M` seconds (0.5, 2, 5, etc...), the robot will slow such that it is now at least `M` seconds to collision. The effect here would be to keep the robot always `M` seconds from any collision.
2829

2930
The zones around the robot can take the following shapes:
@@ -38,20 +39,19 @@ The data may be obtained from different data sources:
3839
* PointClouds (`sensor_msgs::msg::PointCloud2` messages)
3940
* IR/Sonars (`sensor_msgs::msg::Range` messages)
4041

41-
## Design
42+
### Design
4243

4344
The Collision Monitor is designed to operate below Nav2 as an independent safety node.
4445
This acts as a filter on the `cmd_vel` topic coming out of the Controller Server. If no such zone is triggered, then the Controller's `cmd_vel` is used. Else, it is scaled or set to stop as appropriate.
4546

4647
The following diagram is showing the high-level design of Collision Monitor module. All shapes (Polygons and Circles) are derived from base `Polygon` class, so without loss of generality we can call them as polygons. Subscribed footprint is also having the same properties as other polygons, but it is being obtained a footprint topic for the Approach Model.
4748
![HLD.png](doc/HLD.png)
48-
49-
## Configuration
49+
### Configuration
5050

5151
Detailed configuration parameters, their description and how to setup a Collision Monitor could be found at its [Configuration Guide](https://navigation.ros.org/configuration/packages/configuring-collision-monitor.html) and [Using Collision Monitor tutorial](https://navigation.ros.org/tutorials/docs/using_collision_monitor.html) pages.
5252

5353

54-
## Metrics
54+
### Metrics
5555

5656
Designed to be used in wide variety of robots (incl. moving fast) and have a high level of reliability, Collision Monitor node should operate at fast rates.
5757
Typical one frame processing time is ~4-5ms for laser scanner (with 360 points) and ~4-20ms for PointClouds (having 24K points).
@@ -66,3 +66,21 @@ The following notes could be made:
6666

6767
* Due to sheer speed, circle shapes are preferred for the approach behavior models if you can approximately model your robot as circular.
6868
* More points mean lower performance. Pointclouds could be culled or filtered before the Collision Monitor to improve performance.
69+
70+
71+
## Collision Detector
72+
73+
In some cases, the user may want to be informed about the detected obstacles without affecting the robot's velocity and instead take a different action within an external node. For example, the user may want to blink LEDs or sound an alarm when the robot is close to an obstacle. Another use case could be to detect data points in particular regions (e.g extremely close to the sensor) and warn of malfunctioning sensors. For this purpose, the Collision Detector node was introduced.
74+
75+
It works similarly to the Collision Monitor, but does not affect the robot's velocity. It will only inform that data from the configured sources has been detected within the configured polygons via message to the `collision_detector_state` topic.
76+
77+
### Features
78+
79+
Similarly to the Collision Monitor, the Collision Detector uses polygons relative the robot's base frame origin to define "zones".
80+
However, unlike the Collision Monitor that uses different behavior models, the Collision Detector does not use any of them and therefore the `action_type` should always be set to `none`. If set to anything else, it will implicitly be set to `none` and yield a warning.
81+
82+
The zones around the robot and the data sources are the same as for the Collision Monitor, with the exception of the footprint polygon, which is not supported by the Collision Detector.
83+
84+
### Configuration
85+
86+
Detailed configuration parameters, their description and how to setup a Collision Detector could be found at its [Configuration Guide](https://navigation.ros.org/configuration/packages/configuring-collision-detector.html).

0 commit comments

Comments
 (0)