Skip to content
  • Add anything here or just remove it...
tutorio.twtutorio.tw
  • yesio
  • GoSUMO相撲擂台
  • 創新應用與紀實
    • 2026太平洋盃X華紙公益
    • 2025華紙盃支援專頁
  • 技術速查
  • Docs

dual2s基礎使用手冊

2
  • 【系統】dual2s快速上手-SWSP系統
  • 1-1_dual2s函數庫與開發環境設定

ros32控制器

1
  • GoYak – 4Dof全向輪式智慧機器手臂

Vibe微控器

5
  • 【Vibe】U04. 硬體控制變換練習
  • 【Vibe】U03. 建立你的AI韌體助手/專屬家教
  • 【Vibe-uP】Vibe教學,選用Agent還是Browser呢?
  • 【Vibe】U02. 一位稱職的韌體架構師
  • 【Vibe】U01. AI 寫韌體容易「翻車」,WHY?

基礎環境

1
  • 2026 競賽技術資料

社群開源專題

2
  • 【機構】獨角仙主動防禦 / RhinoSUMO
  • 競賽/活動地圖開源模型說明
View Categories
  • Home
  • Docs
  • ros32控制器
  • GoYak – 4Dof全向輪式智慧機器手臂

GoYak – 4Dof全向輪式智慧機器手臂

2 min read

DEMO #


韌體線上更新 #

GoYak線上燒錄系統【傳送門】

使用方式:


UART命令定義 #

目前ros32開放3種UART命令,每個參數欄位(uint_8)。

【0xA1】命令:控制車體以RPM進行omni運動。

【0xA2】命令:控制車體以PWM進行omni運動。

【0xB1】命令:分別對各軸MG995伺服馬達下達角度(角度範圍,請依據下圖各軸機械角規範)。


範例程式 #

本範例使用G14、G15、GND腳位

CRC範例 #

def calculate_crc(data):
    crc = 0
    for byte in data:
        crc ^= byte  # XOR 累加
    return crc

UART 發送運動命令範例(Raspberry Pi 5) #

注意:Pi 5實體UART裝置指向 port=”/dev/ttyAMA0″


import serial
import time
import random
def calculate_crc(data):
    crc = 0
    for byte in data:
        crc ^= byte  # XOR 累加
    return crc
# 設定 UART 連接埠 (根據你的 Raspberry Pi 硬體調整 ttyS0 或 ttyAMA0)
uart = serial.Serial(
    port="/dev/serial0",  # Raspberry Pi 內建 UART
    baudrate=115200,
    bytesize=serial.EIGHTBITS,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    timeout=1
)
def send_data():
    command_List = [0x11, 0x22, 0x33, 0x44]
    command = random.choice(command_List)
    rpm = random.randint(50, 200)
    data = bytearray([0xA1, command, 0x00, rpm])  # 前 4 個 bytes
    crc = calculate_crc(data)  # 計算 CRC
    data.append(crc)  # 添加 CRC
    data.append(0x0A)  # 結尾 'n'
    uart.write(data)
    print("Sent:", data.hex())
    time.sleep(5)  # 每5秒隨機送一筆運動命令
if __name__ == "__main__":
    try:
        while True:
            send_data()
    except KeyboardInterrupt:
        print("nExit program.")
        uart.close()

UART發送運動停止命令(Raspberry Pi 5) #

注意:Pi 5實體UART裝置指向 port=”/dev/ttyAMA0″

import serial
import time
import random
def calculate_crc(data):
    crc = 0
    for byte in data:
        crc ^= byte  # XOR 累加
    return crc
# 設定 UART 連接埠 (根據你的 Raspberry Pi 硬體調整 ttyS0 或 ttyAMA0)
uart = serial.Serial(
    port="/dev/serial0",  # Raspberry Pi 內建 UART
    baudrate=115200,
    bytesize=serial.EIGHTBITS,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    timeout=1
)
def send_data():
    #command_List = [0x11, 0x22, 0x33, 0x44]
    #command = random.choice(command_List)
    #rpm = random.randint(50, 200)
    data = bytearray([0xA1, 0xDD, 0x00, 0x00])  # 停止車體運動
    crc = calculate_crc(data)  # 計算 CRC
    data.append(crc)  # 添加 CRC
    data.append(0x0A)  # 結尾 'n'
    uart.write(data)
    print("Sent:", data.hex())
    time.sleep(5)   # 每5秒隨機送一筆運動命令, 沒有特別意義!
if __name__ == "__main__":
    try:
        while True:
            send_data()
    except KeyboardInterrupt:
        print("nExit program.")
        uart.close()

Troubleshooting #

注意:Pi 5實體UART裝置指向 port=”/dev/ttyAMA0″


#sudo raspi-config
 > interfacing options
 > Serial port
 > No (shell停止UART) / Yes (硬體UART啟用 GPIO14(TX), GPIO15(RX))  

DEMO #

Updated on 21 8 月, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
GoYak – 4Dof全向輪式智慧機器手臂GoYak – 4Dof全向輪式智慧機器手臂

Powered by BetterDocs

發佈留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

大綱 outlines
  • DEMO
  • 韌體線上更新
  • UART命令定義
  • 範例程式
    • CRC範例
    • UART 發送運動命令範例(Raspberry Pi 5)
    • UART發送運動停止命令(Raspberry Pi 5)
  • Troubleshooting
  • DEMO
Copyright 2026 © 宏川智控有限公司
  • yesio
  • GoSUMO相撲擂台
  • 創新應用與紀實
    • 2026太平洋盃X華紙公益
    • 2025華紙盃支援專頁
  • 技術速查
  • Docs
  • -
  • Newsletter