-
Notifications
You must be signed in to change notification settings - Fork 1
Add StackBlocksTwo environment #45
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
Add StackBlocksTwo environment #45
Conversation
|
|
||
| # RoboTwin check if grippers are open | ||
| # This requires checking robot gripper state, which may need to be implemented | ||
|
|
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.
这个咱们就不check了。
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.
好的
|
|
||
| # Compute angle and check if fallen | ||
| angle = torch.arccos(dot_product) | ||
| return angle >= torch.pi / 4 |
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.
话说这里你有可视化过你load 进去的block的pose吗?是否是z轴朝上还是朝哪里?
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.
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。
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.
|
|
||
| # 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( |
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.
这里这样check是合理的吗?我感觉是不是应该check bolck_1和block_2的delta x 以及 delta y不超过eps,然后block_2的 z 比bolck_1高。还是robotwin是这么做的?
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.
我这里是按照robotwin里来的。
def check_success(self):
block1_pose = self.block1.get_pose().p
block2_pose = self.block2.get_pose().p
eps = [0.025, 0.025, 0.012]
return (np.all(abs(block2_pose - np.array(block1_pose[:2].tolist() + [block1_pose[2] + 0.05])) < eps)
and self.is_left_gripper_open() and self.is_right_gripper_open())其实也是check 了delta x和delta y还有delta z。
| } | ||
| ] | ||
| } | ||
|
|
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.
我看相比于pour_water的gym_config少了很多东西,要不把他们补上。
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.
原先我只添加了一些基础配置,pour_water里多了一些和动作规划有关的东西,还有几个多的camera,因为我看scope_ice里也就是只有一些基础配置,我也就没加。我觉得可以补上,说不定以后用会用到。
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.
已经加上了

Description
Added
StackBlocksTwo-v1environment - a manipulation task where two blocks need to be stacked on top of each other.Changes
StackBlocksTwoEnvclassReference
Based on
stack_blocks_twotask from RoboTwin.How to Run
Testing
Environment tested and verified to work correctly.
