[Release v1.2.0] linearbot#50
Merged
Merged
Conversation
415582f to
aab3702
Compare
Mirror of dev/JH_i2rt-linear-bot into the public repo.
BREAKING CHANGES:
- FlowBase odometry translation vectors widen from 2-D [x, y] to 3-D
[x, y, z]. Existing callers that unpack odo["position"]["translation"]
or odo["velocity"]["{world,body}"]["translation"] as a 2-tuple must
accept a third component. z is 0.0 on a bare Vehicle and the
linear-rail height (m) on LinearRailVehicle.
- flow_base_controller CLI: the --no-linear-rail flag (opt-out, default
enabled) is replaced by --linear-rail (opt-in, default disabled), and
a new opt-in --gamepad flag now gates pygame/joystick init.
Highlights:
- flow_base: configurable control-loop frequency, per-motor wheel-speed
observation API, Y/yaw axis fix, switch flow_base_client CLI to tyro;
Vehicle.get_odometry() now returns 3-D translations
- linear_rail: meter-calibrated startup homing — drive top -> bottom,
derive meters_per_rad from the total stroke (total_stroke_m kwarg,
default 1.0 m), zero the encoder at the lower limit;
get_linear_rail_state() exposes calibrated linear position/velocity
in meters alongside motor rad
- gamepad: add get_raw_data(), negate teleop Y/yaw axes
- dm_driver: start control-loop thread on the auto-start path
- examples: drive_flow_base_viser (keyboard + viser GUI teleop, renders
base_frame at the actual rail height), plot_flow_base_rerun
(rerun-based observation monitor incl. z/vz)
- devices: point FlowBase / LinearRailVehicle desktop launchers at venv
python, add gamepad-teleop launchers (FlowBaseGamepad,
LinearRailVehicleGamepad), align launcher flags with the opt-in CLI;
setup_flow_desktop.sh gains colored progress output and lxterminal
auto-install
- pyproject.toml: add rerun-sdk>=0.32.2; add rpi-lgpio>=0.6 as a
Pi-only runtime dependency (PEP 508 markers; drop-in for RPi.GPIO
that works on Pi 5, used by linear_rail brake + limit switches)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…JH_i2rt-linear-bot - i2rt/flow_base/flow_base_client.py: added per-axis client-side velocity limits (max_vel_x/y/theta/z) with validated hard caps and clipping; rail velocity commands now in m/s - i2rt/flow_base/flow_base_controller.py: switched linear rail command handling to m/s with server-side conversion via calibrated meters_per_rad - i2rt/flow_base/README.md: documented m/s rail units and client-side velocity limit configuration - examples/drive_flow_base_viser/drive_flow_base_viser.py: pass max_linear/max_angular args through to FlowBaseClient limits Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
- i2rt/robots/config/yam.yml: reduced kp for joint 4 from 40.0 to 10.0 to match the gains of joints 5 and 6 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release v1.2.0 — mirror of the
dev/linear-botbranch (dev/JH_i2rt-linear-bot/) into the public repo. Adds flow_base configurability + 3-D odometry, meter-calibrated linear rail, two new flow_base teleop examples, Pi GPIO dependency, gamepad raw-data API + Y/yaw axis fix, a dm_driver auto-start fix, a CLI-flag flip onflow_base_controller.pyso gamepad and linear-rail are now opt-in, and gamepad desktop launcher variants with all launcher flags aligned to the new opt-in CLI.Changes
pyproject.toml: addrpi-lgpio>=0.6as a runtime dependency, PEP-508-gated to Pi-like Linux (sys_platform == 'linux' and platform_machine in {aarch64, armv7l, armv6l}) so it only installs on Raspberry Pi targets that need it for linear-rail GPIO (brake + limit switches).rpi-lgpiois a drop-in forfrom RPi import GPIOthat works on Pi 5 (BCM2712); legacyRPi.GPIOfails withcannot determine peripheral soc base addron Pi 5. Version pin stays at1.1.2.i2rt/flow_base/flow_base_controller.py: make control-loop frequency configurable per instance; fix inverted Y/yaw axes; expose per-motor wheel speeds; pretty-printget_observationoutput; widenVehicle.get_odometry()translations to 3-D (z=0);LinearRailVehicle.get_odometry()substitutes the calibrated rail height/rate forz/vz; addtotal_stroke_mkwarg (default1.0 m). CLI break:--no-linear-rail(opt-out, default on) is replaced by--linear-rail(opt-in, default off); new--gamepadflag (opt-in, default off) gates pygame/joystick init. Existing invocations that relied on the prior defaults must add--linear-railand/or--gamepadexplicitly.i2rt/flow_base/linear_rail_controller.py: rewrite startup calibration to drive top → bottom, capture motor angle at each limit, derivemeters_per_rad = total_stroke_m / (theta_upper - theta_lower), then zero the encoder at the lower limit so encoder0corresponds to bottom of travel.get_linear_rail_state()now exposes calibrated linear position/velocity in meters alongside motor radians.i2rt/flow_base/flow_base_client.py: switch CLI totyro; add_format_rail_state()helper; CLI output now formats 3-D translations ([px, py, pz]) and the new rail-state dict layout (motor rad + linear m).i2rt/flow_base/README.md: document 3-D translation semantics (zfrom rail height) and the expandedget_linear_rail_state()output (motor + linear position/velocity, limit-switch flags).i2rt/motor_drivers/dm_driver.py: start the control-loop thread on the auto-start path so newly constructed drivers actually run.i2rt/utils/gamepad_utils.py: addGamepad.get_raw_data()(used by the debug__main__); negate teleop Y/yaw axes.devices/FlowBase.desktop,devices/LinearRailVehicle.desktop: point desktop launchers at the venvpythoninstead of the system one; align Exec flags with the new opt-in CLI (FlowBase drops the removed--no-linear-rail, LinearRailVehicle now passes--linear-railexplicitly).devices/FlowBaseGamepad.desktop,devices/LinearRailVehicleGamepad.desktop: NEW — gamepad-teleop variants of the two launchers, passing--gamepad(plus--linear-railon the rail variant).devices/setup_flow_desktop.sh: install the two new gamepad launchers alongside the existing ones (copy to~/Desktop, mark trusted,chmod +x); add colored[INFO]/[SUCCESS]/[WARNING]progress output and auto-installlxterminal(required by all launchers) when missing, continuing gracefully if the install fails.examples/drive_flow_base_viser/: NEW — keyboard- and viser-GUI-slider-driven flow_base teleop with odometry visualization (now also rendersbase_frameat the actual railz), gated behind an enable checkbox.examples/plot_flow_base_rerun/: NEW —rerun-based observation monitor for flow_base (logspose/z,vel_world/vz,vel_body/vz, and a 3-D trajectory).Test Plan
release/v1.2.0, runuv sync --all-packagesand confirm the lockfile resolves cleanly on x86_64 (rpi-lgpiomust be skipped via the PEP 508 marker).uv sync --all-packagesand confirmrpi-lgpiois installed andfrom RPi import GPIOimports without raising.python -c "import i2rt; print(i2rt.__file__)"imports without error.FlowBaseClient.get_odometry()against a base-only flow_base and confirmposition.translationis a length-3 array withz == 0.0, andvelocity.world.translation/velocity.body.translationare also length-3. (Verifies the 3-D odometry break.)flow_base_controllerwith--linear-rail, wait for the top-then-bottom calibration to finish, then callget_linear_rail_state()and confirm bothposition.motor(rad) andposition.linear(m) are populated. Confirmget_odometry()reports a non-zerozmatching the rail height after driving the rail.python examples/drive_flow_base_viser/drive_flow_base_viser.py, open the viser URL, tick the enable checkbox, drag the sliders, and confirm the base drives in the expected direction (Y and yaw are no longer inverted). With a linear rail enabled, confirmbase_framelifts vertically in the 3-D view as the rail moves.python examples/plot_flow_base_rerun/plot_flow_base_rerun.pyand confirm rerun renderspose/z,vel_world/vz, and the 3-D trajectory in addition to per-motor wheel speeds.0at the lower-limit position; verify the upper-limit motor angle andmeters_per_radare logged at startup.DMDriverwith auto-start enabled and confirm motor messages flow without manually callingstart().python -m i2rt.utils.gamepad_utils, and confirmget_raw_data()output appears alongside the standard button readings.python -m i2rt.flow_base.flow_base_controllerwith no flags and confirm the linear rail stays disabled and no joystick init is attempted; then re-run with--linear-rail --gamepadand confirm both subsystems come up. (Verifies the CLI-flag flip.)bash devices/setup_flow_desktop.shand confirm all four launchers land on the desktop (FlowBase, FlowBaseGamepad, LinearRailVehicle, LinearRailVehicleGamepad); double-click each and confirm the controller starts with the matching subsystems (rail only on the LinearRail variants, joystick init only on the Gamepad variants)..env, credentials, station-specific config) — confirm none made it in.🤖 Generated with Claude Code