22.2.3.3. 偵錯

turtlebot3_core.ino 包括了偵錯程式碼以檢查測距數據,連接的感測器及 TurtleBot3 或Dynamixels 智能馬達的狀態。這可能有助於您實作程式碼,並在沒有 ROS 連接的情況下對其進行測試。

第一步: 連接 LN-101USB to Serial 轉接器

第二步: 開啟 turtlebot3_core_config.h檔,啟動 DEBUG。之後上傳到 OpenCR 上。

第三步: 連接轉接器到 OpenCR 的 UART2

第四步: 下載 minicom 及設定 baudrate 57600 和 port name

$ sudo apt-get install minicom
  $ minicom -s

第五步: 按 OpenCR 板上的 reset 鍵,你會看到 turtlebot3_core.ino 啟動及一些數據

Success to init Motor Driver
Success to init Sensor
Success to init Diagnosis
Success to init Controller
---------------------------------------
EXTERNAL SENSORS
---------------------------------------
Bumper : 2
Cliff : 204.00
Sonar : 1.00
Illumination : 480.00
---------------------------------------
OpenCR SENSORS
---------------------------------------
Battery : 12.15
Button : 0
IMU :
    w : 1.00
    x : 0.00
    y : -0.00
    z : 0.00
---------------------------------------
DYNAMIXELS
---------------------------------------
Torque : 1
Encoder(left) : 876
Encoder(right) : 4001
---------------------------------------
TurtleBot3
---------------------------------------
Odometry :
         x : 0.00
         y : 0.00
     theta : 0.00

Last updated

Was this helpful?