Skip to content

Commit 77512b8

Browse files
refactor(autoware_velocity_smoother): rework parameters
Signed-off-by: batuhanbeytekin <batuhanbeytekin@gmail.com>
1 parent 7504092 commit 77512b8

9 files changed

+690
-1
lines changed

planning/autoware_velocity_smoother/README.ja.md

+7
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@
106106

107107
## Parameters
108108

109+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/Analytical.schema.json")}}
110+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/default_comman.schema.json")}}
111+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/default_velocity_smoother.schema.json")}}
112+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/JerkFiltered.schema.json")}}
113+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/L2.schema.json")}}
114+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/Linf.schema.json")}}
115+
109116
### Constraint parameters
110117

111118
| Name | Type | Description | Default value |

planning/autoware_velocity_smoother/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ After the optimization, a resampling called `post resampling` is performed befor
119119

120120
## Parameters
121121

122+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/Analytical.schema.json")}}
123+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/default_comman.schema.json")}}
124+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/default_velocity_smoother.schema.json")}}
125+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/JerkFiltered.schema.json")}}
126+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/L2.schema.json")}}
127+
{{json_to_markdown("/planning/autoware_velocity_smoother/schema/Linf.schema.json")}}
128+
122129
### Constraint parameters
123130

124131
| Name | Type | Description | Default value |

planning/autoware_velocity_smoother/config/default_velocity_smoother.param.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
# ---- curve parameters ----
1111
# - common parameters -
12-
curvature_calculation_distance: 5.0 # distance of points while curvature is calculating for the steer rate and lateral acceleration limit [m]
12+
curvature_calculation_distance: 5.0 # distance of points while curvature is calculating for the steer rate and lateral acceleration limit [m]
13+
ego_nearest_dist_threshold: 0.3 # threshold to find the nearest point on the trajectory [m]
14+
ego_nearest_yaw_threshold: 1.046 # threshold to find the nearest point on the trajectory [rad]
15+
algorithm_type: "JerkFiltered" # algorithm type for velocity smoother. "JerkFiltered" or "L2" or "Linf" or "Analytical"
1316
# - lateral acceleration limit parameters -
1417
enable_lateral_acc_limit: true # To toggle the lateral acc filter on and off. You can switch it dynamically at runtime.
1518
max_lateral_accel: 0.8 # max lateral acceleration limit [m/ss]
@@ -61,3 +64,6 @@
6164
over_stop_velocity_warn_thr: 1.389 # used to check if the optimization exceeds the input velocity on the stop point
6265

6366
plan_from_ego_speed_on_manual_mode: true # planning is done from ego velocity/acceleration on MANUAL mode. This should be true for smooth transition from MANUAL to AUTONOMOUS, but could be false for debugging.
67+
68+
# debug
69+
publish_debug_trajs: false # publish debug trajectories
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for analytical",
4+
"type": "object",
5+
"definitions": {
6+
"analytical_params": {
7+
"type": "object",
8+
"properties": {
9+
"resample": {
10+
"type": "object",
11+
"properties": {
12+
"ds_resample": {
13+
"type": "number",
14+
"default": 0.1,
15+
"description": "Enable resampling"
16+
},
17+
"num_resample": {
18+
"type": "number",
19+
"default": 1,
20+
"description": "Resample interval"
21+
},
22+
"delta_yaw_threshold": {
23+
"type": "number",
24+
"default": 0.785,
25+
"description": "Threshold for yaw change"
26+
}
27+
},
28+
"required": ["ds_resample", "num_resample", "delta_yaw_threshold"],
29+
"additionalProperties": false
30+
},
31+
"latacc": {
32+
"type": "object",
33+
"properties": {
34+
"enable_constant_velocity_while_turning": {
35+
"type": "boolean",
36+
"default": false,
37+
"description": "Enable constant velocity while turning"
38+
},
39+
"constant_velocity_dist_threshold": {
40+
"type": "number",
41+
"default": 2.0,
42+
"description": "Threshold for constant velocity"
43+
}
44+
},
45+
"required": [
46+
"enable_constant_velocity_while_turning",
47+
"constant_velocity_dist_threshold"
48+
],
49+
"additionalProperties": false
50+
},
51+
"forward": {
52+
"type": "object",
53+
"properties": {
54+
"max_acc": {
55+
"type": "number",
56+
"default": 1.0,
57+
"description": "Maximum forward acceleration"
58+
},
59+
"min_acc": {
60+
"type": "number",
61+
"default": -1.0,
62+
"description": "Minimum forward acceleration"
63+
},
64+
"max_jerk": {
65+
"type": "number",
66+
"default": 0.3,
67+
"description": "Maximum forward jerk"
68+
},
69+
"min_jerk": {
70+
"type": "number",
71+
"default": -0.3,
72+
"description": "Minimum forward jerk"
73+
},
74+
"kp": {
75+
"type": "number",
76+
"default": 0.3,
77+
"description": "Proportional gain for forward control"
78+
}
79+
},
80+
"required": ["max_acc", "min_acc", "max_jerk", "min_jerk", "kp"],
81+
"additionalProperties": false
82+
},
83+
"backward": {
84+
"type": "object",
85+
"properties": {
86+
"start_jerk": {
87+
"type": "number",
88+
"default": -0.1,
89+
"description": "Jerk at the start of backward motion"
90+
},
91+
"min_jerk_mild_stop": {
92+
"type": "number",
93+
"default": -0.3,
94+
"description": "Minimum jerk for mild stopping"
95+
},
96+
"min_jerk": {
97+
"type": "number",
98+
"default": -1.5,
99+
"description": "Minimum backward jerk"
100+
},
101+
"min_acc_mild_stop": {
102+
"type": "number",
103+
"default": -1.0,
104+
"description": "Minimum acceleration for mild stopping"
105+
},
106+
"min_acc": {
107+
"type": "number",
108+
"default": -2.5,
109+
"description": "Minimum backward acceleration"
110+
},
111+
"span_jerk": {
112+
"type": "number",
113+
"default": -0.01,
114+
"description": "Span jerk value for backward motion"
115+
}
116+
},
117+
"required": ["start_jerk", "min_jerk_mild_stop", "min_jerk", "min_acc_mild_stop", "min_acc", "span_jerk"],
118+
"additionalProperties": false
119+
}
120+
},
121+
"required": ["resample", "latacc", "forward", "backward"],
122+
"additionalProperties": false
123+
}
124+
},
125+
"properties": {
126+
"/**": {
127+
"type": "object",
128+
"properties": {
129+
"ros__parameters": {
130+
"$ref": "#/definitions/analytical_params"
131+
}
132+
},
133+
"required": ["ros__parameters"],
134+
"additionalProperties": false
135+
}
136+
},
137+
"required": ["/**"],
138+
"additionalProperties": false
139+
}
140+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for JerkFiltered",
4+
"type": "object",
5+
"definitions": {
6+
"jerk_filtered_params": {
7+
"type": "object",
8+
"properties": {
9+
"jerk_weight": {
10+
"type": "number",
11+
"default": 10.0,
12+
"description": "Weight for 'smoothness' cost for jerk"
13+
},
14+
"over_v_weight": {
15+
"type": "number",
16+
"default": 100000.0,
17+
"description": "Weight for 'over speed limit' cost"
18+
},
19+
"over_a_weight": {
20+
"type": "number",
21+
"default": 5000.0,
22+
"description": "Weight for 'over accel limit' cost"
23+
},
24+
"over_j_weight": {
25+
"type": "number",
26+
"default": 2000.0,
27+
"description": "Weight for 'over jerk limit' cost"
28+
},
29+
"jerk_filter_ds": {
30+
"type": "number",
31+
"default": 0.1,
32+
"description": "Resampling ds for jerk filter"
33+
}
34+
},
35+
"required": [
36+
"jerk_weight",
37+
"over_v_weight",
38+
"over_a_weight",
39+
"over_j_weight",
40+
"jerk_filter_ds"
41+
]
42+
}
43+
},
44+
"properties": {
45+
"/**": {
46+
"type": "object",
47+
"properties": {
48+
"ros__parameters": {
49+
"$ref": "#/definitions/jerk_filtered_params"
50+
}
51+
},
52+
"required": ["ros__parameters"],
53+
"additionalProperties": false
54+
}
55+
},
56+
"required": ["/**"],
57+
"additionalProperties": false
58+
}
59+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for L2",
4+
"type": "object",
5+
"definitions": {
6+
"l2_params": {
7+
"type": "object",
8+
"properties": {
9+
"pseudo_jerk_weight": {
10+
"type": "number",
11+
"default": 100.0,
12+
"description": "Weight for 'smoothness' cost"
13+
},
14+
"over_v_weight": {
15+
"type": "number",
16+
"default": 100000.0,
17+
"description": "Weight for 'over speed limit' cost"
18+
},
19+
"over_a_weight": {
20+
"type": "number",
21+
"default": 1000.0,
22+
"description": "Weight for 'over accel limit' cost"
23+
}
24+
},
25+
"required": [
26+
"pseudo_jerk_weight",
27+
"over_v_weight",
28+
"over_a_weight"
29+
]
30+
}
31+
},
32+
"properties": {
33+
"/**": {
34+
"type": "object",
35+
"properties": {
36+
"ros__parameters": {
37+
"$ref": "#/definitions/l2_params"
38+
}
39+
},
40+
"required": ["ros__parameters"]
41+
}
42+
},
43+
"required": ["/**"]
44+
}
45+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Parameters for Linf",
4+
"type": "object",
5+
"definitions": {
6+
"linf_params": {
7+
"type": "object",
8+
"properties": {
9+
"pseudo_jerk_weight": {
10+
"type": "number",
11+
"default": 200.0,
12+
"description": "Weight for 'smoothness' cost"
13+
},
14+
"over_v_weight": {
15+
"type": "number",
16+
"default": 100000.0,
17+
"description": "Weight for 'over speed limit' cost"
18+
},
19+
"over_a_weight": {
20+
"type": "number",
21+
"default": 5000.0,
22+
"description": "Weight for 'over accel limit' cost"
23+
}
24+
},
25+
"required": [
26+
"pseudo_jerk_weight",
27+
"over_v_weight",
28+
"over_a_weight"
29+
]
30+
}
31+
},
32+
"properties": {
33+
"/**": {
34+
"type": "object",
35+
"properties": {
36+
"ros__parameters": {
37+
"$ref": "#/definitions/linf_params"
38+
}
39+
},
40+
"required": ["ros__parameters"]
41+
}
42+
},
43+
"required": ["/**"]
44+
}
45+

0 commit comments

Comments
 (0)