Healthcare-Robotics / assistive-gym

Assistive Gym, a physics-based simulation framework for physical human-robot interaction and robotic assistance.
MIT License
306 stars 73 forks source link

Add a new type of robot #27

Closed JiahangWu closed 2 years ago

JiahangWu commented 2 years ago

Hello,

I tried to add a new robot to this simulator. First I added the robot .urfd file in the corresponding path and initialized it. But it always showed error: Cannot load URDF file.. Could you write a guide for adding a new type of robot? Thanks a lot!

Zackory commented 2 years ago

There is likely an issue with your URDF file. You should do some checks such as if you can load your robot into Gazebo. Most commercial robots come with URDFs, so if you are not making your own robot, I suggest using the official URDF. As you likely know, ROS has a whole set of tutorials on creating URDFs: http://wiki.ros.org/ROS/Tutorials This does not sound like an issue with Assistive Gym or PyBullet at the moment.

Zackory commented 2 years ago

Once you have a working URDF, you can

  1. Create a new robot file: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/envs/agents/panda.py
  2. Add the robot to the environment: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/envs/scratch_itch_envs.py
  3. Update the init file: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/envs/__init__.py
  4. And register the new environment to Gym: https://github.com/Healthcare-Robotics/assistive-gym/blob/main/assistive_gym/__init__.py