Skip to main content

Simple gym environment for multiple agents to chase multiple (dumb) targets

Project description

PyPI - Package Version PyPI - Python Version PyPI - License codestyle

Introduction

This is a simple gym environment that sets up a set of robots and targets for them to chase. These targets are dumb, they simply move at a constant speed and bounce off the “limits” of the simulation environment. The intention is that the robots will chase after these targets, and switch to a new target after catching their current one. The targets are “transparent” and robots are free to ignore “avoiding them”, the intention is that they avoid each other. An example of a simulation with robot controller is shown below.

misc/example_sim.gif

Usage

Since this uses the gymnasium, you can spin an environment up same as any other env, and you can use our optimized planner. A script is included that shows of this planner and environment when you install this library `chasing-targets-example --max-step=500`.

from gymnasium import Env, make
from chasing_targets_gym.planner import Planner

env: Env = make(
    "ChasingTargets-v0",
    render_mode="human",
    n_robots=10,
    n_targets=3,
    robot_radius=0.1,
    max_velocity=0.5,
    target_velocity_std=0.5,
    max_episode_steps=1000,
)

planner = Planner(
    env.get_wrapper_attr("robot_radius"),
    env.get_wrapper_attr("dt"),
    env.get_wrapper_attr("max_velocity"),
)

Installation

Either you can clone and pip install the source, or you can install via pypi.

git clone https://github.com/5had3z/chasing-targets-gym && cd chasing-targets-gym && pip3 install -e .

Otherwise install pypi package

pip3 install chasing-targets-gym

Some Credit

I was pointed to a basic environment here but it didn’t really match what I wanted, so I made my own based off this.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chasing_targets_gym-0.0.7.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

chasing_targets_gym-0.0.7-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file chasing_targets_gym-0.0.7.tar.gz.

File metadata

  • Download URL: chasing_targets_gym-0.0.7.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for chasing_targets_gym-0.0.7.tar.gz
Algorithm Hash digest
SHA256 2101a79927a6a13ecf3063e6b1d2fc74b26396904af4c16e5d595752749cec81
MD5 fa1428be73a9823b9650cc144a157e74
BLAKE2b-256 864ff1b902f04569b6a4b8ce26d803319f1c108259787061f3d8de93d6e34973

See more details on using hashes here.

File details

Details for the file chasing_targets_gym-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for chasing_targets_gym-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1e7df0083e511ecedba8bc6f98e26e098bd7e423efb6bd1560031531165f277f
MD5 e3d1df78d26a875a5d3289c269d5779a
BLAKE2b-256 418e6711041b117cf27a3fbb6ea04ab241f2e835cf141fbb9095d2651f219f9c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page