好奇號火星車的一些計算機軟硬體資訊

黃利民發表於2012-08-08

自從好奇號火星車在8月6日13點31分(北京時間)著陸火星後,這幾天有關它的訊息媒體一直有報導。本文將綜合整理網上討論“好奇號”引出的一些軟硬體資訊。

“好奇號”火星車簡介

“好奇號”火星車(Curiosity),是美國國家航空航天局迄今(2012年)最昂貴的火星探測專案。於2011年11月26日15點02分發射,在2012年8月6日中午13點31分(北京時間)降落火星。這輛探測車比2004年登陸的“機遇號”火星探測器和“精神號”火星探測器大得多,攜帶更多先進科學儀器。預計將運作至少一個火星年(約2個地球年),調查火星以前或現在存在生命的可能性。(摘自互動百科)

curiosity rover

 

“好奇號”的“大腦”硬體

與2004年發射的上一代漫遊車“精神號”和“機遇號”有何差別?一個顯而易見的差異是它們彼此的硬體:

“精神號”和“機遇號”包含 3 MB EEPROM,128 MB 記憶體和 256 MB快閃記憶體,處理器是 RAD6000(110萬個電晶體),運算速度35 MIPS;

“好奇號”的 Rover Compute Element 包含兩套相同的計算機系統,一個發生故障後另一個會自動配置接管,它包含 256KB EEPROM,256MB記憶體,2GB 快閃記憶體。抗輻射處理器是BAE 系統公司的 RAD750 (1040萬電晶體,核心頻率 110到200 MHz),基於IBM的PowerPC 750設計,速度400MIPS。(摘自 Solidot ,英文全文:extremetech。NASA 官網也有簡要介紹。)


 

“好奇號”的軟體資訊???

關於這方面,似乎沒看到過 NASA 官方或其他媒體的正式訊息。(注:可能有,但筆者沒看到。)

今年 6 月底有一則簡訊提到:“50 萬行程式碼決定“好奇號”登陸火星最後驚心動魄的 7 分鐘。” 但其中並未說這50萬行程式碼都是哪種程式語言。在“好奇號”著陸火星後,StackExchange 上有個討論帖:What is the Mars Curiosity Rover’s software built in? 

The Mars Curiosity rover has landed successfully, and one of the promo videos “7 minutes of terror” brags about there being 500,000 lines of code. It’s a complicated problem, no doubt. But that is a lot of code, surely there was a pretty big programming effort behind it. Does anyone know anything about this project? I can only imagine it’s some kind of embedded C.

 

在這個討論帖的回答中,World Engineer 回覆說:

It’s running 2.5 million lines of C on a RAD750 processor manufactured by BAE. The JPL has a bit more information but I do suspect many of the details are not publicized. It does appear that the testing scripts were written in Python.

“好奇號”在 BAE 系統公司製造的 RAD750 處理器上執行著 250 萬行 C 程式碼(基於一份 2009 年的 PDF 文件)。NASA 噴氣推進實驗室(JPL)上有些資訊,但我懷疑很多細節資訊都沒有公佈。“好奇號”的測試指令碼似乎是用 Python 編寫的。

 

根據 World Engineer 提到的那份來自噴氣推進實驗室(JPL)的文件《 Monitoring the Execution of Space Craft Flight Software | 飛船飛行軟體執行監控》(注意文件頁首上的 Copyright 2009 年字樣),其中提到了“ Mars Science Laboratory(火星科學實驗室)任務”當時的一些基本資訊:

• programmer team of 30  | 有 30 位程式設計師

• testing team of 10+ people | 測試團隊大於 10 人

• programming language is C, 2.5 M LOC | 250 萬行 C 程式碼

 

在 StackExchange 那個討論帖的回答中,Nate Parsons  提供了另外一些資訊:(下面摘譯了部分回覆,另外 Nate Parsons 特別強調他不是 JPL 員工)

The code is based on that of MER (Spirit and Opportunity), which were based off of their first lander, MPF (Sojourner). It’s 3.5 million lines of C (much of it autogenerated), running on a RA50 processor manufactured by BAE and the VxWorks Operating system. Over a million lines were hand coded.

“好奇號”的程式碼基於 MER(“精神號”和“機遇號”), MER 都是基於第一代登陸器 MPF (“

The code is implemented as 150 separate modules, each performing a different function. Highly coupled modules are organized into Components that abstract the modules they contain, and “specify either a specific function, activity, or behavior.” These components are futher organized into layers, and there are “no more than 10 top-level components.”

整個程式碼由 150 個獨立模組實現,每個模組執行不同的功能。高度耦合的模組組織成部件(提取他們所包含的模組,給各個模組指定具體的功能、動作或行為)。這些部件再進一步組織分層,頂層部件不超過 10 個。

Source: Keynote talk by Benjamin Cichy at 2010 Workshop on Spacecraft Flight Software (FSW-10), slides, audio, and video (starts with mission overview, architecture discussion at slide 80).

來源:Benjamin Cichy 在 2010 年飛船飛行軟體研討會(FSW-10)上的演講。(開始是任務概述,架構討論從第80頁開始)

 

譯註:① Benjamin Cichy 是噴氣推進實驗室(JPL )的高階軟體系統工程師,於 2002 年加入JPL;②飛船飛行軟體研討會(FSW) 由美國航天工業總公司主辦,噴氣推進實驗室(JPL)和約翰·霍普金斯大學應用物理實驗室協辦。

 

注意,上面這兩個回答並不是 NASA 官方釋出的訊息,只是根據以前的資料(2009年和2010年)推斷得出的。

 

補充資訊:

① 《 (NASA) JPL Institutional Coding Standard for the C Programming Language | 噴氣推進實驗室 之 C 語言編碼標準》33 條規則概要見附圖。微盤下載:http://t.cn/zWOyWu7

② 最後可以回顧一下“好奇號”火星車的全程登陸模擬動畫:

<embed>

 

 

相關文章