Skip to content

Commit b9d2586

Browse files
Adi9103laneccolin
authored andcommitted
Launch control PR
1 parent 9111107 commit b9d2586

3 files changed

Lines changed: 61 additions & 33 deletions

File tree

Lines changed: 47 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
11
# ********* Main settings entry point for behavior stack ***********
2-
3-
# Configure settings for the vehicle / vehicle model
4-
vehicle: !include ../vehicle/gem_e4.yaml
5-
6-
#arguments for algorithm components here
7-
model_predictive_controller:
8-
dt: 0.1
9-
lookahead: 20
10-
control:
11-
recovery:
12-
brake_amount : 0.5
13-
brake_speed : 2.0
14-
pure_pursuit:
15-
lookahead: 2.0
16-
lookahead_scale: 3.0
17-
crosstrack_gain: 1.0
18-
desired_speed: trajectory
19-
longitudinal_control:
20-
pid_p: 1.0
21-
pid_i: 0.1
22-
pid_d: 0.0
23-
24-
#configure the simulator, if using
25-
simulator:
26-
dt: 0.01
27-
real_time_multiplier: 1.0 # make the simulator run faster than real time by making this > 1
28-
gnss_emulator:
29-
dt: 0.1 #10Hz
30-
#position_noise: 0.1 #10cm noise
31-
#orientation_noise: 0.04 #2.3 degrees noise
32-
#velocity_noise:
33-
# constant: 0.04 #4cm/s noise
34-
# linear: 0.02 #2% noise
2+
3+
# Configure settings for the vehicle / vehicle model
4+
vehicle: !include ../vehicle/gem_e4.yaml
5+
6+
#arguments for algorithm components here
7+
model_predictive_controller:
8+
dt: 0.1
9+
lookahead: 20
10+
control:
11+
recovery:
12+
brake_amount : 0.5
13+
brake_speed : 2.0
14+
pure_pursuit:
15+
lookahead: 2.0
16+
lookahead_scale: 2.0
17+
crosstrack_gain: 0.3
18+
desired_speed: trajectory #racing
19+
launch_control:
20+
enabled: false
21+
stage_duration: 0.5
22+
longitudinal_control:
23+
pid_p: 0.8
24+
pid_i: 0.03
25+
pid_d: 0.0
26+
planning:
27+
longitudinal_plan:
28+
mode: 'real' # 'real' or 'sim'
29+
yielder: 'expert' # 'expert', 'analytic', or 'simulation'
30+
planner: 'dt' # 'milestone', 'dt', or 'dx'
31+
desired_speed: 1.0
32+
acceleration: 0.5
33+
max_deceleration: 6.0
34+
deceleration: 2.0
35+
min_deceleration: 0.5
36+
yield_deceleration: 0.5
37+
38+
#configure the simulator, if using
39+
simulator:
40+
dt: 0.01
41+
real_time_multiplier: 1.0 # make the simulator run faster than real time by making this > 1
42+
gnss_emulator:
43+
dt: 0.05 #10Hz
44+
#position_noise: 0.1 #10cm noise
45+
#orientation_noise: 0.04 #2.3 degrees noise
46+
#velocity_noise:
47+
# constant: 0.04 #4cm/s noise
48+
# linear: 0.02 #2% noise

GEMstack/onboard/interface/gem_hardware.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,19 @@ def send_command(self, command : GEMVehicleCommand):
316316
self.accel_cmd.enable = True
317317
self.accel_cmd.clear = False
318318
self.accel_cmd.ignore = False
319+
320+
# Launch control
321+
currTime = rospy.get_time() - self.start_time
322+
if currTime < 5:
323+
self.brake_cmd.f64_cmd = maxbrake
324+
self.accel_cmd.f64_cmd = 0
325+
elif currTime < 6:
326+
self.brake_cmd.f64_cmd = maxbrake
327+
self.accel_cmd.f64_cmd = maxacc
328+
elif currTime < 10:
329+
self.brake_cmd.f64_cmd = 0
330+
self.accel_cmd.f64_cmd = maxacc
331+
319332

320333
self.gear_cmd.ui16_cmd = PacmodCmd.SHIFT_FORWARD
321334
self.gear_cmd.enable = True

GEMstack/onboard/planning/pure_pursuit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def compute(self, state : VehicleState, component : Component = None):
168168
if desired_speed > self.speed_limit:
169169
desired_speed = self.speed_limit
170170
output_accel = self.pid_speed.advance(e = desired_speed - speed, t = t, feedforward_term=feedforward_accel)
171+
171172
if component is not None:
172173
component.debug('curr pt',(curr_x,curr_y))
173174
component.debug('curr param',self.current_path_parameter)

0 commit comments

Comments
 (0)