Skip to content

Commit 5331c6e

Browse files
authored
Add custom window size and poly order for SG filter (#769)
* Add custom window size and poly order for SG filter Signed-off-by: Maurice <mauricepurnawan@gmail.com> * Add migration guide Signed-off-by: Maurice <mauricepurnawan@gmail.com> * Linting Signed-off-by: Maurice <mauricepurnawan@gmail.com> --------- Signed-off-by: Maurice <mauricepurnawan@gmail.com>
1 parent 04943e5 commit 5331c6e

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

configuration/packages/configuring-savitzky-golay-smoother.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ This algorithm is deterministic and low-parameter. In the below image, some odd
1919
Savitzky-Golay Smoother Parameters
2020
**********************************
2121

22+
:window_size:
23+
24+
============== ===========================
25+
Type Default
26+
-------------- ---------------------------
27+
int 7
28+
============== ===========================
29+
30+
Description
31+
Size of the smoothing window. Must be an odd integer, with a minimum value of 3
32+
33+
:poly_order:
34+
35+
============== ===========================
36+
Type Default
37+
-------------- ---------------------------
38+
int 3
39+
============== ===========================
40+
41+
Description
42+
Order of the polynomial used to fit the samples in each smoothing window
43+
2244
:do_refinement:
2345

2446
============== ===========================
@@ -65,6 +87,8 @@ Example
6587
smoother_plugins: ["savitzky_golay_smoother"]
6688
savitzky_golay_smoother:
6789
plugin: "nav2_smoother::SavitzkyGolaySmoother"
90+
window_size: 7
91+
poly_order: 3
6892
do_refinement: True
6993
refinement_num: 2
7094
enforce_path_inversion: True

migration/Kilted.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,14 @@ Example:
347347
polygon_frame_blackboard_id: "polygon_frame_id"
348348
349349
See also :ref:`configuring_bt_navigator`
350+
351+
Option to have custom window size and poly order in Savitsky-Golay Smoother
352+
---------------------------------------------------------------------------
353+
354+
In `PR #5489 <https://github.com/ros-navigation/navigation2/pull/5489>`_, option to have custom window size and polynomial order was added.
355+
Previously, the implementation used a fixed window size of 7 and a polynomial order of 3.
356+
357+
Default value:
358+
359+
- window_size: 7
360+
- poly_order: 3

0 commit comments

Comments
 (0)