Skip to content

Commit 4230758

Browse files
refactor(control/pid_longitudinal_controller): rework parameters (#6707)
* reset and re-apply refactoring Signed-off-by: Oguz <oguzkaganozt@gmail.com> * style(pre-commit): autofix * . Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com> * . Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com> --------- Signed-off-by: Oguz <oguzkaganozt@gmail.com> Signed-off-by: Oguz Ozturk <oguzkaganozt@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 95d08d4 commit 4230758

File tree

4 files changed

+387
-3
lines changed

4 files changed

+387
-3
lines changed

control/autoware_pid_longitudinal_controller/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ endif()
2222

2323
ament_auto_package(
2424
INSTALL_TO_SHARE
25-
param
25+
config
2626
)

control/autoware_pid_longitudinal_controller/param/longitudinal_controller_defaults.param.yaml control/autoware_pid_longitudinal_controller/config/autoware_pid_longitudinal_controller.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
# stopped state
5555
stopped_vel: 0.0
5656
stopped_acc: -3.4 # denotes pedal position
57+
stopped_jerk: -5.0
5758

5859
# emergency state
5960
emergency_vel: 0.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,383 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "autoware_pid_longitudinal_controller parameters",
4+
"type": "object",
5+
"definitions": {
6+
"autoware_pid_longitudinal_controller": {
7+
"type": "object",
8+
"properties": {
9+
"delay_compensation_time": {
10+
"type": "number",
11+
"description": "delay for longitudinal control [s]",
12+
"default": "0.17"
13+
},
14+
"enable_smooth_stop": {
15+
"type": "boolean",
16+
"description": "flag to enable transition to STOPPING",
17+
"default": "true"
18+
},
19+
"enable_overshoot_emergency": {
20+
"type": "boolean",
21+
"description": "flag to enable transition to EMERGENCY when the ego is over the stop line with a certain distance. See `emergency_state_overshoot_stop_dist`",
22+
"default": "true"
23+
},
24+
"enable_large_tracking_error_emergency": {
25+
"type": "boolean",
26+
"description": "flag to enable transition to EMERGENCY when the closest trajectory point search is failed due to a large deviation between trajectory and ego pose",
27+
"default": "true"
28+
},
29+
"enable_slope_compensation": {
30+
"type": "boolean",
31+
"description": "flag to modify output acceleration for slope compensation. The source of the slope angle can be selected from ego-pose or trajectory angle",
32+
"default": "true"
33+
},
34+
"enable_keep_stopped_until_steer_convergence": {
35+
"type": "boolean",
36+
"description": "flag to keep stopped condition until until the steer converges",
37+
"default": "true"
38+
},
39+
"drive_state_stop_dist": {
40+
"type": "number",
41+
"description": "The state will transit to DRIVE when the distance to the stop point is longer than `drive_state_stop_dist` + `drive_state_offset_stop_dist` [m]",
42+
"default": "0.5"
43+
},
44+
"drive_state_offset_stop_dist": {
45+
"type": "number",
46+
"description": "The state will transit to DRIVE when the distance to the stop point is longer than `drive_state_stop_dist` + `drive_state_offset_stop_dist` [m]",
47+
"default": "1.0"
48+
},
49+
"stopping_state_stop_dist": {
50+
"type": "number",
51+
"description": "The state will transit to STOPPING when the distance to the stop point is shorter than `stopping_state_stop_dist` [m]",
52+
"default": "0.5"
53+
},
54+
"stopped_state_entry_duration_time": {
55+
"type": "number",
56+
"description": "threshold of the ego velocity in transition to the STOPPED state [s]",
57+
"default": "0.1"
58+
},
59+
"stopped_state_entry_vel": {
60+
"type": "number",
61+
"description": "threshold of the ego velocity in transition to the STOPPED state [m/s]",
62+
"default": "0.01"
63+
},
64+
"stopped_state_entry_acc": {
65+
"type": "number",
66+
"description": "threshold of the ego acceleration in transition to the STOPPED state [m/s^2]",
67+
"default": "0.1"
68+
},
69+
"emergency_state_overshoot_stop_dist": {
70+
"type": "number",
71+
"description": "If `enable_overshoot_emergency` is true and the ego is `emergency_state_overshoot_stop_dist`-meter ahead of the stop point, the state will transit to EMERGENCY. [m]",
72+
"default": "1.5"
73+
},
74+
"emergency_state_traj_trans_dev": {
75+
"type": "number",
76+
"description": "If the ego's position is `emergency_state_traj_trans_dev` meter away from the nearest trajectory point, the state will transit to EMERGENCY. [m]",
77+
"default": "3.0"
78+
},
79+
"emergency_state_traj_rot_dev": {
80+
"type": "number",
81+
"description": "If the ego's orientation is `emergency_state_traj_rot_dev` rad away from the nearest trajectory point orientation, the state will transit to EMERGENCY. [rad]",
82+
"default": "0.7854"
83+
},
84+
"kp": {
85+
"type": "number",
86+
"description": "p gain for longitudinal control",
87+
"default": "1.0"
88+
},
89+
"ki": {
90+
"type": "number",
91+
"description": "i gain for longitudinal control",
92+
"default": "0.1"
93+
},
94+
"kd": {
95+
"type": "number",
96+
"description": "d gain for longitudinal control",
97+
"default": "0.0"
98+
},
99+
"max_out": {
100+
"type": "number",
101+
"description": "max value of PID's output acceleration during DRIVE state [m/s^2]",
102+
"default": "1.0"
103+
},
104+
"min_out": {
105+
"type": "number",
106+
"description": "min value of PID's output acceleration during DRIVE state [m/s^2]",
107+
"default": "-1.0"
108+
},
109+
"max_p_effort": {
110+
"type": "number",
111+
"description": "max value of acceleration with p gain",
112+
"default": "1.0"
113+
},
114+
"min_p_effort": {
115+
"type": "number",
116+
"description": "min value of acceleration with p gain",
117+
"default": "-1.0"
118+
},
119+
"max_i_effort": {
120+
"type": "number",
121+
"description": "max value of acceleration with i gain ",
122+
"default": "0.3"
123+
},
124+
"min_i_effort": {
125+
"type": "number",
126+
"description": "min value of acceleration with i gain",
127+
"default": "-0.3"
128+
},
129+
"max_d_effort": {
130+
"type": "number",
131+
"description": "max value of acceleration with d gain",
132+
"default": "0.0"
133+
},
134+
"min_d_effort": {
135+
"type": "number",
136+
"description": "min value of acceleration with d gain ",
137+
"default": "0.0"
138+
},
139+
"lpf_vel_error_gain": {
140+
"type": "number",
141+
"description": "gain of low-pass filter for velocity",
142+
"default": "0.9"
143+
},
144+
"enable_integration_at_low_speed": {
145+
"type": "boolean",
146+
"description": "Whether to enable integration of acceleration errors when the vehicle speed is lower than `current_vel_threshold_pid_integration` or not.",
147+
"default": "false"
148+
},
149+
"current_vel_threshold_pid_integration": {
150+
"type": "number",
151+
"description": "Velocity error is integrated for I-term only when the absolute value of current velocity is larger than this parameter. [m/s]",
152+
"default": "0.5"
153+
},
154+
"time_threshold_before_pid_integration": {
155+
"type": "number",
156+
"description": "How much time without the vehicle moving must past to enable PID error integration. [s]",
157+
"default": "2.0"
158+
},
159+
"enable_brake_keeping_before_stop": {
160+
"type": "boolean",
161+
"description": "flag to keep a certain acceleration during DRIVE state before the ego stops. See [Brake keeping]",
162+
"default": "false"
163+
},
164+
"brake_keeping_acc": {
165+
"type": "number",
166+
"description": "If `enable_brake_keeping_before_stop` is true, a certain acceleration is kept during DRIVE state before the ego stops [m/s^2] See [Brake keeping]",
167+
"default": "-0.2"
168+
},
169+
"smooth_stop_max_strong_acc": {
170+
"type": "number",
171+
"description": "max strong acceleration [m/s^2]",
172+
"default": "-0.5"
173+
},
174+
"smooth_stop_min_strong_acc": {
175+
"type": "number",
176+
"description": "min strong acceleration [m/s^2]",
177+
"default": "-0.8"
178+
},
179+
"smooth_stop_weak_acc": {
180+
"type": "number",
181+
"description": "weak acceleration [m/s^2]",
182+
"default": "-0.3"
183+
},
184+
"smooth_stop_weak_stop_acc": {
185+
"type": "number",
186+
"description": "weak acceleration to stop right now [m/s^2]",
187+
"default": "-0.8"
188+
},
189+
"smooth_stop_strong_stop_acc": {
190+
"type": "number",
191+
"description": "strong acceleration to be output when the ego is `smooth_stop_strong_stop_dist`-meter over the stop point. [m/s^2]",
192+
"default": "-3.4"
193+
},
194+
"smooth_stop_max_fast_vel": {
195+
"type": "number",
196+
"description": "max fast vel to judge the ego is running fast [m/s]. If the ego is running fast, strong acceleration will be output.",
197+
"default": "0.5"
198+
},
199+
"smooth_stop_min_running_vel": {
200+
"type": "number",
201+
"description": "min ego velocity to judge if the ego is running or not [m/s]",
202+
"default": "0.01"
203+
},
204+
"smooth_stop_min_running_acc": {
205+
"type": "number",
206+
"description": "min ego acceleration to judge if the ego is running or not [m/s^2]",
207+
"default": "0.01"
208+
},
209+
"smooth_stop_weak_stop_time": {
210+
"type": "number",
211+
"description": "max time to output weak acceleration [s]. After this, strong acceleration will be output.",
212+
"default": "0.8"
213+
},
214+
"smooth_stop_weak_stop_dist": {
215+
"type": "number",
216+
"description": "Weak acceleration will be output when the ego is `smooth_stop_weak_stop_dist`-meter before the stop point. [m]",
217+
"default": "-0.3"
218+
},
219+
"smooth_stop_strong_stop_dist": {
220+
"type": "number",
221+
"description": "Strong acceleration will be output when the ego is `smooth_stop_strong_stop_dist`-meter over the stop point. [m]",
222+
"default": "-0.5"
223+
},
224+
"stopped_vel": {
225+
"type": "number",
226+
"description": "target velocity in STOPPED state [m/s]",
227+
"default": "0.0"
228+
},
229+
"stopped_acc": {
230+
"type": "number",
231+
"description": "target acceleration in STOPPED state [m/s^2]",
232+
"default": "-3.4"
233+
},
234+
"stopped_jerk": {
235+
"type": "number",
236+
"description": "target jerk in STOPPED state [m/s^3]",
237+
"default": "-5.0"
238+
},
239+
"emergency_vel": {
240+
"type": "number",
241+
"description": "target velocity in EMERGENCY state [m/s]",
242+
"default": "0.00"
243+
},
244+
"emergency_acc": {
245+
"type": "number",
246+
"description": "target acceleration in an EMERGENCY state [m/s^2]",
247+
"default": "-5.0"
248+
},
249+
"emergency_jerk": {
250+
"type": "number",
251+
"description": "target jerk in an EMERGENCY state [m/s^3]",
252+
"default": "-3.0"
253+
},
254+
"max_acc": {
255+
"type": "number",
256+
"description": "max value of output acceleration [m/s^2]",
257+
"default": "3.0"
258+
},
259+
"min_acc": {
260+
"type": "number",
261+
"description": "min value of output acceleration [m/s^2]",
262+
"default": "-5.0"
263+
},
264+
"max_jerk": {
265+
"type": "number",
266+
"description": "max value of jerk of output acceleration [m/s^3]",
267+
"default": "2.0"
268+
},
269+
"min_jerk": {
270+
"type": "number",
271+
"description": "min value of jerk of output acceleration [m/s^3]",
272+
"default": "-5.0"
273+
},
274+
"max_acc_cmd_diff": {
275+
"type": "number",
276+
"description": "max difference between the current and previous acceleration command [m/s^2 * s^-1]",
277+
"default": "50"
278+
},
279+
"lpf_pitch_gain": {
280+
"type": "number",
281+
"description": "gain of low-pass filter for pitch estimation",
282+
"default": "0.95"
283+
},
284+
"slope_source": {
285+
"type": "string",
286+
"description": "source of slope angle.",
287+
"default": "raw_pitch"
288+
},
289+
"adaptive_trajectory_velocity_th": {
290+
"type": "number",
291+
"description": "threshold of the ego velocity to use adaptive trajectory velocity [m/s]",
292+
"default": "1.0"
293+
},
294+
"max_pitch_rad": {
295+
"type": "number",
296+
"description": "max value of estimated pitch [rad]",
297+
"default": "0.1"
298+
},
299+
"min_pitch_rad": {
300+
"type": "number",
301+
"description": "min value of estimated pitch [rad]",
302+
"default": "-0.1"
303+
}
304+
},
305+
"required": [
306+
"delay_compensation_time",
307+
"enable_smooth_stop",
308+
"enable_overshoot_emergency",
309+
"enable_large_tracking_error_emergency",
310+
"enable_slope_compensation",
311+
"enable_keep_stopped_until_steer_convergence",
312+
"drive_state_stop_dist",
313+
"drive_state_offset_stop_dist",
314+
"stopping_state_stop_dist",
315+
"stopped_state_entry_duration_time",
316+
"stopped_state_entry_vel",
317+
"stopped_state_entry_acc",
318+
"emergency_state_overshoot_stop_dist",
319+
"emergency_state_traj_trans_dev",
320+
"emergency_state_traj_rot_dev",
321+
"kp",
322+
"ki",
323+
"kd",
324+
"max_out",
325+
"min_out",
326+
"max_p_effort",
327+
"min_p_effort",
328+
"max_i_effort",
329+
"min_i_effort",
330+
"max_d_effort",
331+
"min_d_effort",
332+
"lpf_vel_error_gain",
333+
"enable_integration_at_low_speed",
334+
"current_vel_threshold_pid_integration",
335+
"time_threshold_before_pid_integration",
336+
"enable_brake_keeping_before_stop",
337+
"brake_keeping_acc",
338+
"smooth_stop_max_strong_acc",
339+
"smooth_stop_min_strong_acc",
340+
"smooth_stop_weak_acc",
341+
"smooth_stop_weak_stop_acc",
342+
"smooth_stop_strong_stop_acc",
343+
"smooth_stop_max_fast_vel",
344+
"smooth_stop_min_running_vel",
345+
"smooth_stop_min_running_acc",
346+
"smooth_stop_weak_stop_time",
347+
"smooth_stop_weak_stop_dist",
348+
"smooth_stop_strong_stop_dist",
349+
"stopped_vel",
350+
"stopped_acc",
351+
"stopped_jerk",
352+
"emergency_vel",
353+
"emergency_acc",
354+
"emergency_jerk",
355+
"max_acc",
356+
"min_acc",
357+
"max_jerk",
358+
"min_jerk",
359+
"max_acc_cmd_diff",
360+
"lpf_pitch_gain",
361+
"slope_source",
362+
"adaptive_trajectory_velocity_th",
363+
"max_pitch_rad",
364+
"min_pitch_rad"
365+
],
366+
"additionalProperties": false
367+
}
368+
},
369+
"properties": {
370+
"/**": {
371+
"type": "object",
372+
"properties": {
373+
"ros__parameters": {
374+
"$ref": "#/definitions/autoware_pid_longitudinal_controller"
375+
}
376+
},
377+
"required": ["ros__parameters"],
378+
"additionalProperties": false
379+
}
380+
},
381+
"required": ["/**"],
382+
"additionalProperties": false
383+
}

0 commit comments

Comments
 (0)