(bug) Add MockMotorBus to MockRobot #2081
Open
+16
−1
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.
What this does
Adds the interface all robots have to interface the motors through the bus instead of directly to
MockRobot
too. This improves testing coverage because before this RL tests (how I have found out of this issue) could not run properly. See the MRE for more detailsSay you want to test the RL setup using a mock robot (for testing purposes, or for development without a robot).
The current setup for mock robots does not adequately support testing because it does not implement the same mechanism to instantiate/retrieve the motors that we instead rely on for actual robots. This PR fixes this, which is a bug I have found out while developing self-contained tutorials for how to use RL in
lerobot
.MRE
Error trace ⬇️ (after
git checkout main
)After checking out to this branch, this bug is resolves and the mock robot is correctly wrapped in the robot environment by RL environments.