Ericonaldo / visual_wholebody

Train a loco-manipulation dog with RL
https://wholebody-b1.github.io/
Other
138 stars 13 forks source link

Clean Version for B1Z1 low-level whole-body Control Milestone Codebase. #10

Closed xuanbinpeng closed 3 months ago

xuanbinpeng commented 3 months ago

B1Z1 Low-level Pull Request

This pull request introduces several changes to the codebase to enhance readability, modularity, and flexibility. The main updates include refactoring, merging configuration files, and adding new functionality. Also, the current configuration and reward design have achieved the best b1z1 low-level sim2real performance until now.

Below is a detailed description of the changes:

  1. Refactor ManipLoco.py:

    • Clean the code: The code has been reorganized for better readability and maintainability. Unnecessary comments and deprecated code segments have been removed.
    • Structure improvement: The code structure has been improved to follow a more logical flow, making it easier to understand and modify.
    • Enhanced documentation: Added some comments throughout the code to provide clarity on complex sections and the overall functionality.
  2. Separate Reward Design Using Reward_Containers:

    • Modularity and Flexibility: The reward functions have been decoupled from ManipLoco.py and moved to a new module called Reward_Containers. This design allows for easy modification and extension of reward functions.
    • Configuration-based assignment: Rewards can now be assigned and configured directly in the b1z1_config.py file. This approach simplifies the process of switching between different reward configurations for various experiments.
  3. Merge b1z1_config and manip_loco_config:

    • Simplified Configuration: Merged the two configuration files to eliminate redundancy and the complex inheritance relationships previously present.
    • Unified Configuration: All configuration settings can now be found in a single file (b1z1_config.py), streamlining the setup process and reducing confusion.
  4. Better Readability:

    • Improved Comments: Enhanced the documentation within the code by adding more descriptive comments.
    • Removal of Redundant Code: Deleted unused and redundant code segments to reduce clutter and potential confusion.
  5. Addition of b1z1_interface.py for Teleoperation Mode:

    • Teleoperation Functionality: Introduced a new script, b1z1_interface.py, which enables teleoperation mode. Users can now control the robot via keyboard inputs, allowing for more interactive testing and control.
    • Enhanced Control: This script provides a flexible interface for sending commands and controlling the robot in real-time, facilitating easier experimentation and debugging.

Detailed Changes:

1. Refactor ManipLoco.py:

2. Separate Reward Design:

3. Merge Configuration Files:

4. Add b1z1_interface.py: