Giter Club home page Giter Club logo

ev3sim's People

Contributors

allcontributors[bot] avatar angustrau avatar dalordish avatar dependabot[bot] avatar emilytrau avatar glipr avatar jtbui20 avatar owenfeik avatar peter-drew avatar platy11 avatar scottwedge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ev3sim's Issues

Add preset name and ev3sim version to UI

When we add randomisation using presets will be useful to have an indication of the currently running preset within the UI. Having the ev3sim version number in the UI will be useful for checking that students are on the latest version.

Need only be small text out of the way somewhere.

Add update available web check

A system to alert the user on startup if an update is available.

Pretty simple to implement using requests. But means the application would need to access the internet. Thoughts?

Add LED support

Not entirely sure how this would work - maybe a panel that can be shown and hidden

Enforce better codestyle

The more I look at this codebase the more I'm noticing inconsistencies in codestyle which probably should be unified, and checked for new PRs. I remember @Dalordish was using black on the MindPile project, so maybe we add that to this project? Otherwise open to other options.

Add FAQ/bugs

Uninstalling US Language pack causes pygame to not launch a game window

Run tests on fork pull requests

This is at least the case for the artefact generation for the docs, not sure if this is also an issue for the Python checks.

Add ability for 2 halves

Currently resetting the match clock also resets the score. Would be good to have some way of having a second half and swapping the direction the teams are shooting.

Would also be nice to make match length variable (in preset is fine).

If scores a level time on is sometimes also needed.

Create default .yaml for undefined settings

Would be nice to not require the base_plate be defined and load sensible defaults if this is the case, simplify the .yaml file for students getting started.

@glipR how hard do you think this is? Given I probably need to record the video tomorrow (24th), would need to be done pretty quickly to be useful.

Move lint with black to separate action

If linting fails the rest of the tests don't run. This means that it may be harder to see which commit breaks something (once tests exist) if linting isn't being run on every commit (which is likely).

Robot Pickup causes unintended consequences

Picking up a robot and attempting to move it to another robot without dropping it causes unintended movement of a moving robot.

push
clip + push

Possible solution:

  • On pickup event, for all components of that robot, change zPos by 1

Other noted consequences:

  • Component layers are approximately the same with other components causing weird overlap.
  • Components are active when being moved. (If there's ever some debug section for teams to analyze maybe turn it off during transit?)

Fix deploy to pip action firing when undesired

Is firing even before a tag has been created. Think will move to branch based deploy using a protected release branch. Can still tag the releases in that branch, but won't use the tag as a trigger for the release to Pip.

Thoughts @Dalordish ?

Acknowledge contributors

This is just a dummy issue for adding trying out the contributors thing. Will close once its all sorted :)

Implement a basic soccer referee

Need a way to be able to turn it off - either in the UI or through preset.

The main functionality is:

  • Teleport ball to neutral zone (nearest dot on field) when it goes over the white line (the entire ball needs to cross)
  • Take a robot off as damaged for a configurable amount of time when the entire robot crosses the white line. This needs to be configurable so the out on white rule can be turned off (doesn't need to be in the UI, can be in preset)

Slightly harder to implement and not as important is to detect when lack of progress occurs and move ball and robots appropriately.

Add match start trigger

Currently when the game is paused robot code pauses automatically. But in a real game, the program needs to be started by a team member on the referees signal through a button press. To ensure compatibility with this and require students to implement pause in the main loop, should probably mimic this functionality, possibly through binding to a button press configurable in the yaml file for each robot.

But don't want to break compatibility until after the current competition is complete.

Simulator not able to run yaml file

When ever a yaml file is ran in the simulator it shoots this error

Traceback (most recent call last):
File "c:\users\alex\appdata\local\programs\python\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\alex\appdata\local\programs\python\python38\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\Alex\AppData\Local\Programs\Python\Python38\Scripts\ev3sim.exe_main
.py", line 7, in
File "c:\users\alex\appdata\local\programs\python\python38\lib\site-packages\ev3sim\sim.py", line 35, in main
from ev3sim.simulation.communication import start_server_with_shared_data
File "c:\users\alex\appdata\local\programs\python\python38\lib\site-packages\ev3sim\simulation\communication.py", line 11, in
import ev3sim.simulation.comm_schema_pb2
File "c:\users\alex\appdata\local\programs\python\python38\lib\site-packages\ev3sim\simulation\comm_schema_pb2.py", line 21, in
create_key=_descriptor._internal_create_key,
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'

I tried running multiple .yaml files such as bot.yaml and controllable .yaml and check if the program is installed.

Relative imports failing with ev3attach

Another thing that's been brought to my attention is that relative imports don't work with ev3attach.

I've been messing with importlib for a while now but haven't got too far. Here's my current progress on changing some of the code in attach.py, although this doesn't fix the issue:

                import os
                from importlib.machinery import SourceFileLoader
                from importlib.util import spec_from_loader, module_from_spec
                class ModLoader(SourceFileLoader):
                    def get_filename(self, fullname):
                        if self.path.endswith('.py'):
                            return self.path
                        return os.path.join(self.path, '__init__.py')
                loader = ModLoader('__main__', fname)
                spec = spec_from_loader(loader.name, loader)
                module = module_from_spec(spec)
                loader.exec_module(module)

Sensor bias and randomisation

If we want to implement this for the senior division we need to discuss how this will be done and start work soon.

Infrared sensor inconsistency with ev3dev

The simulated InfraredSensor, when in 'all values (modulated)' mode (AC-ALL) returns 7 values, unlike the ev3dev drivers where (according to the documentation) 6 values are returned (7 values are returned in the unmodulated mode DC-ALL).

I'm not sure what the best solution to this would be, since the 7th value could be used in existing programs, such as TemplateBot/templateBot.py in the (private) template repo, line 69.

Ensure reads are blocking if data is sufficiently out of date.

Currently reads in ev3dev2 code are nonblocking - meaning that they don't rely on any communication being made between threads.

This can cause a lot of errors, especially when certain threads are eating up all the processing time.

As such I think it's best that we check that any reads use information received in the past 0.2 seconds or so (Using the builtin time, not the mocked time) and block if this is not the case.

There is risk that this completely stops code altogether, where we get only 1 read per tick, so this wait time will need to be configured.

Tick rate adjustments

Adjust GAME_TICK_RATE, VISUAL_TICK_RATE, TIME_SCALE defaults in ScriptLoader (some 30 and some 60) and in soccer.yaml preset (both 30).

Move from loader to use settings (or is this not possible because not a singleton class?)

Add corresponding documentation including for TIME_SCALE

Separate dev requirements from base requirements

Can slightly reduce the package size by removing dependencies from the main requirements file. Namely black.

Will need to modify the Lint with Black GitHub action to explicitly install black.

AttributeError: 'SoccerInteractor' object has no attribute 'ball_centre'

(venv) C:\Users\sachi\PycharmProjects\RoboCup_Simulator>python .\run.py --preset=presets/field_no_teams.yaml robot/examples/controllable.yaml
Loading chipmunk for Windows (64bit) [C:\Users\sachi\PycharmProjects\RoboCup_Simulator\venv\lib\site-packages\pymunk\chipmunk.dll]
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File ".\run.py", line 18, in <module>
    runFromConfig(config)
  File "C:\Users\sachi\PycharmProjects\RoboCup_Simulator\simulation\loader.py", line 127, in runFromConfig
    sl.simulate()
  File "C:\Users\sachi\PycharmProjects\RoboCup_Simulator\simulation\loader.py", line 85, in simulate
    if interactor.tick(tick):
  File "C:\Users\sachi\PycharmProjects\RoboCup_Simulator\presets\soccer.py", line 123, in tick
    self.ball_centre.body.position = ScriptLoader.instance.object_map['IR_BALL'].body.position
AttributeError: 'SoccerInteractor' object has no attribute 'ball_centre'

@alanlu776 is getting the same error

I took a look at the code but I'm not familiar enough with it or Pymunk to figure out why it doesn't work.

Separate bots by team in batch.yaml

For example

preset_file: soccer.yaml
team1-bots:
- name: templateBot.yaml
  scripts:
  - templateBot.py
team2-bots:
- name: templateBot.yaml
  scripts:
  - templateBot.py

Would need to maintain backwards compatibility.

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.