mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
Cleanup calibration code (#25119)
* First attempt * worksish * tests pass * cleanup * get rid of garbahe * fix name * Still used in xx * add debug functions * used * Revert "used" This reverts commit 276e8ebab06d2d4f0e9927ba32b7d8aca2bf88c3. * Update ref old-commit-hash: 772b748689cff4d6dc6aab6a8a20247b29a86056
This commit is contained in:
@@ -17,8 +17,6 @@ import cereal.messaging as messaging
|
||||
from common.conversions import Conversions as CV
|
||||
from common.params import Params, put_nonblocking
|
||||
from common.realtime import set_realtime_priority
|
||||
from common.transformations.model import model_height
|
||||
from common.transformations.camera import get_view_frame_from_road_frame
|
||||
from common.transformations.orientation import rot_from_euler, euler_from_rot
|
||||
from system.swaglog import cloudlog
|
||||
|
||||
@@ -180,7 +178,6 @@ class Calibrator:
|
||||
|
||||
def get_msg(self) -> capnp.lib.capnp._DynamicStructBuilder:
|
||||
smooth_rpy = self.get_smooth_rpy()
|
||||
extrinsic_matrix = get_view_frame_from_road_frame(0, smooth_rpy[1], smooth_rpy[2], model_height)
|
||||
|
||||
msg = messaging.new_message('liveCalibration')
|
||||
liveCalibration = msg.liveCalibration
|
||||
@@ -188,16 +185,13 @@ class Calibrator:
|
||||
liveCalibration.validBlocks = self.valid_blocks
|
||||
liveCalibration.calStatus = self.cal_status
|
||||
liveCalibration.calPerc = min(100 * (self.valid_blocks * BLOCK_SIZE + self.idx) // (INPUTS_NEEDED * BLOCK_SIZE), 100)
|
||||
liveCalibration.extrinsicMatrix = extrinsic_matrix.flatten().tolist()
|
||||
liveCalibration.rpyCalib = smooth_rpy.tolist()
|
||||
liveCalibration.rpyCalibSpread = self.calib_spread.tolist()
|
||||
|
||||
if self.not_car:
|
||||
extrinsic_matrix = get_view_frame_from_road_frame(0, 0, 0, model_height)
|
||||
liveCalibration.validBlocks = INPUTS_NEEDED
|
||||
liveCalibration.calStatus = Calibration.CALIBRATED
|
||||
liveCalibration.calPerc = 100.
|
||||
liveCalibration.extrinsicMatrix = extrinsic_matrix.flatten().tolist()
|
||||
liveCalibration.rpyCalib = [0, 0, 0]
|
||||
liveCalibration.rpyCalibSpread = self.calib_spread.tolist()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user