Git Product home page Git Product logo

rsoccer's People

Contributors

alexsandr0x avatar bebetocf avatar bmmuc avatar bonnaborsoi avatar dependabot[bot] avatar felipemartins96 avatar goncamateus avatar hfbassani avatar julianadamurie avatar lhcavalcanti avatar maluwastaken avatar matheusalb avatar matheusvtna avatar myleskeller avatar riei-joaquim avatar thurcst avatar tsb4 avatar vhsabino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rsoccer's Issues

Error installing rsoccer using pip (windows)

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

Fixing the README.md

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])

Add frame for yellow robot

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

Review environments documentation

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.

add citation file

https://docs.github.com/pt/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files

depending on how it works, se if it can substitute:

rSoccer/README.md

Lines 5 to 18 in 17f7640

## Reference
If you use this environment in your publication and want to cite it, utilize this BibTeX:
```
@misc{martins2021rsoccer,
title={rSoccer: A Framework for Studying Reinforcement Learning in Small and Very Small Size Robot Soccer},
author={Felipe B. Martins and Mateus G. Machado and Hansenclever F. Bassani and Pedro H. M. Braga and Edna S. Barros},
year={2021},
eprint={2106.12895},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
```

File registering environments is getting to dense

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.

register(id='VSS-v0',
entry_point='rsoccer_gym.vss.env_vss:VSSEnv',
max_episode_steps=1200
)
register(id='VSSMA-v0',
entry_point='rsoccer_gym.vss.env_ma:VSSMAEnv',
max_episode_steps=1200
)
register(id='VSSMAOpp-v0',
entry_point='rsoccer_gym.vss.env_ma:VSSMAOpp',
max_episode_steps=1200
)
register(id='VSSGk-v0',
entry_point='rsoccer_gym.vss.env_gk:rSimVSSGK',
max_episode_steps=1200
)
register(id='VSSFIRA-v0',
entry_point='rsoccer_gym.vss.env_vss:VSSFIRAEnv',
max_episode_steps=1200
)
register(id='SSLGoToBall-v0',
entry_point='rsoccer_gym.ssl.ssl_go_to_ball:SSLGoToBallEnv',
kwargs={'field_type': 2, 'n_robots_yellow': 6},
max_episode_steps=1200
)
register(id='SSLGoToBallIR-v0',
entry_point='rsoccer_gym.ssl.ssl_go_to_ball:SSLGoToBallIREnv',
kwargs={'field_type': 2, 'n_robots_yellow': 6},
max_episode_steps=1200
)
register(id='SSLGoToBallShoot-v0',
entry_point='rsoccer_gym.ssl.ssl_go_to_ball_shoot:SSLGoToBallShootEnv',
kwargs={'field_type': 2, 'random_init': True,
'enter_goal_area': False},
max_episode_steps=2400
)
register(id='SSLStaticDefenders-v0',
entry_point='rsoccer_gym.ssl.ssl_hw_challenge.static_defenders:SSLHWStaticDefendersEnv',
kwargs={'field_type': 2},
max_episode_steps=1000
)
register(id='SSLDribbling-v0',
entry_point='rsoccer_gym.ssl.ssl_hw_challenge.dribbling:SSLHWDribblingEnv',
max_episode_steps=4800
)
register(id='SSLContestedPossession-v0',
entry_point='rsoccer_gym.ssl.ssl_hw_challenge.contested_possession:SSLContestedPossessionEnv',
max_episode_steps=1200
)
register(id='SSLPassEndurance-v0',
entry_point='rsoccer_gym.ssl.ssl_hw_challenge:SSLPassEnduranceEnv',
max_episode_steps=120
)
register(id='SSLPassEnduranceMA-v0',
entry_point='rsoccer_gym.ssl.ssl_hw_challenge:SSLPassEnduranceMAEnv',
max_episode_steps=1200
)

Example code - Agent error

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.