Skip to content

Conversation

@yangchen73
Copy link
Collaborator

Description

Added StackBlocksTwo-v1 environment - a manipulation task where two blocks need to be stacked on top of each other.

Changes

  • Added StackBlocksTwoEnv class
  • Added gym configuration with RoboTwin-compatible physics parameters

Reference

Based on stack_blocks_two task from RoboTwin.

How to Run

python3 embodichain/lab/scripts/preview_env.py \
    --gym_config configs/gym/stack_blocks_two/gym_config.json \
    --num_envs 1

Testing

Environment tested and verified to work correctly.
Screenshot from 2025-12-21 13-08-34

@yuecideng yuecideng added the task A task written in openai gym format for imitation learning or reinforcement learning label Dec 21, 2025

# RoboTwin check if grippers are open
# This requires checking robot gripper state, which may need to be implemented

Copy link
Collaborator

Choose a reason for hiding this comment

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

这个咱们就不check了。


# Compute angle and check if fallen
angle = torch.arccos(dot_product)
return angle >= torch.pi / 4
Copy link
Collaborator

Choose a reason for hiding this comment

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

话说这里你有可视化过你load 进去的block的pose吗?是否是z轴朝上还是朝哪里?

Copy link
Collaborator

Choose a reason for hiding this comment

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

def draw_axis(env, pose):
    from embodichain.lab.sim.cfg import MarkerCfg
    marker_cfg = MarkerCfg(
        name='test',
        marker_type="axis",
        axis_xpos=pose,
        axis_size=0.01,
        axis_len=0.2,
        arena_index=-1,  # All arenas
    )
    env.sim.draw_marker(cfg=marker_cfg)
    env.sim.update()

可以用这个方程可视化一些他们的pose。


# Check if block2 is within tolerance of expected position
position_diff = torch.abs(block2_pos - expected_block2_pos) # (num_envs, 3)
within_tolerance = torch.all(
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里这样check是合理的吗?我感觉是不是应该check bolck_1和block_2的delta x 以及 delta y不超过eps,然后block_2的 z 比bolck_1高。还是robotwin是这么做的?

}
]
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

我看相比于pour_water的gym_config少了很多东西,要不把他们补上。

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

Labels

task A task written in openai gym format for imitation learning or reinforcement learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants