8.4.3 Ultrasonic 超音波感測器
新增設備: Ultrasonic sensor (HC-SR04)

預設 PIN 腳
Device
PIN
Trigger
BDPIN_GPIO_1
Echo
BDPIN_GPIO_2
於 Turtlebot3 使用操作
[Remote PC端]:執行 sonar launch 檔
$ roslaunch turtlebot3_example turtlebot3_sonar.launch
於 Arduino IDE 使用操作
此範例可用 Arduino IDE 開啟。選擇 File -> Examples -> ROS -> 2. Sensors -> c_ultrasonic。上傳到 OpenCR。
[Remote PC 端]:執行 ros serial_node 套件
$ rosrun rosserial_python serial_node.py __name:=turtlebot3_core _port:=/dev/ttyACM0 _baud:=115200
Last updated
Was this helpful?