New package saltybot_esp32_serial replaces saltybot_can_bridge
(CANable2/python-can) with direct USB-CDC serial to ESP32-S3 BALANCE
(CH343 chip, 1a86:55d3, /dev/esp32-balance @ 460800 baud).
Framing: [0xAA][LEN][TYPE][PAYLOAD][CRC8-SMBUS] matching bd-66hx spec.
esp32_balance_protocol.py — codec + streaming FrameParser (state-machine)
- Commands: HEARTBEAT(0x01), DRIVE(0x02), ESTOP(0x03), ARM(0x04), PID(0x05)
- Telemetry: STATUS(0x80), VESC_LEFT(0x81), VESC_RIGHT(0x82), ACK/NACK
esp32_balance_node.py — ROS2 node
- Subs: /cmd_vel, /estop, /saltybot/arm, /saltybot/pid_update
- Pubs: /saltybot/attitude, /saltybot/balance_state, /can/battery,
/can/vesc/{left,right}/state, /can/connection_status
- 500ms /cmd_vel watchdog → CMD_DRIVE(0,0)
- 200ms CMD_HEARTBEAT keepalive timer
- Auto-reconnect on serial disconnect
Proxied VESC telemetry: erpm, voltage, current, temp for IDs 56(L)/68(R).
Frees CANable2 for bd-p47c (Here4 GPS).
33 unit tests — all pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
898 B
Python
28 lines
898 B
Python
from setuptools import setup
|
|
|
|
package_name = "saltybot_esp32_serial"
|
|
|
|
setup(
|
|
name=package_name,
|
|
version="0.1.0",
|
|
packages=[package_name],
|
|
data_files=[
|
|
("share/ament_index/resource_index/packages", [f"resource/{package_name}"]),
|
|
(f"share/{package_name}", ["package.xml"]),
|
|
(f"share/{package_name}/config", ["config/esp32_balance_params.yaml"]),
|
|
(f"share/{package_name}/launch", ["launch/esp32_balance.launch.py"]),
|
|
],
|
|
install_requires=["setuptools", "pyserial"],
|
|
zip_safe=True,
|
|
maintainer="sl-perception",
|
|
maintainer_email="sl-perception@saltylab.local",
|
|
description="UART/USB-CDC serial bridge for ESP32-S3 BALANCE (bd-wim1)",
|
|
license="MIT",
|
|
tests_require=["pytest"],
|
|
entry_points={
|
|
"console_scripts": [
|
|
"esp32_balance_node = saltybot_esp32_serial.esp32_balance_node:main",
|
|
],
|
|
},
|
|
)
|