From a2c650f8e37328bde22111d2c953dd58c5b7a2b7 Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Tue, 2 Dec 2025 21:52:23 +0800 Subject: [PATCH 01/10] [fix] pyroki intall guide --- .../get_started/advanced_installation/pyroki.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/source/metasim/get_started/advanced_installation/pyroki.md b/docs/source/metasim/get_started/advanced_installation/pyroki.md index 18ed193d5..382b3794d 100644 --- a/docs/source/metasim/get_started/advanced_installation/pyroki.md +++ b/docs/source/metasim/get_started/advanced_installation/pyroki.md @@ -9,6 +9,7 @@ PyRoki requires Python 3.10 or higher. Python 3.12+ is recommended for best comp ## Installation ```bash +cd git clone https://github.com/chungmin99/pyroki.git cd pyroki pip install -e . @@ -19,6 +20,16 @@ pip install numpy==1.26.0 # For Isaacsim pip install jax==0.6.0 # For Isaacsim ``` +If you still encounter a NumPy version mismatch between lsaacSim 5.0.0 and PyRoki, for example, an error +`TypeError: asarray() got an unexpected keyword argument 'copy'`, try running the following commands: +```bash +pip install numpy==1.26.0 # For Isaacsim +pip install jax==0.4.30 jaxlib==0.4.30 +pip install sentry-sdk==1.43.0 typing-extensions==4.12.2 websockets==12.0 +pip install --upgrade websockets +``` + + From 5b517ea805f418719ed5b3b6c74316d7cdacb6eb Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Tue, 2 Dec 2025 21:53:50 +0800 Subject: [PATCH 02/10] [fix] motion planning doc --- .../source/metasim/get_started/quick_start/4_motion_planning.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/metasim/get_started/quick_start/4_motion_planning.md b/docs/source/metasim/get_started/quick_start/4_motion_planning.md index d4f8e3a60..728dfe5bf 100644 --- a/docs/source/metasim/get_started/quick_start/4_motion_planning.md +++ b/docs/source/metasim/get_started/quick_start/4_motion_planning.md @@ -1,6 +1,6 @@ # 4. Motion Planning In this tutorial, we will show you how to use MetaSim to plan a motion for a robot. -Note here, we use the `curobo` package to plan the motion. If you haven't installed it, please refer to our [curobo installation guide](https://roboverse.wiki/metasim/get_started/advanced_installation/curobo). +Note here, we can use the `pyroki` or `curobo` package to plan the motion. If you haven't installed it, please refer to our [pyroki installation guide](https://roboverse.wiki/metasim/get_started/advanced_installation/pyroki) or [curobo installation guide](https://roboverse.wiki/metasim/get_started/advanced_installation/curobo). ## Common Usage From e493a0af361981078e5d98330cad019ab321de3a Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Tue, 2 Dec 2025 21:55:31 +0800 Subject: [PATCH 03/10] [fix] hybrid sim --- metasim/sim/hybrid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metasim/sim/hybrid.py b/metasim/sim/hybrid.py index cc8237259..e6ef4a9e5 100644 --- a/metasim/sim/hybrid.py +++ b/metasim/sim/hybrid.py @@ -42,9 +42,9 @@ def close(self) -> None: self.physics_handler.close() self.render_handler.close() - def set_dof_targets(self, obj_name: str, actions: list[Action]) -> None: + def set_dof_targets(self, actions: list[Action]) -> None: """Set the dof targets of the robot in the physics handler.""" - self.physics_handler.set_dof_targets(obj_name, actions) + self.physics_handler.set_dof_targets(actions) def _set_states(self, states: TensorState, env_ids: list[int] | None = None) -> None: """Set states in both physics and render handlers.""" From c57688d41f1c435c30a18e75b74c5414cfdee5dc Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Tue, 2 Dec 2025 21:57:04 +0800 Subject: [PATCH 04/10] [fix] state reply demo --- scripts/advanced/replay_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/advanced/replay_demo.py b/scripts/advanced/replay_demo.py index 9d1f66ef2..a0f3602b2 100644 --- a/scripts/advanced/replay_demo.py +++ b/scripts/advanced/replay_demo.py @@ -225,7 +225,7 @@ def main(): obs = env.handler.get_states() ## XXX: hack - success = env.checker.check(env.handler) + success = env.checker.check(env.handler, obs) if success.any(): log.info(f"Env {success.nonzero().squeeze(-1).tolist()} succeeded!") if success.all(): From 22d5e5f21b66ee722a8999add501730d67b609e0 Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Wed, 3 Dec 2025 12:40:57 +0800 Subject: [PATCH 05/10] [fix] collect demo --- scripts/advanced/collect_demo.py | 38 ++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/scripts/advanced/collect_demo.py b/scripts/advanced/collect_demo.py index 51fed6066..c1020ecdd 100644 --- a/scripts/advanced/collect_demo.py +++ b/scripts/advanced/collect_demo.py @@ -700,20 +700,22 @@ def main(): task_cls = get_task_class(args.task) if args.task in {"stack_cube", "pick_cube", "pick_butter"}: - dp_camera = True + dp_pos = (1.0, 0.0, 0.75) + elif args.task in {"close_box"} : + dp_pos = (0, 0, 0) else: - dp_camera = args.task != "close_box" + dp_pos = (1.0, 0.0, 0.75) - is_libero_dataset = "libero_90" in args.task + # is_libero_dataset = "libero_90" in args.task - if is_libero_dataset: - dp_pos = (2.0, 0.0, 2) - elif dp_camera: - # import warnings - # warnings.warn("Using dp camera position!") - dp_pos = (1.0, 0.0, 0.75) - else: - dp_pos = (1.5, 0.0, 1.5) + # if is_libero_dataset: + # dp_pos = (2.0, 0.0, 2) + # elif dp_camera: + # # import warnings + # # warnings.warn("Using dp camera position!") + # dp_pos = (1.0, 0.0, 0.75) + # else: + # dp_pos = (1.5, 0.0, 1.5) # libero specific camera position # dp_pos = (0.8, -0, 1.6) @@ -771,7 +773,7 @@ def main(): ## Setup # Get task description from environment task_desc = getattr(env, "task_desc", "") - collector = DemoCollector(env.handler, robot, task_desc) + collector = DemoCollector(env.handler, robot, task_desc, demo_start_idx=args.demo_start_idx) # pbar = tqdm(total=max_demo - args.demo_start_idx, desc="Collecting demos") pbar = tqdm(total=args.num_demo_success, desc="Collecting successful demos") @@ -830,13 +832,17 @@ def main(): stop_flag = False while not all(finished): + if stop_flag: + pass + if tot_success >= args.num_demo_success: - log.info(f"Reached target number of successful demos ({args.num_demo_success}). Stopping collection.") - break + log.info(f"Reached target number of successful demos ({args.num_demo_success}).") + stop_flag = True if demo_indexer.next_idx >= max_demo: - log.warning(f"Reached maximum demo index ({max_demo}). Stopping collection.") - break + if not stop_flag: + log.warning(f"Reached maximum demo index ({max_demo}), finishing in-flight demos.") + stop_flag = True pbar.set_description(f"Frame {global_step} Success {tot_success} Giveup {tot_give_up}") actions = get_actions(all_actions, env, demo_idxs, robot) From 4365ce9ec2a0374e58c39d20a68b062ea23f0c6d Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Wed, 3 Dec 2025 12:44:52 +0800 Subject: [PATCH 06/10] [fix] ckpt_path in dp_runner --- roboverse_learn/il/dp/runner/dp_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roboverse_learn/il/dp/runner/dp_runner.py b/roboverse_learn/il/dp/runner/dp_runner.py index 9bfeac8d1..11cf5401c 100644 --- a/roboverse_learn/il/dp/runner/dp_runner.py +++ b/roboverse_learn/il/dp/runner/dp_runner.py @@ -548,7 +548,7 @@ def evaluate(self, ckpt_path=None): time_str = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S") checkpoint = self.get_checkpoint_path() # checkpoint = ckpt_path if checkpoint is None else checkpoint - checkpoint = ckpt_path if ckpt_path is None else checkpoint + checkpoint = ckpt_path if ckpt_path is not None else checkpoint if checkpoint is None: raise ValueError( "No checkpoint found, please provide a valid checkpoint path." From 5ef257c3843cf9e8d46df0ab73a669269ca9e8e4 Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Wed, 3 Dec 2025 12:48:17 +0800 Subject: [PATCH 07/10] [fix] ddpm device error --- roboverse_learn/il/dp/models/ddpm_image_policy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roboverse_learn/il/dp/models/ddpm_image_policy.py b/roboverse_learn/il/dp/models/ddpm_image_policy.py index d1ec3a38d..572c4ddcc 100644 --- a/roboverse_learn/il/dp/models/ddpm_image_policy.py +++ b/roboverse_learn/il/dp/models/ddpm_image_policy.py @@ -101,6 +101,10 @@ def conditional_sample( # Set diffusion steps. scheduler.set_timesteps(self.num_inference_steps) + # Ensure timesteps are on the same device as trajectory + device = trajectory.device + scheduler.timesteps = scheduler.timesteps.to(device=device) + step_kwargs = dict(self.scheduler_step_kwargs) step_kwargs.update(kwargs) @@ -109,7 +113,7 @@ def conditional_sample( trajectory[condition_mask] = condition_data[condition_mask] # 2. Predict model output. - t = t.to(device=trajectory.device) + # t = t.to(device=trajectory.device) model_output = model(trajectory, t, local_cond=local_cond, global_cond=global_cond) # 3. Compute previous sample x_t -> x_{t-1}. From 01bf0a80d9d7c993424464ca4c988a0bc99950e3 Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Wed, 3 Dec 2025 14:33:41 +0800 Subject: [PATCH 08/10] [fix] jax install --- .../get_started/advanced_installation/pyroki.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/source/metasim/get_started/advanced_installation/pyroki.md b/docs/source/metasim/get_started/advanced_installation/pyroki.md index 382b3794d..df7dec7ad 100644 --- a/docs/source/metasim/get_started/advanced_installation/pyroki.md +++ b/docs/source/metasim/get_started/advanced_installation/pyroki.md @@ -9,22 +9,19 @@ PyRoki requires Python 3.10 or higher. Python 3.12+ is recommended for best comp ## Installation ```bash -cd +cd third_part git clone https://github.com/chungmin99/pyroki.git cd pyroki pip install -e . -``` -For Isaacsim, also need the following commands: -```bash -pip install numpy==1.26.0 # For Isaacsim -pip install jax==0.6.0 # For Isaacsim +cd ../../ +pip install jax==0.4.30 jaxlib==0.4.30 ``` -If you still encounter a NumPy version mismatch between lsaacSim 5.0.0 and PyRoki, for example, an error +### For Isaacsim +If you encounter a NumPy version mismatch between lsaacSim 5.0.0 and PyRoki, for example, an error `TypeError: asarray() got an unexpected keyword argument 'copy'`, try running the following commands: ```bash -pip install numpy==1.26.0 # For Isaacsim -pip install jax==0.4.30 jaxlib==0.4.30 +pip install numpy==1.26.0 pip install sentry-sdk==1.43.0 typing-extensions==4.12.2 websockets==12.0 pip install --upgrade websockets ``` From c3929f08576dedbf80d90a8e312d0939d73b4076 Mon Sep 17 00:00:00 2001 From: JIAjindou Date: Wed, 3 Dec 2025 14:38:46 +0800 Subject: [PATCH 09/10] [fix] replay demo libero doc --- .../get_started/quick_start/8_replay_demo.md | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/source/metasim/get_started/quick_start/8_replay_demo.md b/docs/source/metasim/get_started/quick_start/8_replay_demo.md index 02ba4497d..b572ac14f 100644 --- a/docs/source/metasim/get_started/quick_start/8_replay_demo.md +++ b/docs/source/metasim/get_started/quick_start/8_replay_demo.md @@ -9,10 +9,9 @@ python scripts/advanced/replay_demo.py --sim=isaacsim --task=close_box --num_env ``` task could also be: -- `PickCube` -- `StackCube` -- `CloseBox` -- `BasketballInHoop` +- `pick_cube` +- `stack_cube` +- `close_box` ## States replay @@ -20,8 +19,7 @@ task could also be: python scripts/advanced/replay_demo.py --sim=isaacsim --task=close_box --num_envs 4 --object-states ``` task could also be: -- `CloseBox` -- `BasketballInHoop` +- `close_box` ## Varifies commands @@ -30,7 +28,7 @@ task could also be: e.g. ```bash -python scripts/advanced/replay_demo.py --sim=isaacsim --task=LiberoPickButter +python scripts/advanced/replay_demo.py --sim=isaacsim --task=libero.pick_butter ``` Simulator: @@ -38,14 +36,10 @@ Simulator: - `mujoco` Task: -- `LiberoPickAlphabetSoup` -- `LiberoPickBbqSauce` -- `LiberoPickChocolatePudding` -- `LiberoPickCreamCheese` -- `LiberoPickMilk` -- `LiberoPickOrangeJuice` -- `LiberoPickSaladDressing` -- `LiberoPickTomatoSauce` +- `libero.kitchen_scene1_open_bottom_drawer` +- `libero.kitchen_scene1_open_top_drawer` +- `libero.kitchen_scene1_put_the_black_bowl_on_the_plate` + ### Humanoid From 86fe433610c819dcaebd599b4879bd40c6c030f9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 06:57:39 +0000 Subject: [PATCH 10/10] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/advanced/collect_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/advanced/collect_demo.py b/scripts/advanced/collect_demo.py index c1020ecdd..d500df2ea 100644 --- a/scripts/advanced/collect_demo.py +++ b/scripts/advanced/collect_demo.py @@ -701,7 +701,7 @@ def main(): if args.task in {"stack_cube", "pick_cube", "pick_butter"}: dp_pos = (1.0, 0.0, 0.75) - elif args.task in {"close_box"} : + elif args.task in {"close_box"}: dp_pos = (0, 0, 0) else: dp_pos = (1.0, 0.0, 0.75)