ARISE-Initiative / robosuite

robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
https://robosuite.ai
Other
1.35k stars 419 forks source link

Initialise joint positions of a robot #377

Closed YC-Liang closed 1 year ago

YC-Liang commented 1 year ago

Hi,

I have realised that the ManipulationEnv class, which is inheirted by other single arm environments, does not take initial_qpos as arguments to provide custom initial joint positions for the robot.

What's the best method to perform robot joint angle initialisation on the custom environment inherited from the SingleArmEnv (and hence ManipulationEnv)?

Thanks

zhuyifengzju commented 1 year ago

Hi, There are two solutions to this use case. One is that you directly set the desired joint positions in the mjdata. The other option is that you can create your custom robot class that is similar to original one https://github.com/ARISE-Initiative/robosuite/blob/60b358673cc5aaccbf1dc950dbfe365e0915c69a/robosuite/models/robots/manipulators/panda_robot.py#L7, where the joint positions can be randomly initialized based on your use case https://github.com/ARISE-Initiative/robosuite/blob/60b358673cc5aaccbf1dc950dbfe365e0915c69a/robosuite/models/robots/manipulators/panda_robot.py#L34. We would love to help if you want more concrete