Petoi Doc Center
🇹🇭 Thai
🇹🇭 Thai
  • ยินดีต้อนรับสู่ Petoi Doc Center
  • Infrared Remote
    • รีโมทคอนโทรล
  • Mobile App
    • คาลิเบเตอร์และคอนโทรลเลอร์
  • Desktop APP
    • การแนะนำเบื้องต้น
    • ตัวอัปโหลดเฟิร์มแวร์
    • การคาลิเบรทข้อต่อ
    • สกิลคอมโพสเซอร์
  • Arduino IDE
    • อัปโหลด Sketch สำหรับ NyBoard
    • อัปโหลด Sketch สำหรับ BiBoard
    • การคาลิเบรทด้วย Arduino IDE
    • ซีเรียลมอนิเตอร์
  • API
    • 🖇️ซีเรียลโปรโตคอล
    • 🐍คู่มือผู้ใช้ Python SerialMaster
    • 🐛MicroPython คอนโทรลเลอร์
      • การเรียกใช้ MicroPython บน ESP8266
      • ติดตั้ง WebREPL
      • การใช้โปรโตคอล ESP-NOW
    • 🍓การสื่อสารผ่านพอร์ตซีเรียลของ Raspberry Pi
    • 🤖ROS
  • Nyboard
    • NyBoard V1_0
    • NyBoard V1_1
  • BIBOARD
    • คู่มือเริ่มต้นใช้งาน BiBoard ฉบับรวบลัด
    • Demo Applications
      • 1.GPIO port
      • 2.Serial port
      • 3.Analog-digital converter
      • 4.Digital-Analog Converter
      • 5.EEPROM (Electrically Erasable Programmable read only memory)
      • 6.Gyro IMU(MPU6050)
      • 7.Infrared remote control
      • 8.PWM(Pulse Width Modulation)
      • 9.Servo(under construction)
      • 10.Classic Bluetooth serial port SPP
      • 11.Bluetooth low energy (BLE) serial port pass-through
      • 12.File system SPIFFS
      • 13.Add hardware partition configuration option in Arduino IDE
      • 14.Play MP3
      • 15.The usage of Wi-Fi OTA(Over-The-Air)
  • Communication Modules
    • Introduction
    • USB Uploader (CH340C or CH343G)
    • Dual Mode Bluetooth
    • WiFi ESP8266
      • ESP8266 + Python Scripts Implement wireless crowd control
  • Extensible Modules
    • Introduction
    • MU Camera
    • Ultrasonic Sensor
    • Light Sensor
    • Touch Sensor
    • Gesture Sensor
    • PIR Motion Sensor
  • Applications
    • Skill Creation
    • OpenCat Imitation Tutorial
    • Programmable Puppet Character
  • History
    • Upload Sketch For NyBoard (software 1.0)
  • Technical Support
    • 🛠️Supporting Application and Software
    • 🙋‍♂️FAQ(Frequently Asked Questions)
  • Useful Links 🕸
    • 🔭Official Site of Petoi
    • 💿GitHub of OpenCat
    • 🎪PetoiCamp (Forum)
Powered by GitBook
On this page
  • Using ROS on Raspberry Pi
  • Using ROS for remote control
  • Examples

Was this helpful?

Export as PDF
  1. API

ROS

ROS Interface

มี ROS wrapper ให้นักพัฒนาเชื่อมต่อกับ ROS environment.ได้อย่างสะดวกสบาย แนะนำให้ใช้ ROS ร่วมกับ Raspberry Pi.

Using ROS on Raspberry Pi

ในปัจจุบัน แนะนำให้ติดตั้ง ROS โดยใช้ Docker

  • install docker on Raspberry Pi (ref)

sudo apt-get update && sudo apt-get upgrade
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker pi
# test installation
docker run hello-world
  • prepare workspace

mkdir -p workspace/src
cd workspace/src
git clone https://github.com/PetoiCamp/ros_opencat
cd ros_opencat
git submodule init && git submodule update
cd ../../..
  • run the container

docker run -v path/to/workspace:/workspace \
-it --rm --privileged --network host --name ros ros:noetic-robot
  • source files and build inside the container

cd /workspace
source /opt/ros/noetic/setup.bash
catkin_makbase
source devel/setup.bash
  • run examples (see Examples for more)

rosrun opencat_examples opencat_examples_serial

Using ROS for remote control

ROS ถูกออกแบบมาเพื่อให้เหมาะสมกับการคำนวณแบบกระจาย ต่อไปนี้เป็นตัวอย่างง่ายๆ เกี่ยวกับวิธีการเรียกใช้โหนดบนเครื่องคอมพิวเตอร์ต่างกัน

  • on host machine (usually more powerful than Raspberry Pi)

# launch server
roscore
  • run service node on Raspberry Pi

export ROS_MASTER_URI=http://<Host_IP>:11311/
rosrun opencat_server opencat_service_node
  • send command from host

rosrun opencat_examples opencat_examples_client_cpp

Examples

  • using serial library

rosrun opencat_examples opencat_examples_serial
  • using ROS service

# start core
roscore
# start service server
rosrun opencat_server opencat_service_node
# examples using oppencat ros service in C++
rosrun opencat_examples opencat_examples_client_cpp
# examples using opencat ros service in python
rosrun opencat_examples opencat_examples_client_py
Previousการสื่อสารผ่านพอร์ตซีเรียลของ Raspberry PiNextNyBoard V1_0

Last updated 2 years ago

Was this helpful?

🤖