Fix LeappDeploymentEnv missing extras attribute#5560
Fix LeappDeploymentEnv missing extras attribute#5560klakhi wants to merge 1 commit intoisaac-sim:developfrom
Conversation
CommandManager terms call self._env.extras during reset(). LeappDeploymentEnv
bypasses the standard ManagerBasedRLEnv init path and never initializes this
dict, causing an AttributeError on the first reset() call.
Add self.extras: dict = {} to __init__ to fix the crash.
Greptile SummaryThis PR fixes a crash in
Confidence Score: 4/5Safe to merge; the one-line addition prevents a reproducible crash with no side effects on existing code paths. The change is a targeted initialization that mirrors what every other env class in this codebase does. The confirmed call sites in No files require special attention beyond the single changed line in Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant LeappDeploymentEnv
participant CommandManager
participant CommandTerm
Caller->>LeappDeploymentEnv: reset()
LeappDeploymentEnv->>CommandManager: reset(env_ids)
CommandManager->>CommandTerm: _resample_command(env_ids)
CommandTerm->>LeappDeploymentEnv: "self._env.extras.setdefault("log", {})"
Note over LeappDeploymentEnv: Before fix: AttributeError<br/>After fix: returns {}
CommandTerm-->>CommandManager: ok
CommandManager-->>LeappDeploymentEnv: extras dict
LeappDeploymentEnv-->>Caller: initial inputs
Reviews (1): Last reviewed commit: "Fix LeappDeploymentEnv missing extras at..." | Re-trigger Greptile |
frlai
left a comment
There was a problem hiding this comment.
looks good. Thanks for adding this.
CommandManager terms call self._env.extras during reset(). LeappDeploymentEnv bypasses the standard ManagerBasedRLEnv init path and never initializes this dict, causing an AttributeError on the first reset() call.
Add self.extras: dict = {} to init to fix the crash.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there