2017年7月5日,百度舉行了AI開發者大會,在會上發布了Apollo項目,並進行了演示,該項目在Github上已經能夠被訪問。出於一個程序員的好奇,昨天試玩了一把,確實不錯。
http://apollo.auto/,這個是阿波羅的首頁,感興趣的可以注冊成為開發者。https://github.com/ApolloAuto/apollo這個時候github的地址。裝了個ubuntu,然后建一個目錄。git clone https://github.com/ApolloAuto/apollo.git 克隆下來以后運行下面幾個命令。
bash docker/scripts/install_docker.sh bash docker/scripts/dev_start.sh bash docker/scripts/dev_into.sh
第一個命令是安裝docker,注意不要使用sudo,也不建議使用root賬號。
第二個命令是開始部署開發環境,就是一堆的docker pull,這個時候需要等很久,如果你有一個好點的網絡環境可能會快很多,我是運行了大半天。
運行好是下面的界面。
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容器中。
進到容器中了。
hackcat@in_dev_docker:/apollo$
至此,整個docker就搞完了,接下來就需要編譯阿波羅了。
進入到容器后,運行以下命令進行編譯。
bash apollo.sh build
漫長的等待啊,電腦性能要好點,我是等了一晚上,不知道幾點搞好的,因為是虛擬機,分配的CPU內存都不多。至少40G硬盤吧。
編譯好以后就可以在里面運行阿波羅了。
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.
