輪式自主移動機器人編程實戰

李德

  • 出版商: 清華大學
  • 出版日期: 2022-09-01
  • 售價: $359
  • 貴賓價: 9.5$341
  • 語言: 簡體中文
  • ISBN: 7302613222
  • ISBN-13: 9787302613220
  • 相關分類: 機器人製作 Robots
  • 立即出貨 (庫存 < 4)

  • 輪式自主移動機器人編程實戰-preview-1
  • 輪式自主移動機器人編程實戰-preview-2
  • 輪式自主移動機器人編程實戰-preview-3
輪式自主移動機器人編程實戰-preview-1

買這商品的人也買了...

商品描述

如果你想DIY 一款輪式自主移動機器人,又不知道如何實現,本書可能會幫到你。 《輪式自主移動機器人編程實戰》系統講解輪式自主移動機器人如何從0 到1 實現自主運動。以樹莓派和STM32 單片機為例, 詳細介紹輪式機器人的硬件結構,包括驅動控制器的搭建、中央處理器的選型開發、濾波算法、平面 地圖構建算法、規劃算法、導航算法、室外GPS 定位實戰案例(異地遠程控制和地圖路徑規劃等)、 室內BreezySLAM 建圖案例、ROS 開發案例等,以及自主移動機器人和無人車駕駛的基本實現原理, 都能在本書中找到答案。《輪式自主移動機器人編程實戰》還提供開放的雲平臺路徑規劃,可在農田、工業園區巡檢、物流送貨等 場景測試。 《輪式自主移動機器人編程實戰》可作為高等院校物聯網、機器人、電腦、通信、電氣及自動化等專業的教材,也可作為計 算機、電子及智能車設計競賽的自學或培訓教材,還可供各類電子工程、自動化技術人員和電腦愛 好者學習參考。

目錄大綱

·目錄·

第1部分 基礎知識 

第1章 輪式機器人的基礎知識 ···································································2

1.1 輪式機器人的定義與應用 ······································································2

1.2 輪式機器人的結構················································································3

1.3 機器人的驅動方式················································································4

1.4 本章總結····························································································5

第2章 機器人的構成 ···············································································6

2.1 機器人的規劃······················································································6

2.2 輪式機器人的轉向結構 ·········································································8

2.2.1 輪式機器人的差速轉向 ··················································································8

2.2.2 輪式機器人的獨立舵機轉向 ············································································9

2.2.3 阿克曼轉向結構 ··························································································11

2.2.4 輪式機器人轉向比較 ····················································································11

2.2.5 差速機器人里程計運動模型 ···········································································12

2.3 輪式機器人電動機的選型 ····································································13

2.3.1 輪式機器人:電動機性能 ··············································································13

2.3.2 輪式機器人:GA370電動機參數計算 ·······························································14

2.4 機器人的驅動模塊··············································································15

2.4.1 驅動芯片L298N性能 ····················································································15

2.4.2 驅動模塊 L298N的使用方法 ···········································································16

2.4.3 驅動板TB6612FNG的使用方法 ·······································································17

2.5 輪式機器人的大腦:控制器選型 ···························································18

2.6 輪式機器人底盤DIY ···········································································19

2.6.1 DIY的兩種方法 ···························································································19

2.6.2 輪式機器人DIY改裝法 ··················································································21

2.7 輪式機器人總結·················································································23

2.7.1 輪式機器人整體框圖 ····················································································23

2.7.2 輪式機器人開發中涉及的軟件列表 ··································································23

2.8 本章總結··························································································24

第3章 輪式機器人的軟件提升 ··································································25

3.1 Keil軟件 ··························································································25

3.1.1 Keil軟件的安裝 ···························································································25

3.1.2 Keil 5軟件的使用 ························································································27

3.2 Linux基礎知識 ··················································································28

3.2.1 Linux的Shell ·······························································································28

3.2.2 編寫程序與腳本 ··························································································31

3.3 網絡基礎知識····················································································32

3.3.1 基礎通信 ···································································································32

3.3.2 MQTT協議 ································································································33

3.3.3 Linux安裝Mosquitto ·····················································································36

3.3.4 MQTT測試工具 ··························································································37

3.3.5 HTTP POST方法 ·························································································38

3.4 算法································································································39

3.4.1 PID控制算法 ······························································································39

3.4.2 移位濾波均值算法 ·······················································································44

3.4.3 高、低通濾波和互補濾波器 ···········································································45

3.4.4 初識貝葉斯 ································································································48

3.4.5 二值貝葉斯濾波 ··························································································49

3.4.6 卡爾曼濾波 ································································································51

3.5 本章總結··························································································58

第2部分 技術提升 

第4章 輪式機器人的底盤控制器:STM32開發 ············································60

4.1 底盤控制器的對外神經元:輸出PWM ····················································61

4.1.1 使用Keil模擬PWM輸出 ·················································································61

4.1.2 機器人中使用的PWM ···················································································66

4.2 底盤控制器的運動神經元:驅動控制 ·····················································66

4.2.1 驅動控制器的連接 ·······················································································66

目 錄

- V -

4.2.2 驅動源碼分析 ·····························································································66

4.3 底盤控制器的捕獲神經元:PWM捕獲測速 ··············································68

4.3.1 硬件 ·········································································································68

4.3.2 測速源碼分析 ·····························································································69

4.4 底盤控制器的中樞神經元:串口通信控制指令 ·········································71

4.5 底盤控制器的觸覺神經元:ADC電池電壓監測 ·········································75

4.5.1 硬件連接 ···································································································75

4.5.2 源碼分析 ···································································································75

4.6 底盤控制器的發光控制神經元:LED控制 ················································77

4.6.1 硬件連接 ···································································································77

4.6.2 源碼分析 ···································································································77

4.7 本章總結··························································································78

第5章 輪式機器人的主控制器:樹莓派開發 ················································79

5.1 樹莓派簡介·······················································································79

5.2 樹莓派資源·······················································································80

5.3 輪式機器人的交互窗口:樹莓派Shell ·····················································80

5.4 輪式機器人上網接口:Socket通信 ·························································83

5.5 輪式機器人從控制器通信接口:樹莓派串口 ············································83

5.5.1 樹莓派串口配置 ··························································································83

5.5.2 樹莓派USB轉串口 ·······················································································86

5.5.3 綁定串口 ···································································································87

5.6 輪式機器人無線聯網接口:樹莓派的WiFi功能 ·········································88

5.6.1 樹莓派WiFi連接路由器 ·················································································88

5.6.2 樹莓派WiFi做AP熱點 ···················································································89

5.7 機器人和手機App通信接口:樹莓派藍牙 ················································93

5.7.1 瞭解藍牙 ···································································································93

5.7.2 使用Socket功能進行藍牙通信 ·········································································95

5.8 輪式機器人野外上網接口:4G模塊 ························································96

5.8.1 USB-4G模塊的配置 ·····················································································97

5.8.2 USB-4G轉WiFi ···························································································97

5.9 輪式機器人的指南針:RTIMU模塊開發 ··················································98

5.9.1 RTIMULib庫介紹 ························································································98

5.9.2 RTIMULib庫的編譯和測試 ············································································99

5.9.3 基於RTIMULib的地磁計校準 ·······································································101

5.9.4 基於RTIMULib的加速計校準 ·······································································104

5.9.5 基於RTIMULib的陀螺儀校準 ·······································································104

5.10 輪式機器人的Web搭建 ······································································104

5.11 輪式機器人樹莓派固件燒錄 ·······························································113

5.12 本章總結 ·······················································································114

第6章 輪式機器人的其他神經元:傳感器開發 ···········································115

6.1 DS18B20溫度傳感器開發 ····································································115

6.1.1 DS18B20溫度傳感器的接口定義 ···································································115

6.1.2 代碼實現 ·································································································116

6.2 GPS戶外定位傳感器 ··········································································118

6.2.1 定位模塊的接口定義 ··················································································118

6.2.2 NMEA-0183協議 ·······················································································118

6.2.3 協議解析流程及實現 ··················································································119

6.3 激光雷達傳感器················································································121

6.3.1 激光雷達介紹 ···························································································122

6.3.2 激光雷達協議 ···························································································123

6.4 攝像頭圖像傳感器·············································································127

6.4.1 攝像頭的使用 ···························································································128

6.4.2 視覺循跡機器人實例 ··················································································128

6.5 本章總結·························································································129

第7章 輪式機器人的雲:物聯網雲平臺 ····················································130

7.1 微型服務雲平臺簡介··········································································130

7.2 搭建局域網的Server ···········································································130

7.2.1 安裝PhpStudy ···························································································131

7.2.2 搭建第一個物聯網雲 ··················································································132

7.3 阿裡雲服務器···················································································133

7.3.1 阿裡雲服務器選型 ·····················································································133

7.3.2 搭建LNMP服務器 ······················································································135

7.3.3 LAMP服務器的搭建 ···················································································138

7.4 JavaScript建立簡單的MQTT通信 ··························································140

7.5 本章總結·························································································143

第8章 輪式機器人路徑規劃 ···································································144

8.1 機器人路徑規劃················································································144

8.2 機器人全局規劃················································································145

8.2.1 機器人柵格建圖概述 ··················································································145

8.2.2 借助OpenCV畫軌跡 ···················································································146

8.2.3 柵格地圖的建圖過程 ··················································································151

8.2.4 機器人全局整合規劃 ··················································································157

8.2.5 A*算法 ···································································································159

8.3 機器人局部決策················································································170

8.3.1 DWA算法 ································································································170

8.3.2 VFH避障算法 ···························································································173

8.4 本章總結·························································································177

第9章 輪式機器人路徑的定位和導航 ·······················································178

9.1 輪式機器人路徑跟隨··········································································178

9.1.1 MovePose和PID整定 ··················································································178

9.1.2 PurePuresuit跟隨算法··················································································182

9.1.3 路徑跟隨與測試 ························································································185

9.2 輪式機器人定位匹配··········································································189

9.2.1 粒子濾波 ·································································································189

9.2.2 粒子濾波定位(蒙特卡羅定位) ···································································190

9.3 GNSS定位導航 ·················································································190

9.4 本章總結·························································································192

第3部分 實戰案例 

第10章 機器人定位終端實例 ·································································194

10.1 機器人實體終端:模塊構成 ······························································194

10.2 輪式機器人通信:STM32和樹莓派之間的通信協議 ·································195

10.3 機器人與雲平臺通信:MQTT通信協議 ················································197

10.4 輪式機器人:配置網絡 ·····································································198

10.5 輪式機器人軟件說明 ········································································202

10.5.1 軟件框架 ·······························································································202

10.5.2 控制App:navigation ·················································································203

10.5.3 硬件信息確認 ·························································································205

10.6 輪式機器人的人機交互 ·····································································205

10.7 輪式機器人雲平臺功能介紹 ······························································206

10.7.1 添加設備 ·······························································································206

10.7.2 設備信息 ·······························································································207

10.7.3 趣味玩法 ·······························································································207

10.7.4 路徑規劃 ·······························································································209

10.8 手動規劃路徑的原理及操作 ·······························································210

10.9 本章總結 ·······················································································211

第11章 BreezySLAM室內定位導航機器人實例 ··········································212

11.1 BreezySLAM的安裝 ·········································································212

11.2 BreezySLAM測試 ············································································214

11.3 BreezySLAM源碼分析 ······································································217

11.4 硬件搭建 ·······················································································221

11.5 軟件實現 ·······················································································221

11.6 測試運行 ·······················································································227

11.7 本章總結 ·······················································································227

第12章 ROS機器人開發實例 ·································································228

12.1 ROS介紹 ························································································228

12.2 ROS工具包 ····················································································229

12.3 Ubuntu環境下安裝ROS ·····································································230

12.4 發布GPS定位 node ···········································································233

12.5 發布imu node ··················································································234

12.6 STM32 通信node ·············································································235

12.7 Qt for ROS 界面 ··············································································238

12.8 本章總結 ·······················································································243