[ROB-1511] feat(flow_base): expose all motor pos/vel/torque in observation#57
Closed
nu-jliu wants to merge 1 commit into
Closed
[ROB-1511] feat(flow_base): expose all motor pos/vel/torque in observation#57nu-jliu wants to merge 1 commit into
nu-jliu wants to merge 1 commit into
Conversation
- flow_base/flow_base_controller.py: rename Vehicle.get_wheel_speeds → get_wheel_states and return full per-motor state (pos/vel/eff) for the 8 base motors via a single read_states() call, grouped steer/drive; surface the 9th (linear rail) motor's torque by adding an eff field to get_linear_rail_state; update server.bind to "get_wheel_states" - flow_base/flow_base_client.py: rename get_wheel_speeds → get_wheel_states (method, RPC call, CLI command, docstring) and switch get_observation to the wheel_states key so it now carries all 8/9 motors' pos/vel/torque - flow_base/README.md: document the new wheel_states observation key/output and the rail eff (torque) field Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
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
Extend the flow_base observation so a client gets full per-motor state — position, velocity, and torque — for all 8 base motors plus the 9th (linear rail) motor when enabled. Previously the observation carried only wheel velocities (no position, no torque) and the linear rail reported no torque, leaving the data schema misaligned with the gello/yam motor-chain nodes. The data was already read every control cycle (
MotorInfo.eff); this change just stops discarding it. Closes ROB-1511.Changes
i2rt/flow_base/flow_base_controller.py: renamedVehicle.get_wheel_speeds→get_wheel_statesand rewrote it to return full per-motor state (pos/vel/eff) for the 8 base motors via a single cachedread_states()call, grouped steer/drive; added aneff(torque, Nm) field toLinearRailVehicle.get_linear_rail_stateso the 9th motor's torque is reported; updatedserver.bindto"get_wheel_states".i2rt/flow_base/flow_base_client.py: renamedFlowBaseClient.get_wheel_speeds→get_wheel_states(method, RPC call, CLI command, docstring) and switchedget_observationto thewheel_stateskey, soget_observation()now returns pos/vel/torque for all 8/9 motors.i2rt/flow_base/README.md: documented the newwheel_statesobservation key +get_wheel_statesoutput, and added the raileff(torque) field to theget_linear_rail_stateoutput example.How to Test
8-motor base (no linear rail)
python -m i2rt.flow_base.flow_base_controller --channel <can_channel>python -m i2rt.flow_base.flow_base_client --command get_wheel_statesprintssteeranddrive, each withpos/vel/effarrays of length 4.python -m i2rt.flow_base.flow_base_client --command get_observationincludes awheel_stateskey and nolinear_railkey.effvalue moves off ~0 (torque is live).9-motor base (with linear rail)
python -m i2rt.flow_base.flow_base_controller --channel <can_channel> --linear-railpython -m i2rt.flow_base.flow_base_client --command get_linear_rail_state --with-linear-railoutput now includes anefffield; push/hold the rail and confirm it changes.python -m i2rt.flow_base.flow_base_client --command get_observation --with-linear-railcontains fullwheel_states(8 motors) +linear_rail(9th, incl.eff) = all 9 motors' pos/vel/torque.Regression
python -m i2rt.flow_base.flow_base_client --command get_odometryis unchanged.read_statesin the RPC handlers doesn't disturb the control loop).🤖 Generated with Claude Code