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,
    barrier_velocity_range=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.6.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

chasing_targets_gym-0.0.6-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chasing_targets_gym-0.0.6.tar.gz
  • Upload date:
  • Size: 14.8 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.6.tar.gz
Algorithm Hash digest
SHA256 b320f938386c99cea88cd456a0f922419817d8ae01440625e4f790c0f1b31d6a
MD5 889fe92359c852b2b24a26a1a27c3337
BLAKE2b-256 62f894988dbdcedf210aafc480beea5daf41a2b53a9a73724d65bd0694bc2cab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chasing_targets_gym-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 659d033d3c16b1a554a31fa9d3b47abd0fffdfcdc4b963754cb9313f6cc1ea22
MD5 f2b6c0e6e13de998d6007f3cc7be6a8c
BLAKE2b-256 8c18973c317902cf683bd6bc1b3a061b951d95bd51ec250d07814237719a62fd

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