Apollo自動駕駛框架試玩

  2017年7月5日,百度舉行了AI開發者大會,在會上發佈了Apollo項目,並進行了演示,該項目在Github上已經可以被訪問。出於一個程序員的好奇,昨天試玩了一把,確實不錯。node

  http://apollo.auto/,這個是阿波羅的首頁,感興趣的能夠註冊成爲開發者。https://github.com/ApolloAuto/apollo這個時候github的地址。裝了個ubuntu,而後建一個目錄。git clone https://github.com/ApolloAuto/apollo.git 克隆下來之後運行下面幾個命令。git

bash docker/scripts/install_docker.sh
bash docker/scripts/dev_start.sh
bash docker/scripts/dev_into.sh

 

  第一個命令是安裝docker,注意不要使用sudo,也不建議使用root帳號。程序員

  第二個命令是開始部署開發環境,就是一堆的docker pull,這個時候須要等好久,若是你有一個好點的網絡環境可能會快不少,我是運行了大半天。github

  運行好是下面的界面。docker

hackcat@hackcat-VirtualBox:~/source/apollo$ bash docker/scripts/dev_start.sh
dev-latest: Pulling from apolloauto/apollo
Digest: sha256:4119d0e023d773a5e47a68f31da41ee26a2173a84ae485bf65d39714736c710b
Status: Image is up to date for apolloauto/apollo:dev-latest
apollo_dev
apollo_dev
[sudo] hackcat 的密碼: 
/home/hackcat/source/apollo/data/core/core_%e.%p
[WARNING] Failed to find device with pattern "ttyUSB*" ...
[ OK ] Found device: /dev/ttyS31.
[ OK ] Found device: /dev/ttyS30.
[ OK ] Found device: /dev/ttyS29.
[ OK ] Found device: /dev/ttyS28.
[ OK ] Found device: /dev/ttyS27.
[ OK ] Found device: /dev/ttyS26.
[ OK ] Found device: /dev/ttyS25.
[ OK ] Found device: /dev/ttyS24.
[ OK ] Found device: /dev/ttyS23.
[ OK ] Found device: /dev/ttyS22.
[ OK ] Found device: /dev/ttyS21.
[ OK ] Found device: /dev/ttyS20.
[ OK ] Found device: /dev/ttyS19.
[ OK ] Found device: /dev/ttyS18.
[ OK ] Found device: /dev/ttyS17.
[ OK ] Found device: /dev/ttyS16.
[ OK ] Found device: /dev/ttyS15.
[ OK ] Found device: /dev/ttyS14.
[ OK ] Found device: /dev/ttyS13.
[ OK ] Found device: /dev/ttyS12.
[ OK ] Found device: /dev/ttyS11.
[ OK ] Found device: /dev/ttyS10.
[ OK ] Found device: /dev/ttyS9.
[ OK ] Found device: /dev/ttyS8.
[ OK ] Found device: /dev/ttyS7.
[ OK ] Found device: /dev/ttyS6.
[ OK ] Found device: /dev/ttyS5.
[ OK ] Found device: /dev/ttyS4.
[ OK ] Found device: /dev/ttyS3.
[ OK ] Found device: /dev/ttyS2.
[ OK ] Found device: /dev/ttyS1.
[ OK ] Found device: /dev/ttyS0.
[ OK ] Found device: /dev/can0.
[WARNING] Failed to find device with pattern "ram*" ...
[ OK ] Found device: /dev/loop7.
[ OK ] Found device: /dev/loop6.
[ OK ] Found device: /dev/loop5.
[ OK ] Found device: /dev/loop4.
[ OK ] Found device: /dev/loop3.
[ OK ] Found device: /dev/loop2.
[ OK ] Found device: /dev/loop1.
[ OK ] Found device: /dev/loop0.
[ OK ] Found device: /dev/loop-control.
4ffca0c5dc8efb214a3a41a63d395330c12736bd5a43247e78c60e638fa0357a
Adding user `hackcat' ...
Adding new group `hackcat' (1000) ...
Adding new user `hackcat' (1000) with group `hackcat' ...
The home directory `/home/hackcat' already exists.  Not copying from `/etc/skel'.

 

  第三個命令是進入到docker容器中。ubuntu

  進到容器中了。瀏覽器

hackcat@in_dev_docker:/apollo$ 

  

  至此,整個docker就搞完了,接下來就須要編譯阿波羅了。bash

  進入到容器後,運行如下命令進行編譯。網絡

  

bash apollo.sh build

  漫長的等待啊,電腦性能要好點,我是等了一夜,不知道幾點搞好的,由於是虛擬機,分配的CPU內存都很少。至少40G硬盤吧。ide

  編譯好之後就能夠在裏面運行阿波羅了。

  

bash scripts/hmi.sh

  打開人機交互界面。注意,不編譯也能獲得下面的結果,但網頁打不開,看了下log是缺乏各類文件。

  

hackcat@in_dev_docker:/apollo$ bash scripts/hmi.sh
Start roscore...
HMI ros node service running at localhost:8887
HMI running at http://localhost:8887
hackcat@in_dev_docker:/apollo$ 

 

  用谷歌瀏覽器訪問。 http://localhost:8887

  

  打開之後是這樣子的。左邊的setup作兩部操做,第一肯定目前軟件模塊都已正確加載,即Debug列表中的模塊,GPS驅動,控制器,總線,定位,Dreamview,數據記錄等,第二步是肯定GPS模塊和CAN總線模塊(這些是硬件模塊)都已經安裝,並能正常通訊。而後就能夠進行Record了,Record應該就是駕駛員駕駛車輛在封閉道路進行行駛,阿波羅記錄數據。開始行駛的時候點擊Start,行駛完了點擊Stop。下面的Quick Play是執行剛纔錄製的軌跡,進行自動駕駛。有點像電腦上的屏幕錄像腳本。

  硬件相關信息百度也提供了文檔,感興趣的同窗能夠去購買一些來,聽說三天就能打造出一輛自動駕駛汽車來。惟一苦惱的是,車輛須要有專業的總線技術服務公司來幫助咱們進行對接,這個像我等屌絲去哪裏找??

  https://github.com/ApolloAuto/apollo/blob/master/docs/quickstart/apollo_1_0_hardware_system_installation_guide.md#prerequisites,這個是硬件安裝步驟。

  • The vehicle must be modified for 「drive-by-wire」 technology by a professional service company. Also, a CAN interface hookup must be provided in the trunk where the IPC will be mounted.
相關文章
相關標籤/搜索