自動運転における最適化:複雑性からリアルタイムエンジニアリングへ
著者Avraam Tolmidisは、自動運転車の技術アーキテクチャにおいて、コンテキストを考慮したセンサーフュージョンやモデル予測制御(MPC)ソルバーなどの最適化技術が、生のセンサーデータを安全な制御コマンドに処理する上で重要であると論じている。
キーポイント
自動運転における最適化技術の焦点
記事は自動運転車の技術アーキテクチャを概観し、特に生センサーデータから安全な制御コマンドへの処理を支援する最適化技術に焦点を当てている。
コンテキストを考慮したセンサーフュージョン
複数のセンサーからのデータを統合し、文脈を理解することで、より正確な環境認識を実現する技術が紹介されている。
モデル予測制御(MPC)ソルバーの役割
MPCソルバーは、将来の状態を予測しながら最適な制御動作を計算する技術として、リアルタイムでの安全な車両制御に貢献する。
複雑性からリアルタイム工学への移行
自動運転システムの複雑な処理を、実用的なリアルタイムのエンジニアリングソリューションに変換するプロセスが論点となっている。
影響分析・編集コメントを表示
影響分析
この記事は、自動運転技術の実用化に向けた具体的な技術課題(センサーデータ処理とリアルタイム制御)に焦点を当てており、業界の研究開発方向性を示唆している。ただし、特定の新規技術や画期的な成果ではなく、既存技術の応用と最適化に重点を置いた解説的な内容であるため、業界全体に即座に大きな変革をもたらすものではない。
編集コメント
自動運転の核心的な技術要素(センサーフュージョンとMPC)に絞った解説であり、技術者向けの実践的な洞察を提供している。ただし、新規性や具体的な実装事例に乏しく、やや概説的な内容に留まっている印象を受ける。
主要ポイント
生産レベルの自動運転(AV)スタックは、公開/購読コンポーネントからなる分散データフローグラフとして理解するのが最も適切です。実際にはフィードバックや再計画のために循環構造となることも多く、Data Distribution Service (DDS) 上に構築された ROS 2 などのミドルウェアを介して実装されることが一般的です。
自動運転スタックのエンジニアリングは、単にロジックに従ったコードを書くことではありません。リソース、時間、物理的制約を同時に管理するシステムを構築することなのです。
知覚(パーセプション)における最適化とは、多くの場合文脈に応じた優先順位付けを意味します。現在の運用設計領域(ODD)に合わせて、センシング、前処理、推論にかかるリソースの配分を調整することです。
ルールをハードコードするのではなく、エンジニアはソルバーが最小化するコスト関数(J)を定義します。
多くのチームでは、計算リソースの予算自体をエンジニアリング上の最適化問題として扱っています。実行時間の計測、コアの割り当て、優先度の設定、そして適切なタイミングで適切な作業が行われるようサービス品質(QoS)の調整を行います。
自動運転システムは、AI の能力や高レベルの倫理観という観点から語られることが多い。しかし、これらのシステムを構築するソフトウェアアーキテクトやエンジニアにとっての現実は、レイテンシ、帯域幅、計算リソースとの戦いである。本記事では、AV スタックの全体像にわたる技術アーキテクチャを探り、文脈認識型センサー融合からモデル予測制御(MPC)ソルバーに至るまでの最適化手法が、ギガバイト単位の生センサーデータをミリ秒レベルの期限内に安全な制御コマンドに変換する仕組みを解説する。
エンドツーエンドのアーキテクチャ:センサーからアクチュエータへ
一見すると、自動運転システムは極めて複雑である。これらのシステムは単純な直線的パイプラインではなく、知覚、予測、計画、制御という再帰的なリアルタイムループで構成されている。
どこに最適化が必要かを理解するためには、まずデータフローを眺めることが役立つ。生産グレードの AV スタックは、パブリッシュ/サブスクライブコンポーネントからなる分散型データフローグラフとして最もよく理解できる(フィードバックや再計画により実際には循環構造となる)。これは通常、DDS(Data Distribution Service)上に構築された ROS 2 などのミドルウェアを介して実装される。パイプラインは、カメラ、レーダー、LiDAR、GNSS、IMU から毎秒膨大な量のデータを取得し処理する必要がある。
以下の図 1 は、高レートセンサー入力から知覚・ローカライゼーションおよび融合を経て、計画、制御、そして作動に至るまでのエンドツーエンドのアーキテクチャを要約しており、主要なデータフローと計算リソースの流れを一瞥で把握できるようになっています。
図 1: 自動運転ソフトウェアの高レベルアーキテクチャ
[ここをクリックして上記画像をフルサイズに拡大]
典型的なデータスループット量
LiDAR: 約 0.3–260 万点/秒(設定によりセンサーあたり通常 35–255 Mbps)。
カメラ:4K/60fps ストリーム(フルカラーの非圧縮動画では最大約 12 Gbps を要するが、実システムでは通常 RAW フォーマットおよび/または圧縮を利用)。
レーダー:スパースな検出・トラッキング(通常は低帯域幅だが高リフレッシュレート)。
知覚パイプラインの最適化:動的リソース割り当て
知覚層は、生データを世界モデルに変換する役割を担います。単純なアプローチでは、すべてのセンサーを最大解像度と最高頻度で処理しますが、毎秒ギガバイト単位のデータを完全な忠実度で処理すれば、車両の計算リソースはすぐに飽和してしまいます。
文脈に応じたセンサー優先順位付け
知覚における最適化とは、多くの場合、文脈に応じた優先順位付けを意味します。これは現在の運用設計領域(ODD: Operational Design Domain)に合わせ、センシング、前処理、推論にかかるリソースを調整するアプローチです。多くのシステムスタックでは、主要なパイプライン段階の計算コストをモデル化し、精度、レイテンシ、およびリソース使用量のトレードオフを行うポリシー(または最適化ベースのコントローラ)を適用しています。
高速道路シナリオ
注目領域(ROI)を狭め、長距離の精度が極めて重要となる。その結果、スタックは前方指向型の LiDAR と長距離カメラを優先し、側方センサーからの負荷をダウンサンプリング、フレーム/スキャンレートの低下、または選択的な ROI 処理によって軽減する傾向がある。
都市環境シナリオ
交差交通、脆弱な道路利用者、複雑な相互作用に対しては周辺カバレッジがより重要となる。スタックは広角カメラと側方指向センサーを優先し、セマンティック知覚やトラッキングに計算リソースを多く割り当てる場合がある。
図 2: ダイナミックセンサー重み付けロジック
[ここをクリックして上記画像をフルサイズで展開]
技術的実装:前処理から融合まで
生産環境の自動運転プログラムでは、知覚パイプラインにこのような柔軟な割り当てが必要となる。多くのチームは単一のステージでのオブジェクトリストを超え、早期の前処理から推論、トラッキングに至るまで、低遅延で高レートセンサーストリームを管理するパイプラインを設計している。実際には、この融合は通常 2 つの補完的な制御手段を含む。第一に、計算負荷を管理するための処理ノブ(レート、ROI、解像度、モデル選択)がある。第二に、トラッキングにおける測定不確実性(例えば測定共分散 R など)をスケーリングする融合重みである。
LiDAR 処理
生点群データ(x, y, z, 強度)は通常、離散化(ボクセル化またはピラー化)され、その後 VoxelNet ファミリーのアプローチや PointPillars などの 3D 検出ネットワークによって処理されます。ボクセル/ピラーの解像度は、空間忠実度と推論レイテンシ・計算コストの間の重要なトレードオフとなります。
Radar 処理
レーダー測定値(距離、角度、相対速度)は、頑健な速度情報や悪天候下での運用のためにしばしば利用され、不確実性は文脈やクラッター特性に応じて調整可能です。
ツール類
デプロイメントパイプラインでは、TensorRT などの推論アクセラレータが組み込まれた GPU プラットフォーム(例えば NVIDIA Xavier クラスのシステム;より新しい世代は Orin クラスハードウェアも対象)上で深層学習モデルを最適化・実行するために使用されます。スタックによってモデル選択は異なりますが、標準的なバックボーン(例:ResNet)や検出器ファミリー(例:YOLO スタイル)は、自動運転車における 3D/BEV 固有アーキテクチャとともにコンピュータビジョン分野で広く利用されています。
Ahn ら(未定稿)が示すように、データ並列実行と選択的な GPU オフロードを組み合わせることで、精度目標を維持しつつ知覚パイプラインの全体スループットとレイテンシを改善できます。
このロジックが追跡・融合層においてどのように見えるかを可視化するために、文脈認識型ウェイトマネージャーを例に考えてみましょう。カルマンフィルタベースのトラッカーでは、センサーへの信頼度は測定共分散 R(通常はセンサーごと、および測定タイプごとに設定)によって表現されます:共分散が高いほどフィルタはその測定の依存度を下げ、共分散が低いほど依存度を高めます。
疑似コード:動的センサーウェイト付け (Python)
class SensorFusionManager:
def update_weights(self, vehicle_state, environment_context):
"""
文脈に基づいてセンサーの信頼度(共分散)を動的に調整します。
低い共分散=高い信頼度。
"""
# ベース設定(例示用のスカラー分散値/スケールファクター)
lidar_cov = 0.1
camera_cov = 0.2
radar_cov = 0.3
# シナリオ:高速道路での高速度走行
# 長距離レーダー/LiDAR をより信頼;カメラはモーションブラーの影響を受けやすい可能性あり
if vehicle_state.speed > 100.0: # km/h
radar_cov = 0.1 # 速度に関する情報でレーダーへの信頼を高める
camera_cov = 0.5 # カメラへの信頼を下げる
# シナリオ:都市部/混雑状況
# セマンティック理解(歩行者、標識など)にはカメラを信頼
elif environment_context.type == 'URBAN_DENSE':
lidar_cov = 0.05 # 近距離の幾何情報に対して LiDAR に最大限の信頼を置く
camera_cov = 0.1 # オブジェクト分類に対して高い信頼を置く
radar_cov = 0.4 # 混雑した環境では、いくつかの手がかりや関連付けにおいてレーダーは必ずしも信頼できない場合がある
return self.kalman_filter.update_covariance(
lidar=lidar_cov,
camera=camera_cov,
radar=radar_cov
)
経路計画:MPC の数学
知覚が確率を扱うのに対し、計画は制約を扱います。計画モジュールは、固定された制御間隔で、状態と制御のシーケンス {xk,uk}Nk=0 としてホライズンにパラメータ化された実行可能な経路を生成します。
これはスタックやプラットフォームにもよりますが、通常は数十ミリ秒から約 100 ミリ秒のオーダーです。このデッドライン(期限)を過ぎると応答性が低下します。
最適化問題
経路生成は一般的にモデル予測制御(MPC: Model Predictive Control)の問題として定式化されます。ハードコーディングされたルールではなく、ソルバーが最小化するコスト関数(J)をエンジニアが定義します。
J=∑N−1k=0(‖xk−xrefk‖2Q+‖uk‖2R)+‖xN−xrefN‖2P
ここで {xrefk}Nk=0 は予測ホライズンにおける参照経路を表します。
ここで
xk: k ステップ時点の状態ベクトル(位置、速度、ヨー角)。
uk: k ステップ時点の制御入力(操舵角、加速度)。
xrefk: k ステップ時点の参照状態(ホライズン上のその点における目標位置・見出し・速度)。通常は上位レベルのプランナー、ルート、または挙動モジュールによって提供される。
xrefN: ホライズンの終端における端末参照状態(N ステップ時点の参照値)。これは、ホライズン終了時の望ましい条件への収束を促すために使用される。
Q, R, P: 重み行列。Q と R および P を調整することで、エンジニアは「積極性」と「快適さ」のバランスを最適化する。
制約条件下での求解
ソルバーは、ハード制約を満たしながら最小の J を見つける必要がある。
アクチュエータおよびダイナミクス制限
||≤δmax(操舵角)|α|≤αmax(加速度)、必要に応じてレート制限も適用される。
セーフティコリドー
計画された自車両のフットプリントは、走行可能領域内に留まり、障害物との間隔を維持しなければならない。これは通常、コリドー境界、符号付き距離制約、または衝突幾何学の凸近似として表現される。
図 3: MPC コントロールループ
[ここをクリックして上記画像をフルサイズで表示]
ソルバーおよびアルゴリズム
自動運転において、MPC は安全性に反応しつつ速度と快適さのバランスを取るために使用されてきた。組み込み期限を満たすため、チームは通常ウォームスタートされたソルバーに依存する。具体的には、凸 MPC 定式化に対して QP ソルバー(例:OSQP)を、非線形定式化に対して非線形計画法ソルバー(例:Ipopt)またはリアルタイム NMPC ツールチェーンを利用する。
Allamaa らの 2024 年の研究は、高度な MPC(モデル予測制御)定式化とハイブリッド最適化手法が、安全かつ俊敏な意思決定をどのように実現するかを示しています。Zhang、Rossi、Pavone の 2015 年以前の先行研究では、MPC を車両個体の軌道制御ではなく、フリート調整レベルにおける自律移動システムにおける再帰的ホライズン意思決定のより広範な例として提示しています。さらに、Arrigoni、Braghin、Cheli の 2021 年の研究では、遺伝的アルゴリズム戦略を用いて NMPC(非線形モデル予測制御)軌道計画問題を解く代替アプローチを探求しています。生産環境(多くの場合 C++ で実装)においては、最適化ループは極めて効率的であり、予測可能で、最悪ケースのパフォーマンスを計測・監視できるものでなければなりません。
疑似コード:MPC コスト関数 (C++)
// 簡略化された MPC コスト計算ループ
double calculate_cost(const std::vector& preds,
const Trajectory& ref_traj,
const std::vector& u_seq) {
double total_cost = 0.0;
// 動作調整用の重み(快適性 vs 追従性)
const double W_POS = 10.0; // 位置誤差に対するペナルティ
const double W_JERK = 50.0; // 不連続な操舵に対する高いペナルティ (快適性/滑らかさ Δsteer)
const double W_VEL = 1.0; // 速度偏差に対するペナルティ
for (int t = 0; t < preds.size(); ++t) {
// 位置誤差の計算
double pos_error = ...; // 省略された実装詳細
total_cost += W_POS * (pos_error * pos_error);
// 速度偏差の計算
double vel_error = ...; // 省略された実装詳細
total_cost += W_VEL * (vel_error * vel_error);
}
// ジーク(不連続性)ペナルティの計算
for (int t = 1; t < u_seq.size(); ++t) {
if (u_seq[t].steer != u_seq[t-1].steer) { // 簡略化された条件
const double steering_delta_penalty = u_seq[t].steer - u_seq[t-1].steer;
total_cost += W_JERK * (steering_delta_penalty * steering_delta_penalty);
}
}
return total_cost;
}
リアルタイム計算リソースとミドルウェア
自動運転(AV)スタックは「活発な生態系」です。自己位置推定、知覚、予測、制御はすべて並列で実行され、同じ CPU および GPU リソースを競合します。もし知覚モジュールが画像処理に時間がかかりすぎると、計画モジュールは更新ウィンドウを見逃す可能性があります。
確定的スケジューリング
この問題を防止するため、多くのチームは計算リソース自体をエンジニアリングの最適化問題として扱います:実行時間の計測、コアの割り当て、優先度の設定、そして適切なタスクが適切な時刻に実行されるよう QoS(サービス品質)を調整します。最悪ケース実行時間(WCET: Worst-Case Execution Time):各ノードには測定値(または保守的に見積もられた値)としての WCET と、明示的なデッドライン予算が設定されます。確定的スケジューリングポリシー:リアルタイムスケジューリングは、安全性・制御上重要なドメインでは RTOS(リアルタイムオペレーティングシステム)によって、汎用 OS ではリアルタイムスケジューリング構成によって強制されます。固定優先度プリエンプティブスケジューリングが一般的であり、優先度継承などのプロトコルにより共有リソースでのブロッキングを制限し、デッドラインにクリティカルなタスクを保護します。
実際には、これらの予算はマルチレートです:高レベルの計画は通常約 10-20 Hz(50-100 ms)で実行される一方、低レベルの制御ループは専用コントローラ上で約 50-100 Hz(10-20 ms)で動作することがあります。正確なレートはプラットフォームと安全性アーキテクチャに依存します。
モジュール
割り当て時間
ハードウェアターゲット
機能
センサー取得
0 - 10 ms
FPGA / NIC
タイムスタンプ付与 & パケット化
前処理
10 - 25 ms
GPU (CUDA)
点群フィルタリング、画像リサイズ
知覚推論
25 - 55 ms
NPU / GPU
CNN 推論(YOLO/PointPillars)
融合 & 追跡
55 - 65 ms
CPU
カルマンフィルタリング、オブジェクト ID 関連付け
予測 & プランニング
65 - 85 ms
CPU
意図予測、軌道最適化(例:MPC)
安全チェック
85 - 90 ms
Safety Core
ルールチェック、制約検証、フォールバックトリガー
制御 & アクチュエーション
90 - 100 ms
ECU
CAN バスコマンド送信
表 1: 100ms コントロールサイクルの例示レイテンシ予算(参考値)
この厳密性の重要性は、Sun et al. 2023 が多レート AV ソフトウェアスタックにおけるエンドツーエンドのレイテンシを分析するための統合フレームワークを提案し、クリティカルなタスクチェーンがデッドラインを満たすことを保証していることからも強調されています。
デバッグと説明可能性:データ層
最適化はシステムを賢くしますが、同時にデバッグを困難にします。MPC ソルバーが経路を選択する際、それは単純な「if-then」文ではなく、コスト関数の収束に基づいています。
この課題に対処するため、チームは堅牢なログパイプラインを構築しています。そこでは、考慮された特定の制約、バランスの取られたトレードオフ、そして選択された経路が記録されます。
データ形式
時間同期型ロボティクスデータについては、分析ワークフローやストレージの制約に応じて、MCAP(ロボティクスのログキャプチャと再生に広く使用されている)のようなコンテナ形式や、HDF5 などのデータセット指向形式が一般的な選択肢となります。
スキーマ
多くのチームは、型安全性、前方/後方互換性、およびコンポーネント間での信頼性の高いツールチェーンを確保するために、Protocol Buffers や FlatBuffers を用いて厳格なバージョン管理されたスキーマを定義しています。
例:知覚オブジェクトスキーマ(Protobuf)
message DetectedObject {
// 時間的な一貫性のための一意の追跡 ID
uint32 track_id = 1;
// オブジェクト分類
enum Type { UNKNOWN=0; PEDESTRIAN=1; VEHICLE=2; CYCLIST=3; }
Type type = 2;
// ステートベクトル [x, y, z, vx, vy, vz, yaw]
repeated float state = 3 [packed=true];
// 3D バウンディングボックスの寸法
Vector3 dimensions = 4;
// センサーフュージョンの信頼度レベルのための共分散行列(平坦化された 7x7)
repeated float covariance = 5 [packed=true];
}
このデータは説明可能性の基盤を形成します。Suresh Kolekar らによる 2022 年の研究では、Grad-CAM などの可視化ツールが、AI モデルがいかに世界を認識しているかを人々に示す窓となることを示しています。このような洞察は単に安全性チェックを支援するだけでなく、モデルの挙動を伝達する際の透明性を支えるものです。
結びの言葉
最適化は、自律走行車における単なる数学的手法ではありません。それはシステム全体を結びつける接着剤です。これは、知覚ワークロードのスケジューリングと加速(適用可能な場合は GPU カーネルレベルおよびグラフレベルの最適化を含む)の方法を形作り、計画段階で制約付き最適化問題をどのように定式化し解決するか、また遅延と安全性要件を満たすためにリアルタイムスケジューリングポリシーやミドルウェア QoS をどのように設定するかを決定します。
ソフトウェアエンジニアにとっての教訓は明確です。自律走行車(AV)スタックを構築することは、論理に従ったコードを書くことだけではありません。リソース、時間、物理的制約を同時に管理するシステムを構築することなのです。業界が自律性の限界に挑戦し続ける中で、これらのトレードオフを最適化する能力は、引き続き決定的なスキルであり続けます。
著者について
アヴラーム・トルミディス
アヴラーム・トルミディスは、Expedia Group のソフトウェア開発エンジニアリングシニアマネージャーです。産業界と学術界の両方でソフトウェアエンジニアリングチームを率いており、整合性システム、フィンテックプラットフォーム、自動車ソフトウェア、応用 AI にわたる経験を持っています。以前は Meta でエンジニアリングマネージャーを務め、大規模な整合性システムに取り組むチームを率いました。Meta 入社前にはアムステルダムの Backbase でエンジニアリングチームを管理し、小売およびビジネス顧客向けのコアバンキングプラットフォームの構築に従事しました。また、Continental、ZF、Aptiv の各社で自動車分野における技術職も務めました。彼はテッサロニキのアリストテレス大学から電気・コンピュータ工学の博士号を取得しており、研究は最適化と協調ロボティクスに焦点を当てていました。その後、都市交通管理への AI 応用に関する業務に従事しています。
Show moreShow less
原文を表示
Key Takeaways
A production-grade AV stack is best understood as a distributed dataflow graph of publish/subscribe components (often cyclic in practice due to feedback and replanning), typically implemented via middleware such as ROS 2 on top of Data Distribution Service (DDS).
Engineering an AV stack is not just writing code that follows logic; it is building a system that manages resources, time, and physics constraints simultaneously.
Optimization in perception often means context-aware prioritization: adjusting sensing, preprocessing, and inference effort to match the current Operational Design Domain (ODD).
Instead of hard-coding rules, engineers define a Cost Function (J) that the solver minimizes.
Many teams treat the compute budget itself as an engineering optimization problem: They measure execution times, allocate cores, set priorities, and tune quality of service (QoS) so the right work happens at the right time.
Introduction
Autonomous driving systems are often discussed in terms of AI capabilities or high-level ethics. However, for the software architects and engineers building these systems, the reality is a battle against latency, bandwidth, and computational constraints. This article explores the end-to-end technical architecture of an AV stack, illustrating how optimization techniques, from context-aware sensor fusion to Model Predictive Control (MPC) solvers, turn gigabytes of raw sensor data into safe control commands within millisecond-level deadlines.
The End-to-End Architecture: From Sensor to Actuation
At first glance, automated driving systems reveal formidable complexity. These systems are not simple linear pipelines; they are recursive, real-time loops of perception, prediction, planning, and control.
To understand where optimization is required, it helps to first look at the data flow. A production-grade AV stack is best understood as a distributed dataflow graph of publish/subscribe components (often cyclic in practice due to feedback and replanning), typically implemented via middleware such as ROS 2 on top of DDS (Data Distribution Service). The pipeline must ingest and process massive amounts of data from cameras, radars, LiDARs, GNSS, and IMUs every second.
Figure 1 below summarizes this end-to-end architecture, from high-rate sensor inputs through perception/localization and fusion to planning, control, and actuation, so the main data and compute flow is visible at a glance.
Figure 1: High-level AV software architecture
[Click here to expand image above to full-size]
Typical Data Throughput Volumes
LiDAR: ~0.3–2.6 million points/sec (often ~35–255 Mbps per sensor depending on configuration).
Cameras: 4K/60fps streams (full-color uncompressed video can require ~12 Gbps; Production systems typically rely on RAW formats and/or compression).
Radar: Sparse detections/tracks (typically low bandwidth, high refresh rate).
Optimizing the Perception Pipeline: Dynamic Resource Allocation
The perception layer is responsible for turning raw data into a world model. A naive approach processes every sensor at full resolution and maximum frequency. However, processing gigabytes of data every second at full fidelity would saturate the computational resources of any vehicle.
Context-Aware Sensor Prioritization
Optimization in perception often means context-aware prioritization: adjusting sensing, preprocessing, and inference effort to match the current Operational Design Domain (ODD). Stacks frequently model the computational cost of key pipeline stages and apply policies (or optimization-based controllers) that trade off accuracy, latency, and resource usage.
Highway Scenario
The Region of Interest (ROI) narrows and long-range precision is critical. Consequently, stacks often prioritize forward-looking LiDAR and long-range cameras, while reducing load from side-facing sensors via downsampling, reduced frame/scan rates, or selective ROI processing.
Urban Scenario
Peripheral coverage becomes more important for cross-traffic, vulnerable road users, and complex interactions. Stacks often prioritize wide-angle cameras and side-looking sensors, and may allocate more compute to semantic perception and tracking.
Figure 2: Dynamic Sensor Weighting Logic
[Click here to expand image above to full-size]
Technical Implementation: From Preprocessing to Fusion
In production AV programs, perception pipelines need this kind of flexible allocation. Many teams go beyond single-stage object lists and design pipelines that manage high-rate sensor streams with low latency, starting from early preprocessing through inference and tracking. In practice, this fusion typically involves two complementary controls. First, there are processing knobs (rate, ROI, resolution, model choice) to manage compute load. Next are fusion weights that scale measurement uncertainty (e.g., the measurement covariance, R) in tracking.
LiDAR Processing
Raw point clouds (x, y, z, intensity) are typically discretized (voxelization or pillarization) and then consumed by 3D detection networks such as VoxelNet-family approaches or PointPillars. The voxel/pillar resolution is a critical trade-off between spatial fidelity and inference latency/compute.
Radar Processing
Radar measurements (range, angle, range-rate) are often leveraged for robust velocity cues and adverse weather operation; uncertainty can be adjusted by context and clutter characteristics.
Tooling
Deployment pipelines often use inference accelerators such as TensorRT to optimize and run deep learning models on embedded GPU platforms (for example, NVIDIA Xavier-class systems; Newer generations also target Orin-class hardware). Model choices vary by stack, but standard backbones (e.g., ResNet) and detector families (e.g., YOLO-style) are widely used in computer vision alongside 3D-/BEV-specific architectures in AV.
As Ahn et al., n.d. show, combining data-parallel execution with selective GPU offload can improve end-to-end throughput and latency in perception pipelines while maintaining accuracy targets.
To visualize how this logic looks in the tracking/fusion layer, consider a context-aware weight manager. In a Kalman-filter-based tracker, sensor trust can be represented via the measurement covariance R (often per sensor and per measurement type): Higher covariance reduces the filter’s reliance on a measurement, while lower covariance increases it.
Pseudocode: Dynamic Sensor Weighting (Python)
class SensorFusionManager:
def update_weights(self, vehicle_state, environment_context):
"""
Dynamically adjusts sensor trust (covariance) based on context.
Low covariance = High Trust.
"""
# Base configuration (illustrative scalar variances / scale factors)
lidar_cov = 0.1
camera_cov = 0.2
radar_cov = 0.3
# SCENARIO: High-Speed Highway
# Trust long-range Radar/LiDAR more; Cameras may suffer motion blur
if vehicle_state.speed > 100.0: # km/h
radar_cov = 0.1 # Increase trust in Radar for velocity
camera_cov = 0.5 # Decrease trust in Camera
# SCENARIO: Urban / Congested
# Trust Cameras for semantic understanding (pedestrians, signs)
elif environment_context.type == 'URBAN_DENSE':
lidar_cov = 0.05 # Max trust in LiDAR for close-range geometry
camera_cov = 0.1 # High trust for object classification
radar_cov = 0.4 # Radar can be less reliable for some cues/associations in dense clutter
return self.kalman_filter.update_covariance(
lidar=lidar_cov,
camera=camera_cov,
radar=radar_cov
)
Trajectory Planning: The Mathematics of MPC
While perception deals with probabilities, planning deals with constraints. The planning module generates a feasible trajectory, typically parameterized over a horizon as a sequence of states and controls {xk,uk}Nk=0 , at a fixed control cadence.
It is commonly on the order of tens of milliseconds to approximately one hundred milliseconds depending on the stack and platform. Missing this deadline degrades responsiveness.
The Optimization Problem
Trajectory generation is commonly framed as a Model Predictive Control (MPC) problem. Instead of hard-coding rules, engineers define a Cost Function (J) that the solver minimizes.
J=∑N−1k=0(‖xk−xrefk‖2Q+‖uk‖2R)+‖xN−xrefN‖2P
Here {xrefk}Nk=0 denotes the reference trajectory over the prediction horizon.
Where
xk: State vector at step k (position, velocity, yaw).
uk: Control input at step k (steering angle, acceleration).
xrefk: reference state at step k (the desired position/heading/velocity at that point along the horizon), typically provided by a higher-level planner, route, or behavior module.
xrefN: terminal reference state at the end of the horizon (the reference at step N), used to encourage convergence toward the desired end-of-horizon condition
Q, R, and P: Weight matrices. By tuning Q and R and P, engineers optimize for "assertiveness" vs. "comfort".
Solving Under Constraints
The solver must find the minimum J subject to hard constraints.
Actuation and dynamics limits
||≤δmax (Steer)|α|≤αmax (Accel), plus rate limits where applicable.
Safety Corridors
The planned ego footprint must remain within the drivable region and maintain separation from obstacles (often expressed via corridor boundaries, signed-distance constraints, or convex approximations of collision geometry).
Figure 3: MPC Control Loop
[Click here to expand image above to full-size]
Solvers and Algorithms
In autonomous driving, MPC has been used to balance speed and comfort while reacting safely. To meet embedded deadlines, teams typically rely on warm-started solvers: QP solvers such as OSQP for convex MPC formulations, and nonlinear programming solvers (e.g., Ipopt) or real-time NMPC toolchains for nonlinear formulations.
Research by Allamaa et al. 2024 illustrates how advanced MPC formulations and hybrid optimization techniques provide safe, agile decision-making.Earlier work by Zhang, Rossi, and Pavone 2015 provides a broader example of MPC as receding-horizon decision-making in autonomous mobility systems at the fleet coordination level, rather than ego-vehicle trajectory control. Additionally, Arrigoni, Braghin, and Cheli 2021 research explores an alternative approach in which an NMPC trajectory planner is solved using a genetic algorithm strategy. In production (often C++) implementations, the optimization loop must be highly efficient, predictable, and instrumented for worst-case performance.
Pseudocode: MPC Cost Function (C++)
// Simplified MPC Cost Calculation Loop
double calculate_cost(const std::vector<State>& preds,
const Trajectory& ref_traj,
const std::vector<Control>& u_seq) {
double total_cost = 0.0;
// Weights for tuning behavior (Comfort vs. Tracking)
const double W_POS = 10.0; // Penalty for position error
const double W_JERK = 50.0; // High penalty for jerky steering (Comfort/smoothness Δsteer)
const double W_VEL = 1.0; // Penalty for speed deviation
for (int t = 0; t < HORIZON_N; ++t) {
// 1. State Deviation Cost (Tracking Accuracy)
const double pos_error = (preds[t].x - ref_traj[t].x);
const double vel_error = (preds[t].v - ref_traj[t].v);
total_cost += W_POS * (pos_error * pos_error);
total_cost += W_VEL * (vel_error * vel_error);
// 2. Control Input Cost (Passenger Comfort)
// Penalize large changes in steering (delta_delta)
if (t > 0) {
const double steering_delta_penalty = u_seq[t].steer - u_seq[t-1].steer;
total_cost += W_JERK * (steering_delta_penalty * steering_delta_penalty);
}
}
return total_cost;
}
Real-Time Compute Budget and Middleware
An AV stack is a "busy ecosystem." Localization, perception, prediction, and control all run in parallel, competing for the same CPU and GPU resources. If perception takes too long to process an image, the planning module might miss its update window.
Deterministic Scheduling
To prevent this problem, many teams treat the compute budget itself as an engineering optimization problem: They measure execution times, allocate cores, set priorities, and tune QoS so the right work happens at the right time. Worst-Case Execution Time (WCET): Each node has a measured (or conservatively estimated) WCET and an explicit deadline budget. Deterministic Scheduling Policies: Real-time scheduling is enforced either via an RTOS in safety-/control-critical domains or via real-time scheduling configurations on general-purpose operating systems. Fixed-priority preemptive scheduling is common; protocols such as priority inheritance help bound blocking on shared resources and protect deadline-critical tasks.
In practice, these budgets are multi-rate: high-level planning often runs at ~10-20 Hz (50-100 ms), while low-level control loops can run at ~50-100 Hz (10-20 ms) on dedicated controllers; exact rates depend on platform and safety architecture.
Module
Allocated Time
Hardware Target
Function
Sensor Acquisition
0 - 10 ms
FPGA / NIC
Timestamping & Packetization
Pre-Processing
10 - 25 ms
GPU (CUDA)
PointCloud filtering, Image resizing
Perception Inference
25 - 55 ms
NPU / GPU
CNN inference (YOLO/PointPillars)
Fusion & Tracking
55 - 65 ms
CPU
Kalman Filtering, Object ID association
Prediction & Plan
65 - 85 ms
CPU
Intent prediction, trajectory optimization (e.g., MPC)
Safety Check
85 - 90 ms
Safety Core
Rule checks, constraint validation, fallback triggering
Control & Actuation
90 - 100 ms
ECU
CAN bus command transmission
Table 1: Example Latency Budget for a 100ms Control Cycle (Illustrative)
The importance of this rigor is emphasized by Sun et al. 2023, who propose an integrated framework to analyze end-to-end latency in multi-rate AV software stacks, ensuring that critical task chains meet their deadlines.
Debugging and Explainability: The Data Layer
Optimization makes systems smarter, but also harder to debug. When an MPC solver chooses a path, it is based on the convergence of a cost function, not a simple "if-then" statement.
To solve this issue, teams engineer robust logging pipelines. They record the specific constraints considered, the trade-offs balanced, and the route chosen.
Data formats
For time-synchronized robotics data, common choices include container formats such as MCAP (widely used for robotics log capture and replay) and dataset-oriented formats such as HDF5, depending on the analysis workflow and storage constraints.
Schemas
Many teams define strict, versioned schemas using Protocol Buffers or FlatBuffers to ensure type safety, forward/backward compatibility, and reliable tooling across components.
Example: Perception Object Schema (Protobuf)
message DetectedObject {
// Unique tracking ID for temporal consistency
uint32 track_id = 1;
// Object Classification
enum Type { UNKNOWN=0; PEDESTRIAN=1; VEHICLE=2; CYCLIST=3; }
Type type = 2;
// State Vector [x, y, z, vx, vy, vz, yaw]
repeated float state = 3 [packed=true];
// 3D Bounding Box Dimensions
Vector3 dimensions = 4;
// Covariance Matrix (flattened 7x7) for Sensor Fusion trust levels
repeated float covariance = 5 [packed=true];
}
This data forms the backbone of explainability. Suresh Kolekar et al. 2022 show that visualization tools like Grad-CAM give people a window into how AI models see the world. That kind of insight doesn’t just help with safety checks, it supports transparency when communicating model behavior.
Final Thoughts
Optimization is not just a mathematical method for autonomous vehicles; it is the glue that holds the entire system together. It shapes how perception workloads are scheduled and accelerated (including GPU kernel- and graph-level optimizations where applicable), how constrained optimization problems are formulated and solved in planning, and how real-time scheduling policies and middleware QoS are configured to meet latency and safety requirements.
For the software engineer, the takeaway is clear: Engineering an AV stack is not just writing code that follows logic; it is building a system that manages resources, time, and physics constraints simultaneously. As the industry pushes the boundaries of autonomy, the ability to optimize these trade-offs will remain a defining skill.
About the Author
Avraam Tolmidis
Avraam Tolmidis is a Senior Manager, Software Development Engineering at Expedia Group. He has led software engineering teams across both industry and academia, with experience spanning integrity systems, fintech platforms, automotive software, and applied AI. Previously, Avraam was an engineering manager at Meta, where he led teams working on large-scale Integrity systems. Before Meta, he managed engineering teams at Backbase in Amsterdam, building core banking platforms for retail and business clients, and held technical roles in the automotive sector at Continental, ZF, and Aptiv. He holds a Ph.D. in Electrical and Computer Engineering from Aristotle University of Thessaloniki, with research focused on optimization and collaborative robotics, and later work applying AI to urban traffic management.
Show moreShow less
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み