Giter VIP home page Giter VIP logo

Comments (16)

virtuald avatar virtuald commented on September 7, 2024

I don't own an Xbox controller, so I can't test it. Can you patch the pygame implementation so it's correct? The implementation seems to be pretty straightforward: https://github.com/robotpy/pyfrc/blob/master/lib/pyfrc/sim/pygame_joysticks.py

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

Okay, I'll see if I can.

E/ Scratch what i said before in this comment. Solved that problem, not the problem of this issue.

On Sun, Jan 10, 2016 at 3:06 PM, Dustin Spicuzza [email protected]
wrote:

I don't own an Xbox controller, so I can't test it. Can you patch the
pygame implementation so it's correct? The implementation seems to be
pretty straightforward:
https://github.com/robotpy/pyfrc/blob/master/lib/pyfrc/sim/pygame_joysticks.py


Reply to this email directly or view it on GitHub
#40 (comment).

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

E/ scratch this as well, getAxis is different than getRawAxis.

Sorry, its been a year! D:

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

Where would I find this locally? there is no C:\Python34\Libs\pyfrc folder

from pyfrc.

virtuald avatar virtuald commented on September 7, 2024

It would be C:\Python34\Libs\site-packages\pyfrc. But even better, what I would do is the following:

py -3 -m pip uninstall pyfrc
git clone https://github.com/robotpy/pyfrc.git
cd pyfrc
py -3 -m pip install -e .

This will install pyfrc in 'develop' mode, which means any changes you make in the git repository will automatically show up when you do a 'import pyfrc'.

See setuptools develop mode docs for more details.

from pyfrc.

virtuald avatar virtuald commented on September 7, 2024

Also, have you tried using XBoxController object?

from pyfrc.

virtuald avatar virtuald commented on September 7, 2024

Good question. You can delete the .deploy_cfg file. Should probably have an option to change it.

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

Yeah I found that file after some digging around. Maybe something in the
eclipse plugin, either a config option for "team IP address" or just a
"Deploy to new IP" would be good.

Also, after some tests, getRawAxis fixes my bug with the real robot but it
still shows the same issues in the simulator. XboxControiller did not solve
the issue either (its just a wrapper for getRawAxis anyway).

I looked in that directory and did not find pyfrc. Turns out that pyfrc
installed itself in the python 3.5 directory instead of the 3.4 (I
installed 3.4 over 3.5 because of issues with pygame), so I reinstalled
pyfrc in 3.4 and it seems to be correct now. I'll report back if I'm able
to find out why the discrepancy exists.

Also, for future reports, would you rather me communicate over the relevant
github repository or ChiefDelphi? I've been using github for a while so it
is pretty much second nature.

On Mon, Jan 11, 2016 at 12:48 PM, Dustin Spicuzza [email protected]
wrote:

Good question. You can delete the .deploy_cfg file. Should probably have
an option to change it.


Reply to this email directly or view it on GitHub
#40 (comment).

from pyfrc.

virtuald avatar virtuald commented on September 7, 2024

github is preferred. I have a note somewhere to make a team IP address option available.

Are you using the eclipse plugins? I had found they weren't very useful so I haven't upgraded them for 2016.

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

Yes. I can't figure out how to make the "run" button actually work instead of using "run as" but other than that they are useful for me. I like to close out of tabs constantly so I end up closing the command line tab to deploy code and whatnot which is why I switched to the GUI version. (I also already had eclipse installed for work).

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

So there was really no way to ACTUALLY fix the issue, because pygame uses DirectInput and the driver station uses XInput (that may be backwards... but you get the issue).

My fork of the repo has a workaround fix for this- https://github.com/Arhowk/pyfrc

Basically, it added 2 to the maximum axes count than checked if it hit the axes maximum, than its probably an xbox controller and it will move the axes around accordingly.

There are a few issues..

  • Triggers dont behave EXACTLY like in the robot. In the robot, both triggers are independent. In the sim, you can only have one held at a time. I have no way to fix this but its quite a rare scenario in which an issue arises.
  • Controllers with 5 axes automatically get setup to be xbox controllers. Most 6 axis controllers are xbox or xbox-variant controllers anyway so, again, not a huge issue.
  • The UI doesn't show axes besides X and Y properly. Not a huge issue using the controller but it removes the opportunity for xbox controllers to be played with via the interface if you don't have an xbox controller

Also, its worth noting that these tests were done with my DS4W controller but it has the same exact axis layout as an xbox controller.

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

Addition: current pysim has no POV support. (need todo)

from pyfrc.

virtuald avatar virtuald commented on September 7, 2024

Added POV support in 2016.1.3, but not in pygame support. The math is a bit messed up if you click it with a mouse, but I'm tired and don't use it. PR accepted. :)

from pyfrc.

Arhowk avatar Arhowk commented on September 7, 2024

Hm? wpilib.Joystick already had a getPov() but it returned nothing on the
sim

On Wednesday, January 20, 2016, Dustin Spicuzza [email protected]
wrote:

Added POV support in 2016.1.3, but not in pygame support. The math is a
bit messed up if you click it with a mouse, but I'm tired and don't use it.
PR accepted. :)


Reply to this email directly or view it on GitHub
#40 (comment).

from pyfrc.

virtuald avatar virtuald commented on September 7, 2024

If you upgrade, you'll see a POV thing you can click on in the simulator.

from pyfrc.

virtuald avatar virtuald commented on September 7, 2024

Closing due to age.

from pyfrc.

Related Issues (20)

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.