-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add APIs to Isaac Lab Mimic for supporting loco-manipulation datagen #3992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR adds support for loco-manipulation data generation in Isaac Lab Mimic by introducing three key features:
- Body End Effector Processing: Treats the robot's base as an end effector (named "body") to enable lower-body movement control during data generation
- Navigation P-Controller Integration: Adds
use_navigation_p_controllerflag andget_navigation_state()API to manage mobile base navigation, with logic to repeat/skip trajectory steps based on navigation state - Custom Recorder Configuration: Allows users to provide optional custom recorders via
mimic_recorder_configfor recording additional data beyond default action/state
Key Issues Found:
- Critical timing bug in
data_generator.pylines 911-918: The step index is incremented at line 898 before checking if it's at the last step at line 912. This means the "repeat last action" logic triggers one step early (atlen-2instead oflen-1), causing incorrect synchronization between navigation state and trajectory execution. - Performance inefficiency where "body" validation runs inside nested loops instead of once at initialization.
Confidence Score: 2/5
- This PR has a critical logic bug that will cause incorrect behavior during navigation-controlled data generation
- The step index increment timing bug in the navigation controller logic will cause the trajectory synchronization to be off by one step, potentially leading to premature or delayed navigation transitions. While the feature additions are well-structured (clean API design, proper config additions, good documentation), the core navigation logic flaw makes this unsafe to merge without correction.
- Pay close attention to
source/isaaclab_mimic/isaaclab_mimic/datagen/data_generator.py- the navigation controller logic needs the step index check timing fixed
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| source/isaaclab_mimic/isaaclab_mimic/datagen/data_generator.py | 2/5 | Added navigation p-controller support with body end effector processing, but has critical timing bug where step index check happens after increment |
| source/isaaclab_mimic/isaaclab_mimic/datagen/generation.py | 5/5 | Added exception handling with traceback and optional custom recorder config parameter - clean implementation |
| source/isaaclab/isaaclab/envs/manager_based_rl_mimic_env.py | 5/5 | Added get_navigation_state API method stub with clear documentation - implementation left to subclasses as intended |
Sequence Diagram
sequenceDiagram
participant Env as ManagerBasedRLMimicEnv
participant DG as DataGenerator
participant Nav as Navigation P-Controller
participant Body as Body End Effector
Note over DG: use_navigation_p_controller enabled
DG->>DG: Initialize was_navigating = False
loop Each Timestep
DG->>Env: get_navigation_state(env_id)
Env-->>DG: {is_navigating, navigation_goal_reached}
loop For Each End Effector
DG->>DG: Increment current_eef_subtask_step_indices[eef_name]
alt Body at last step AND navigating AND not goal reached
DG->>DG: Decrement all step indices (repeat last action)
Note over DG,Body: Keep robot moving until waypoint reached
else Was navigating AND stopped AND not processed
DG->>DG: Skip to end of nav subtask
Note over DG,Body: Goal reached early, skip remaining trajectory
end
DG->>DG: Check if subtask complete
end
DG->>DG: Update was_navigating = is_navigating
end
8 files reviewed, 3 comments
Greptile OverviewGreptile SummaryThis PR adds comprehensive support for loco-manipulation data generation to Isaac Lab Mimic by enabling navigation controller integration. The changes introduce three key capabilities:
The implementation handles navigation state transitions by repeating the last navigation subtask action when the robot is still navigating to a waypoint, and skipping forward when the goal is reached early. Error handling was improved in Minor issues found:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant DataGenerator
participant Env as ManagerBasedRLMimicEnv
participant NavController as Navigation Controller
User->>DataGenerator: generate() with use_navigation_controller=True
loop For each timestep
DataGenerator->>DataGenerator: Execute waypoint for all end effectors
alt Navigation controller enabled
DataGenerator->>Env: get_navigation_state(env_id)
Env-->>DataGenerator: {is_navigating, navigation_goal_reached}
alt Body at last subtask step & navigating & not reached goal
DataGenerator->>DataGenerator: Repeat last nav subtask action (decrement indices)
else Was navigating & now stopped navigating
DataGenerator->>DataGenerator: Skip to end of nav subtask (advance indices)
end
end
DataGenerator->>DataGenerator: Update was_navigating state
alt All subtasks done
DataGenerator-->>User: Return generated trajectory
end
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 files reviewed, 4 comments
| processed_nav_subtask = False | ||
| navigation_state = self.env.get_navigation_state(env_id) | ||
| is_navigating = navigation_state["is_navigating"] | ||
| navigation_goal_reached = navigation_state["navigation_goal_reached"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: potential KeyError if get_navigation_state doesn't return the expected keys
| navigation_goal_reached = navigation_state["navigation_goal_reached"] | |
| is_navigating = navigation_state.get("is_navigating", False) |
| navigation_state = self.env.get_navigation_state(env_id) | ||
| is_navigating = navigation_state["is_navigating"] | ||
| navigation_goal_reached = navigation_state["navigation_goal_reached"] | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: potential KeyError if get_navigation_state doesn't return the expected keys
| navigation_goal_reached = navigation_state.get("navigation_goal_reached", False) |
| prev_src_demo_datagen_info_pool_size = 0 | ||
|
|
||
| if self.env_cfg.datagen_config.use_navigation_p_controller: | ||
| was_navigating = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: was_navigating is referenced on line 922 but only initialized when use_navigation_p_controller=True, will cause NameError on line 922 branch if the flag changes at runtime
| to indicate when the navigation goal has been reached. | ||
| Args: | ||
| env_id: The environment index to get the navigation state for. If None, all envs are considered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: docstring parameter name mismatch: documented as env_id (singular) but parameter is env_ids (plural)
| env_id: The environment index to get the navigation state for. If None, all envs are considered. | |
| env_ids: The environment index to get the navigation state for. If None, all envs are considered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 files reviewed, 4 comments
| if "body" not in self.env_cfg.subtask_configs.keys(): | ||
| error_msg = ( | ||
| 'End effector with name "body" not found in subtask configs. "body" must be a valid end' | ||
| " effector to use the navigation controller.\n" | ||
| ) | ||
| omni.log.error(error_msg) | ||
| raise RuntimeError(error_msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: inefficient to validate "body" existence on every iteration of the eef_name loop - move this check outside the loop (after line 897) to run once per timestep instead of once per end effector
Description
This PR adds new APIs to Isaac Lab Mimic to expand support for loco-manipulation data generation.
It adds:
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there