Skip to content

Commit 46e809e

Browse files
AlexeyMerzlyakovJoshua Wallace
authored andcommitted
Smoothness metrics update (ros-navigation#3294)
* Update metrics for path smoothness * Support Savitzky-Golay smoother
1 parent eef402b commit 46e809e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

tools/smoother_benchmarking/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ planner_server:
3030
```
3131
smoother_server:
3232
ros__parameters:
33-
smoother_plugins: ["simple_smoother", "constrained_smoother"]
33+
smoother_plugins: ["simple_smoother", "constrained_smoother", "sg_smoother"]
3434
simple_smoother:
3535
plugin: "nav2_smoother::SimpleSmoother"
3636
constrained_smoother:
3737
plugin: "nav2_constrained_smoother/ConstrainedSmoother"
3838
w_smooth: 100000.0 # tuned
39+
sg_smoother:
40+
plugin: "nav2_smoother::SavitzkyGolaySmoother"
3941
```
4042

4143
Set global costmap, path planner and smoothers parameters to those desired in `nav2_params.yaml`.

tools/smoother_benchmarking/metrics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def main():
111111
costmap.resize(costmap_msg.metadata.size_y, costmap_msg.metadata.size_x)
112112

113113
planner = 'SmacHybrid'
114-
smoothers = ['simple_smoother', 'constrained_smoother']
114+
smoothers = ['simple_smoother', 'constrained_smoother', 'sg_smoother']
115115
max_cost = 210
116116
side_buffer = 10
117117
time_stamp = navigator.get_clock().now().to_msg()

tools/smoother_benchmarking/process_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def getSmoothness(pt_prev, pt, pt_next):
8282
d1 = pt - pt_prev
8383
d2 = pt_next - pt
8484
delta = d2 - d1
85-
return np.dot(delta, delta)
85+
return np.linalg.norm(delta)
8686

8787
def getPathSmoothnesses(paths):
8888
smoothnesses = []

0 commit comments

Comments
 (0)