haosulab / ManiSkill

SAPIEN Manipulation Skill Framework, a GPU parallelized robotics simulator and benchmark
https://maniskill.ai/
Apache License 2.0
920 stars 166 forks source link

Initialize the robot arm posture in a custom environment #694

Closed LuckyCZD closed 1 week ago

LuckyCZD commented 1 week ago

I followed the tutorial to load my custom robotic arm (panda's end effector was replaced with a dexterous hand) into the custom environment. The results I got by setting the keyframe 'rest' and running test.py were normal(picture below), but when I loaded the robotic arm into a custom environment, the initial position of the robotic arm was all joints = 0. How can I set the initial position of the robot arm in the custom environment to the keyframe position? 1

StoneT2000 commented 1 week ago

In your custom environment you should define a def _initialize_episode function which upon env.reset will initialize all objects accordingly including the robot. In this function you can do something like self.agent.robot.set_qpos(self.agent.keyframes["rest"]).

LuckyCZD commented 1 week ago

Thank you very much, it's worked.