robocin / rsoccer Goto Github PK
View Code? Open in Web Editor NEW🎳 Environments for Reinforcement Learning
License: MIT License
🎳 Environments for Reinforcement Learning
License: MIT License
I think this variable can be removed
implement a reward shaping module which every env can use
I tried to install using pip and got this error:
Collecting rsoccer-gym
Using cached rsoccer_gym-1.4-py3-none-any.whl (61 kB)
Collecting gym (from rsoccer-gym)
Using cached gym-0.26.2-py3-none-any.whl
Collecting rc-robosim>=1.2.0 (from rsoccer-gym)
Using cached rc-robosim-1.2.tar.gz (24 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pyglet (from rsoccer-gym)
Using cached pyglet-2.0.9-py3-none-any.whl (854 kB)
Collecting protobuf (from rsoccer-gym)
Using cached protobuf-4.24.2-cp310-abi3-win_amd64.whl (430 kB)
Collecting numpy>=1.18.0 (from gym->rsoccer-gym)
Using cached numpy-1.25.2-cp311-cp311-win_amd64.whl (15.5 MB)
Collecting cloudpickle>=1.2.0 (from gym->rsoccer-gym)
Using cached cloudpickle-2.2.1-py3-none-any.whl (25 kB)
Collecting gym-notices>=0.0.4 (from gym->rsoccer-gym)
Using cached gym_notices-0.0.8-py3-none-any.whl (3.0 kB)
Building wheels for collected packages: rc-robosim
Building wheel for rc-robosim (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for rc-robosim (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [380 lines of output]
--------------------------------------------------------------------------------
-- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Ninja (Visual Studio 17 2022 x64 v143)' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'Visual Studio 17 2022 x64 v143' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:2 (PROJECT):
Generator
Visual Studio 17 2022
could not find any instance of Visual Studio.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Visual Studio 17 2022 x64 v143' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Ninja (Visual Studio 16 2019 x64 v142)' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'Visual Studio 16 2019 x64 v142' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:2 (PROJECT):
Generator
Visual Studio 16 2019
could not find any instance of Visual Studio.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Visual Studio 16 2019 x64 v142' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:3 (ENABLE_LANGUAGE):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Ninja (Visual Studio 15 2017 x64 v141)' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'Visual Studio 15 2017 x64 v141' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:2 (PROJECT):
Generator
Visual Studio 15 2017
could not find any instance of Visual Studio.
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Visual Studio 15 2017 x64 v141' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:2 (PROJECT):
Running
'nmake' '-?'
failed with:
O sistema não pode encontrar o arquivo especificado
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'NMake Makefiles (Visual Studio 17 2022 x64 v143)' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:2 (PROJECT):
Running
'nmake' '-?'
failed with:
O sistema não pode encontrar o arquivo especificado
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'NMake Makefiles (Visual Studio 16 2019 x64 v142)' generator - failure
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:2 (PROJECT):
Running
'nmake' '-?'
failed with:
O sistema não pode encontrar o arquivo especificado
-- Configuring incomplete, errors occurred!
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'NMake Makefiles (Visual Studio 15 2017 x64 v141)' generator - failure
--------------------------------------------------------------------------------
********************************************************************************
scikit-build could not get a working generator for your system. Aborting build.
Building windows wheels for Python 3.11 requires Microsoft Visual Studio 2022.
Get it with "Visual Studio 2017":
https://visualstudio.microsoft.com/vs/
Or with "Visual Studio 2019":
https://visualstudio.microsoft.com/vs/
Or with "Visual Studio 2022":
https://visualstudio.microsoft.com/vs/
********************************************************************************
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for rc-robosim
Failed to build rc-robosim
ERROR: Could not build wheels for rc-robosim, which is required to install pyproject.toml-based projects
I was testing with the library using the readme.md
as guide but notice some issues in the example code.
import numpy as np
from gym.spaces import Box
from rc_gym.Entities import Ball, Frame, Robot
from rc_gym.ssl.ssl_gym_base import SSLBaseEnv
"""
rc_gym doesn`t work, this works:
"""
from rsoccer_gym.Entities import Ball, Frame, Robot
from rsoccer_gym.ssl.ssl_gym_base import SSLBaseEnv
def _frame_to_observations(self):
ball, robot = self.frame.ball, self.frame.robots_blue[0]
return np.array([ball.x, ball.y, rbt.x, rbt.y]) # , robot.x, robot.y])
Change to be related with n_robots_blue and n_robots_yellow.https://github.com/robocin/envs/blob/5f422179ca24fdf9eca0bf53fe02f2af1a4c6f21/envs/rc_gym/vss/env_3v3/vss_gym_3v3.py#L309-L314
Add function to get a frame for the yellow robots into Frame class:
def get_yellow_frame(self):
yellow_frame = Frame()
yellow_frame.ball.x = -self.ball.x
yellow_frame.ball.y = self.ball.y
yellow_frame.ball.z = self.ball.z
yellow_frame.ball.v_x = -self.ball.v_x
yellow_frame.ball.v_y = self.ball.v_y
for i in range(len(self.robots_yellow)):
robot = Robot()
robot.id = i
robot.x = -self.robots_yellow[i].x
robot.y = self.robots_yellow[i].y
robot.theta = self._mirror_angle(self.robots_yellow[i].theta)
robot.v_x = -self.robots_yellow[i].v_x
robot.v_y = self.robots_yellow[i].v_y
robot.v_theta = -self.robots_yellow[i].v_theta
yellow_frame.robots_blue[robot.id] = robot
for i in range(len(self.robots_blue)):
robot = Robot()
robot.id = i
robot.x = -self.robots_blue[i].x
robot.y = self.robots_blue[i].y
robot.theta = self._mirror_angle(self.robots_blue[i].theta)
robot.v_x = -self.robots_blue[i].v_x
robot.v_y = self.robots_blue[i].v_y
robot.v_theta = -self.robots_blue[i].v_theta
yellow_frame.robots_yellow[robot.id] = robot
return yellow_frame
this issue is just to test discord webhook on this repo
There is an environment example at the readme: https://github.com/robocin/rSoccer#example-code---environment
However this example lacks documentation and has some errors, a simple guide explaining how to create an environment would improve the repo!
Each environment code should have a descriptive and correct documentation about the environment, each of the available environemnts should be checked in the information is correct.
Creat an environment to train an attacker against a trained goalkeeper.
depending on how it works, se if it can substitute:
Lines 5 to 18 in 17f7640
When implemented in the old environment, the intention was to clip rewards when something unexpected occurred and the value was too big, on the code as of now it is clipping normal rewards
this issue raises an error when making the environment on a device without display
We should study if maybe moving the environments register to vss and ssl folder respectively or inside the environment code itself is a better way to format the environment.
rSoccer/rsoccer_gym/__init__.py
Lines 3 to 71 in 17f7640
The example code is presenting the following error:
Example code:
import gym
import rsoccer_gym
# Using VSS Single Agent env
env = gym.make('VSS-v0')
env.reset()
# Run for 1 episode and print reward at the end
for i in range(1):
done = False
while not done:
# Step using random actions
action = env.action_space.sample()
next_state, reward, done, _ = env.step(action)
env.render()
print(reward)
Error message:
Exception has occurred: ValueError
not enough values to unpack (expected 5, got 4)
Error line:
next_state, reward, done, _ = env.step(action)
Environment description is not up to date.
https://github.com/robocin/envs/blob/5f422179ca24fdf9eca0bf53fe02f2af1a4c6f21/envs/rc_gym/__init__.py#L19
https://github.com/robocin/envs/blob/5f422179ca24fdf9eca0bf53fe02f2af1a4c6f21/envs/rc_gym/ssl/__init__.py#L1
This env is being registered, but is not available on main.
https://github.com/robocin/envs/blob/b4e98159dc03a604e7413bb280e46f7f69199cd9/envs/rc_gym/vss/env_3v3/vss_gym_3v3.py#L182
This causes for the robot to be rewarded or penalized by the ball replacement movement
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.