Skip to content

support cosmos3 nano policy and isaac env#1243

Open
helloyongyang wants to merge 7 commits into
mainfrom
cos
Open

support cosmos3 nano policy and isaac env#1243
helloyongyang wants to merge 7 commits into
mainfrom
cos

Conversation

@helloyongyang

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for Cosmos3-Nano-Policy-DROID, including new configuration files, shell scripts, and model runner updates to handle policy observations, states, and action outputs. It also updates the ROS simulator nodes for Libero and RoboTwin to handle proper environment resets and provide a compatibility planner when Curobo is unavailable. The review feedback highlights a potential resource leak in cosmos3_runner.py where loaded .npz files are not explicitly closed, and advises against hardcoding absolute user paths in shared configuration files.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +468 to +473
elif suffix in (".npy", ".npz"):
payload = np.load(state_path, allow_pickle=True)
if isinstance(payload, np.lib.npyio.NpzFile):
payload = {key: payload[key] for key in payload.files}
elif isinstance(payload, np.ndarray) and payload.shape == () and isinstance(payload.item(), dict):
payload = payload.item()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When loading a .npz file, np.load returns an NpzFile object which should be closed to prevent resource leaks (such as running out of file descriptors in long-running services like ROS nodes). Overwriting payload directly prevents closing the file. We should load it into a temporary variable, extract the dictionary, and explicitly close the NpzFile object.

Suggested change
elif suffix in (".npy", ".npz"):
payload = np.load(state_path, allow_pickle=True)
if isinstance(payload, np.lib.npyio.NpzFile):
payload = {key: payload[key] for key in payload.files}
elif isinstance(payload, np.ndarray) and payload.shape == () and isinstance(payload.item(), dict):
payload = payload.item()
elif suffix in (".npy", ".npz"):
loaded = np.load(state_path, allow_pickle=True)
if isinstance(loaded, np.lib.npyio.NpzFile):
payload = {key: loaded[key] for key in loaded.files}
loaded.close()
elif isinstance(loaded, np.ndarray) and loaded.shape == () and isinstance(loaded.item(), dict):
payload = loaded.item()
else:
payload = loaded

Comment on lines +2 to +3
"adapter_model_path": "/data/nvme7/yongyang/fastwam_release/libero_uncond_2cam224.pt",
"dataset_stats_path": "/data/nvme7/yongyang/fastwam_release/libero_uncond_2cam224_dataset_stats.json",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid hardcoding absolute paths pointing to a specific user's directory (e.g., /data/nvme7/yongyang/...) in shared configuration files. This makes the configuration non-portable and will cause failures on other machines or in production environments. Consider using relative paths or environment variables to resolve these paths dynamically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant