Skip to content

Architecture

hippo5329 edited this page Nov 10, 2026 · 3 revisions

Architecture (plan)

What carries over from linorobot2-cockpit, and what a walker changes.

Layers

browser ── supervisor (FastAPI :8000) ── rosbridge :9090
                 │
robot computer:  micro-ROS agent ── hexapod_bringup ── EKF ── SLAM / Nav2
                 │ (Wi-Fi UDP, or USB serial)
controller:      ESP32 firmware: micro-ROS node · gait engine · IK · 18 servo outputs · IMU · ultrasonic · battery

The miniHexa has no robot computer on board, so the first setup runs the agent and stack on a PC over Wi-Fi (like a robot without a Pi). A small SBC on the back is a later option.

Firmware (one binary, tools chosen by app, as in the cockpit)

  • base: micro-ROS node. Subscribes /cmd_vel (Twist on Jazzy, TwistStamped on Lyrical) and /body_pose (height, roll, pitch, yaw of the body over the feet). Publishes /imu/data, /sonar, /battery, /joint_states (commanded angles: the servos give no feedback), /odom/gait (body motion from completed steps).
  • AHRS on the controller: Madgwick's 6-axis filter on every IMU sample, so /imu/data carries roll and pitch against gravity; yaw is the gyro's integral, unanchored (no magnetometer).
  • Gait engine on the controller: tripod first, then ripple and wave. Body velocity → step length and direction per leg → foot trajectories → leg IK → servo pulses at 50 Hz. A lost /cmd_vel stream (timeout) ends the current step and stands, never freezes mid-stride.
  • Tools: servo_trim (centre and direction per joint, saved to NVS), test_servos (one joint at a time), test_imu, test_sensors, i2c_detect, adc_calibrate (battery divider).
  • Build and flash stay separate: PlatformIO builds, the cockpit flasher writes.

Odometry

No encoders: /odom/gait is dead reckoning from commanded steps and will slip. The EKF (robot_localization, hexapod_bringup) fuses its twist with the gyro's yaw rate, so the heading follows the gyro and not the slipping feet; position stays the gait's. Standing, the board takes the gyro's bias out and the gait declares its zero exact, so the heading holds. The QMI8658A has no magnetometer, so yaw has no absolute anchor; long runs need SLAM's scan matching, and the Standard Kit has no LiDAR: an LD19 is added, its data forwarded by the camera board (navigation.md).

Phases

  1. Bring-up: identify the board (questions in hardware-minihexa.md), save the vendor trims, flash our firmware, stand, move each joint, read IMU and range on their topics.
  2. Walk: tripod gait from /cmd_vel, teleop from the web UI, gait odometry measured against the floor.
  3. Map: an LD19 on the camera board, then SLAM, Nav2 and exploration with a legged footprint (navigation.md): running on the robot.
  4. Simulation: a simulated controller that walks with the same gait code and the real robot's slip.

Reused from linorobot2-cockpit

Supervisor and web UI shell, flasher, per-robot config files (<robot>_config.yaml, config data outside the repo), Docker images per distro, release and gate process. Wheel kinematics, motor drivers, encoders and PID are not used.


Home · Hardware: miniHexa · Firmware · Simulation · LiDAR, SLAM, Nav2 and exploration · Camera and vision · Web UI: Hexapod tab

Clone this wiki locally