From 0ebc868acf2ea9cbd971c1e0ace54f44207e0c50 Mon Sep 17 00:00:00 2001 From: Harald Schafer Date: Wed, 16 Mar 2022 17:52:26 -0700 Subject: [PATCH 1/4] Controlsd: give carcontroller angular rates --- selfdrive/controls/controlsd.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 1a911ef985c672..443672a4e6c865 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -572,10 +572,14 @@ def update_button_timers(self, buttonEvents): def publish_logs(self, CS, start_time, CC, lac_log): """Send actuators and hud commands to the car, send controlsstate and MPC logging""" - orientation_value = self.sm['liveLocationKalman'].orientationNED.value + # Orientation and angle rates can be useful for carcontroller + # Only calibrated (car) frame is relevant for the carcontroller + orientation_value = self.sm['liveLocationKalman'].calibratedOrientationNED.value if len(orientation_value) > 2: - CC.roll = orientation_value[0] - CC.pitch = orientation_value[1] + CC.orientationNED = orientation_value + angular_rate_value = self.sm['liveLocationKalman'].angularVelocityCalibrated.value + if len(angular_rate_value) > 2: + CC.angularVelocity = angular_rate_value CC.cruiseControl.cancel = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise) if self.joystick_mode and self.sm.rcv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]: From d344ae058add1d83d52302496b72f42865adca21 Mon Sep 17 00:00:00 2001 From: Harald Schafer Date: Wed, 16 Mar 2022 17:53:40 -0700 Subject: [PATCH 2/4] Update cereal --- cereal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cereal b/cereal index 64b6014193a69f..85406f66760b30 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 64b6014193a69fe2e2b3b7a17f9e228162081ddf +Subproject commit 85406f66760b30700c27aace228f5e480f3a5bbe From 61bac237e228da19e59d456c883f99a92172d217 Mon Sep 17 00:00:00 2001 From: Harald Schafer Date: Wed, 16 Mar 2022 20:10:49 -0700 Subject: [PATCH 3/4] Needs to be list --- selfdrive/controls/controlsd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 443672a4e6c865..fdc0efb7761bcd 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -574,10 +574,10 @@ def publish_logs(self, CS, start_time, CC, lac_log): # Orientation and angle rates can be useful for carcontroller # Only calibrated (car) frame is relevant for the carcontroller - orientation_value = self.sm['liveLocationKalman'].calibratedOrientationNED.value + orientation_value = list(self.sm['liveLocationKalman'].calibratedOrientationNED.value) if len(orientation_value) > 2: CC.orientationNED = orientation_value - angular_rate_value = self.sm['liveLocationKalman'].angularVelocityCalibrated.value + angular_rate_value = list(self.sm['liveLocationKalman'].angularVelocityCalibrated.value) if len(angular_rate_value) > 2: CC.angularVelocity = angular_rate_value From d595a0d37064edeb24e5ff7bc8a9373b3e2c253e Mon Sep 17 00:00:00 2001 From: Harald Schafer Date: Wed, 16 Mar 2022 20:26:13 -0700 Subject: [PATCH 4/4] Update refs --- selfdrive/test/process_replay/ref_commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index f9edf2f8870412..4802acb9fcc1b3 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -927918307b45657df0a4ac0255c3e8e3dc62d7cd \ No newline at end of file +61bac237e228da19e59d456c883f99a92172d217 \ No newline at end of file