Matt Spencer e2285c46f0 Harden base bring-up against CH340 control-transfer timeouts
The CH340 behind /dev/agvpro_controller rejects USB control transfers for up
to ~60s after a host reboot (kernel: "failed to send control message: -110"),
surfacing as TimeoutError from the TIOCMSET ioctl that clears DTR/RTS. Since
clearing DTR/RTS is what releases the ESP32's reset line, a single failed
attempt leaves the ESP32 held in reset and all its sensors silent.

can_power_on.py:
- open_serial_when_ready(): retry the open with backoff (60s budget) instead
  of dying on the first timeout. open_serial() now closes the fd if setup
  fails partway.
- try_power_on(): report success only when servo power is actually confirmed.
  Previously every failure path returned True ("assuming powered"), so a
  GET_POWER status of 0 followed by an unanswered POWER_ON still counted as
  success and the stack continued with the wheels unpowered.
- Retry the handshake 5 times before falling back to the permissive
  behaviour, and log loudly when it does.
- Never let a dead serial port block CAN bring-up. The wheel drives are on
  CAN and are not powered by this board, so a dead ESP32 must only cost
  IMU/voltage/IO/LED -- never the ability to drive.
- bring_up_can(): set the link down first so it is idempotent. The bitrate
  cannot be set on an already-UP link, so any restart where the link was
  still up aborted the launch and crash-looped the base stack.

agv_pro_hardware_interface.cpp:
- disable_dtr_rts(): retry briefly (2s budget), then continue rather than
  give up instantly. This runs in on_activate after AgvProWheelsSystem is
  already active, so a long block here starves the wheel read cycle until it
  errors out and the controllers lose their interfaces -- hence the small
  budget. can_power_on.py has normally already released the ESP32 by then.
2026-10-26 07:22:04 -07:00
2025-05-27 10:58:14 +08:00
2026-10-20 14:01:10 -07:00

AGV_Pro

ROS2 packages for AGV_Pro

agvpro_1

agvpro_2

Software environment for Jetson Orin Nano

ubuntu 24.04
ros2 lyrical

Installation

Create workspace and clone the repository.

git clone https://github.com/elephantrobotics/agv_pro_ros2.git agv_pro_ros2/src

Install dependencies

cd ~/agv_pro_ros2

rosdep install --from-paths src --ignore-src -r -y

Build workspace

cd ~/agv_pro_ros2

colcon build

Setup the workspace

source ~/agv_pro_ros2/install/local_setup.bash

Update to new version

cd ~/agv_pro_ros2/src

git pull

cd ..

colcon build

User manual

myagvPro_docs

Docker Compose services

docker-compose.yml defines two services built from the same image:

  • agv_pro (default) — exact current behaviour: wheels + IMU/voltage/digital-IO/LED are all controlled over the serial base controller at /dev/agvpro_controller. On target hardware this device comes from a udev rule; if you're testing without it (e.g. a raw USB-serial adapter), override the host-side path with AGV_PRO_SERIAL_DEVICE:

    AGV_PRO_SERIAL_DEVICE=/dev/ttyUSB0 docker compose up agv_pro
    
  • agv_pro_can — wheels are controlled directly over CAN using the RobStride private protocol instead of serial, via the community robstride_ros2 ros2_control driver (built from source, see upstream.lyrical.repos). IMU/voltage/digital-IO/LED remain on the serial base controller (/dev/agvpro_controller), unchanged. This replaces an earlier CANopen-based attempt (agv_pro_canopen_config/ros2_canopen) that was never confirmed against real hardware and has been removed — real, direction-confirmed CAN communication with the wheel drives (RobStride RS01 motors, CAN IDs 1-4) was subsequently verified empirically, including commanding all 4 wheels to spin forward together; see /memories/repo/agv_can_serial_hw_notes.md.

    Power-on sequencing: the servos only get 24V once the serial base controller's POWER_ON handshake succeeds, and on this hardware the CAN interface must stay administratively down until that happens (bringing it up any earlier blocks the serial port's DTR/RTS ioctl on the shared USB bus). agv_pro_hardware/AgvProHardwareInterface (running in sensors-only mode alongside robstride_ros2/RobStrideSystem in this mode) now brings the CAN interface up itself, automatically, right after POWER_ON succeeds — so only load the kernel driver beforehand and leave the link down:

    sudo modprobe gs_usb
    

    Do not run ip link set can0 up yourself — the hardware interface does this (along with txqueuelen 1000 and the confirmed real bitrate, 1 Mbit/s) once it's safe to do so.

    Then launch the robot with wheel_interface:=can (see agv_pro_bringup.launch.py), e.g.:

    ros2 launch agv_pro_bringup agv_pro_bringup.launch.py wheel_interface:=can can_interface_name:=can0
    

    This starts a ros2_socketcan bridge node on can_interface_name (publishing/subscribing can_msgs/msg/Frame on to_can_bus/from_can_bus) in addition to the usual nodes; robstride_ros2/RobStrideSystem talks to the physical bus through that bridge. The bridge binds the CAN socket at startup even while the link is still down — it simply starts seeing frames once the hardware interface brings the link up a few seconds later.

    Verified: can_id (1-4) to physical corner mapping, and motor direction, both confirmed by rotating/spinning real wheels — see /memories/repo/agv_can_serial_hw_notes.md. Still placeholder/unverified: gear_ratio, and the kp/kd velocity-mode gains in agv_pro.ros2_control.xacro — tune for the real mecanum drivetrain before relying on this for real motion. See agv_pro.ros2_control.xacro.

S
Description
No description provided
Readme BSD-3-Clause
99 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 69%
C 21.6%
Python 4%
CMake 1.9%
Java 1%
Other 2.2%