Add optional motor telemetry to SO-follower recording#3456
Draft
Nick0-ai wants to merge 1 commit intohuggingface:mainfrom
Draft
Add optional motor telemetry to SO-follower recording#3456Nick0-ai wants to merge 1 commit intohuggingface:mainfrom
Nick0-ai wants to merge 1 commit intohuggingface:mainfrom
Conversation
SO-follower currently records joint positions only, even though the Feetech STS motors expose velocity (reg 58), load (reg 60), and temperature (reg 63) for free. This PR adds a `record_telemetry` flag to `SOFollowerConfig` that, when enabled, includes these three signals per motor in the observation dict — enabling downstream policy debugging and post-hoc mechanical diagnostics without changing any default behavior. Gated behind an opt-in flag because the 3 extra `sync_read` calls cost ~15-30ms on a 6-motor bus at 1Mbaud, which matters at 60Hz. A follow-up PR could add a batched multi-register read API to `motors_bus.py` to reduce this to a single transaction (addresses 56-63 are contiguous on STS3215). Changes: - Add `record_telemetry: bool = False` to SOFollowerConfig - Extend `_motors_ft` and `get_observation()` to conditionally emit `.vel`, `.load`, `.temp` keys per motor - Add tests for both default (pos-only) and telemetry-enabled paths Default `False` preserves backward compatibility — existing policies trained on position-only datasets are unaffected.
|
Since you mentioend that including all 3 might add some latency, maybe consider allowing fine-grained optin selection. Instead of having just one flag for all three, allow users to enable just what they need, reducing the overall impact. |
5 tasks
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 / Motivation
SO-follower currently records joint positions only, even though the Feetech STS motors used by SO-100 and SO-101 expose velocity (reg 58), load (reg 60), and temperature (reg 63) for free. This PR adds a
record_telemetryflag toSOFollowerConfigthat, when enabled, includes these three signals per motor in the observation dict — enabling downstream policy debugging, teleop data quality analysis, and post-hoc mechanical diagnostics without changing any default behavior.Gated behind an opt-in flag because the 3 extra
sync_readcalls cost ~15-30ms on a 6-motor bus at 1Mbaud, which matters at 60Hz. A follow-up PR could add a batched multi-register read API tomotors_bus.pyto reduce this to a single transaction (addresses 56-63 are contiguous on STS3215).Opening as draft to gather feedback on the API surface (flag name, register selection, whether this should be generalized to
koch_follower/ other Dynamixel/Feetech followers in the same PR) before polishing.Related issues
What changed
record_telemetry: bool = Falsefield toSOFollowerConfig(keeps default behavior identical).SOFollower._motors_ftto emit{motor}.vel,{motor}.load,{motor}.tempkeys per motor when telemetry is enabled.SOFollower.get_observation()to conditionally readPresent_Velocity,Present_Load,Present_Temperatureand populate the observation dict.How was this tested (or how to run locally)
tests/robots/test_so100_follower.py::test_observation_features_includes_telemetry— asserts.vel,.load,.tempfeatures are declared when flag is set.tests/robots/test_so100_follower.py::test_get_observation_with_telemetry— assertsget_observation()populates telemetry keys with values from their respective registers (via a mocked bus that returns distinct values per register).test_connect_disconnect,test_get_observation,test_send_actionstill pass unchanged — regression-proves backward compatibility.Checklist (required before merge)
ruff checkandruff format --checkclean on modified files)pytest tests/robots/test_so100_follower.py)docs/source/robots/so100.mdx— will add a short config note in a follow-up commit if the API is approved)Reviewer notes
record_telemetrywas chosen as a neutral, opt-in name. Open to alternatives (include_motor_state,extra_motor_features, …).sync_readcalls is the bottleneck. A batched read API onFeetechMotorsBus(registers 56-63 are contiguous → single transaction) would eliminate this; flagged as a natural follow-up. Keeping it out of this PR to minimize review surface.koch_followerand similar arms expose equivalent Dynamixel registers — happy to generalize in a follow-up once this API lands.