Skip to content

Latest commit

 

History

History
92 lines (67 loc) · 3.29 KB

File metadata and controls

92 lines (67 loc) · 3.29 KB

Gymnasium Robotics Tutorial

This project is a hands-on exploration of robotics environments using the Gymnasium library, with a focus on MuJoCo-based environments. The goal is to learn how to set up, train, and evaluate reinforcement learning agents in these simulated robotic tasks.

Project Goal

  • Understand the fundamentals of Gymnasium for robotics.
  • Implement and train RL agents (e.g., using Stable Baselines3) on various robotics tasks.
  • Learn how to evaluate the performance of trained agents.
  • Explore different robotics environments like Fetch, ShadowHand, etc.

Technologies Used

Setup

Prerequisites

  • Python 3.8+
  • Git

Installation

  1. Clone the repository (if you haven't already or for others to use):

    git clone https://github.com/shubhamt2897/Gymnasium_Robotics_Tutorial.git
    cd Gymnasium_Robotics_Tutorial
  2. Create a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate  # On Windows use `.venv\Scripts\activate`
  3. Install dependencies: A requirements.txt file will be added here. For now, you can install the core libraries:

    pip install gymnasium[robotics] stable-baselines3[extra]
    # Add other specific libraries like moviepy if needed for recording
    # pip install moviepy

    (Consider creating a requirements.txt file soon by running pip freeze > requirements.txt after installing your base packages).

Usage

This section will be updated as the project progresses. It will include instructions on:

  • How to run training scripts (e.g., python train_agent.py --env <environment_id>).
  • How to run evaluation scripts (e.g., python evaluate_agent.py --model_path <path_to_model> --env <environment_id>).
  • How to use any Jupyter notebooks for experimentation.

Example (Placeholder)

# Placeholder for a quick example of how to load an environment
import gymnasium as gym

env = gym.make("FetchPickAndPlace-v3", render_mode="human") # Or any other env
observation, info = env.reset(seed=42)

for _ in range(1000):
    action = env.action_space.sample()  # agent policy is here
    observation, reward, terminated, truncated, info = env.step(action)

    if terminated or truncated:
        observation, info = env.reset()
env.close()

Current Status

  • Project initialized.
  • Basic dependencies identified.
  • Focusing on setting up the environment and initial training/evaluation scripts.
  • Currently exploring ["FetchPickAndPlace-v3", "FetchSlide"and MaMuJoCo env].

Next Steps / To-Do

  • Develop a script for training an agent on a chosen robotics task.
  • Develop a script for evaluating a trained agent.
  • Add detailed instructions for running training and evaluation.
  • Document results and observations.
  • Explore more complex environments or tasks.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.