Skip to content

Commit

Permalink
process_replay: fix llk migration (#33717)
Browse files Browse the repository at this point in the history
* If field is empty put nans

* Move import out
  • Loading branch information
fredyshox authored Oct 3, 2024
1 parent f7c4aad commit b7a3887
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions selfdrive/test/process_replay/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,16 @@ def migrate_liveTracks(msgs):

@migration(inputs=["liveLocationKalmanDEPRECATED"], product="livePose")
def migrate_liveLocationKalman(msgs):
nans = [float('nan')] * 3
ops = []
for index, msg in msgs:
m = messaging.new_message('livePose')
m.valid = msg.valid
m.logMonoTime = msg.logMonoTime
for field in ["orientationNED", "velocityDevice", "accelerationDevice", "angularVelocityDevice"]:
lp_field, llk_field = getattr(m.livePose, field), getattr(msg.liveLocationKalmanDEPRECATED, field)
lp_field.x, lp_field.y, lp_field.z = llk_field.value
lp_field.xStd, lp_field.yStd, lp_field.zStd = llk_field.std
lp_field.x, lp_field.y, lp_field.z = llk_field.value or nans
lp_field.xStd, lp_field.yStd, lp_field.zStd = llk_field.std or nans
lp_field.valid = llk_field.valid
for flag in ["inputsOK", "posenetOK", "sensorsOK"]:
setattr(m.livePose, flag, getattr(msg.liveLocationKalmanDEPRECATED, flag))
Expand Down

0 comments on commit b7a3887

Please sign in to comment.