Repository navigation
Data auto-generation part using a simple state machine - #127
Conversation
|
@Papaercold Thank you for your PR. Due to a busy schedule recently, I may not be able to review the code right away, I'll check it later. Regarding the brief drop of the gripper that you mentioned, I haven’t observed this behavior so far. I’ll check for it again using the latest code. |
|
The At the moment, it is very difficult to complete the cloth-folding task using the current state machine. I believe there are still some issues with the collision configuration. In some cases, the gripper penetrates the cloth mesh, which prevents it from being properly grasped and lifted. |
|
@Papaercold Thank you! I will review it next week. |
|
I’ve started working on the reinforcement learning module based on the rsl_rl library, but it is still under development. For now, please ignore the files under the rl folder as well as the new rl_config settings during your review. The directory structure and corresponding file descriptions are also documented in the Markdown file. If you prefer, I can submit a separate PR for the RL part after you finish reviewing the state machine implementation. |
|
@Papaercold Yes, I think it would be better to keep the PR focused on a single feature. You can save your progress locally or in another branch first. This PR should only track the state machine–related functionality. |
Sure, I’ll make the changes now. I’ll keep this PR focused on the state machine functionality. |
|
@EverNorif The modifications have been completed. In this commit, the RL module has been fully removed. I have also removed The remaining code consists only of the components that I have tested and verified to be functioning correctly. You may refer to the Markdown documentation for guidance during your review. |
EverNorif
left a comment
There was a problem hiding this comment.
I tested this PR locally and it runs successfully.
There are still some issues with the structure and implementation that need to be adjusted.
In terms of structure, I think this organization would be better:
scripts/datagen/state_machine/
-- generate.py(or any other name you think is appropriate.) # Unified runner script: run the state machine based on the provided task, rather than being limited to specific one.
-- replay.py # Replay script for state-machine demonstrations
source/leisaac/leisaac/datagen/state_machine/
-- base.py # StateMachineBase abstract class
-- pick_orange.py # PickOrangeStateMachine
-- ... # other state machine implement|
@EverNorif Thanks for the review. I’ll make the requested changes shortly and follow up here if anything comes up. |
|
I’ve finished the updates. Here’s a summary of the changes. Summary of Changes
@EverNorif Thank you for your review and support. |
|
@EverNorif You can test it again now. All the known issues should be resolved. |
|
@Papaercold I think overall it is already fine, but it still needs to pass the linters. You can refer to the configuration in |
|
@EverNorif Finished.
These issues already exist on the |
) * Add data auto-generate module. * Add data auto-generate module. * Add data auto-generate module. * Add data auto-generate module. * Add data auto-generate module. * Add auto_terminate. * Add auto_terminate. * Add auto_terminate. * Add Description. * State Machinecode refactoring. * State Machinecode refactoring. * State Machinecode refactoring. * State Machinecode refactoring. * State Machinecode refactoring. * State Machinecode refactoring. * Add State Machine code. * Apply pre-commit fixes (black/isort/pyupgrade) for several files * Apply pre-commit fixes (black/isort/pyupgrade) for pick_orange.py * Change structure.. * Create StateMacchine Class. * Refactor code. * Fix bugs. * Delete redundant files * Delete redundant files. * Change PickOrangeStateMachine * Change PickOrangeStateMachine * Change PickOrangeStateMachine * Change PickOrangeStateMachine * Change PickOrangeStateMachine * Change PickOrangeStateMachine * Add state_machine/fold_cloth.py * Fix bugs * Add state_machine/replay.py * Add readme * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs * Change documents * Change bi_arm_cfg * Add RL module - 1st version. * Change documents. * Change bash. * Delete RL part. * Refactor * Change format * Refactor * Change Isaaclab version==2.3.2 * Change Isaaclab version==2.3.0 * Change documents. * Fix bugs. * Change format. * Change format. --------- Co-authored-by: Zihan Gao <zg137@duke.edu>
Summary
This PR introduces a state-machine–based data generation pipeline for the SO101 pick-orange task in LeIsaac.
The main implementation lives under
scripts/environments/state_machine, where a scripted finite state machine is used to generate deterministic pick-and-place demonstrations. To integrate this pipeline with the existing teleoperation and replay infrastructure, a new teleoperation device type namedso101_state_machineis added, with corresponding changes undersource/leisaac.The implementation intentionally follows the coding style and structure of
scripts/environments/teleoperation/teleop_se3_agent.py, and includes detailed comments for readability and maintainability.Key Features
State-machine–based data generation
scripts/environments/state_machineNew teleoperation device:
so101_state_machineReplay compatibility
scripts/environments/teleoperation/replay.pyUsage Examples
Generate data
Replay recorded data
Observed Issue / Open Question
When running the state-machine–based data generation script, the robot gripper exhibits a brief downward drop at the beginning of each episode before stabilizing.
At first glance, this behavior appears to be gravity-related. However, gravity is explicitly disabled at spawn time for all relevant teleoperation devices, including the newly introduced state-machine device:
Given this configuration, it is unclear whether the observed initial drop is truly caused by gravity. Other potential factors may include controller or drive initialization behavior, insufficient drive stiffness during the first few simulation steps, or the absence of an explicit action warm-start when the episode begins.
I would appreciate feedback on the following questions:
Any insights, suggestions, or references to similar patterns in existing tasks would be greatly appreciated.
Notes