Model replay needs speed

This commit is contained in:
Bruce Wayne 2024-09-30 17:22:01 -07:00
parent 7ebd7b8b4d
commit 6d6a4993dd
1 changed files with 2 additions and 0 deletions

View File

@ -103,6 +103,7 @@ class ModelState:
self.model.execute()
outputs = self.parser.parse_outputs(self.slice_outputs(self.output))
print(outputs['desired_curvature'][0,:], inputs['lateral_control_params'])
self.inputs['features_buffer'][:-ModelConstants.FEATURE_LEN] = self.inputs['features_buffer'][ModelConstants.FEATURE_LEN:]
self.inputs['features_buffer'][-ModelConstants.FEATURE_LEN:] = outputs['hidden_state'][0, :]
@ -218,6 +219,7 @@ def main(demo=False):
desire = DH.desire
is_rhd = sm["driverMonitoringState"].isRHD
frame_id = sm["roadCameraState"].frameId
print(sm['carState'].vEgo)
lateral_control_params = np.array([sm["carState"].vEgo, steer_delay], dtype=np.float32)
if sm.updated["liveCalibration"] and sm.seen['roadCameraState'] and sm.seen['deviceState']:
device_from_calib_euler = np.array(sm["liveCalibration"].rpyCalib, dtype=np.float32)