Author Topic: Swerve Drive Simulator  (Read 15276 times)

0 Members and 1 Guest are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Swerve Drive Simulator
« on: June 06, 2014, 09:48:54 pm »
This year, my robotics team (FRC 2067) used a swerve drive, which uses 4 independently controlled modules to allow any combination of rotation and translation.
I recently made a simulator/game for this in Java.


Here are the controls:

*the harvester has to be down before you can shoot
Scoring in this game can be done by throwing the ball over the truss in the middle of the field, or shooting into the blue goal at the end of the field.

It's a bit buggy, like when interacting with other robots, but I figured I'll share what I have, since I haven't posted anything in such a long time

Here are the links:

Html5 version:
http://applepi.tk/swerve


Desktop, which supports USB controllers:
http://applepi.tk/swerve.jar
Controller functionality tested on a Logitech Gamepad F310. Left stick for translation, right stick for rotation, LT and LB for harvester, RT for shoot, A for field centric, B for robot centric, D-pad for move rotation point, back for reset rotation point.


Tell me what you think :)
« Last Edit: June 07, 2014, 06:18:35 pm by epic7 »

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Swerve Drive Simulator
« Reply #1 on: June 06, 2014, 10:11:49 pm »
Okay, you're back. YAY!
now to start programming your 83+


As I said on chief delphi, I think you should Github the source. It would help a lot of people, as well as allow for contributions. Also: You should try your hand at a Java code simulator once the new control system comes out.
I am Bach.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Swerve Drive Simulator
« Reply #2 on: June 07, 2014, 01:32:01 am »
Yay Epic7 is back ! :D That robotics thingy sounds awesome. Do you have a video ?

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Swerve Drive Simulator
« Reply #3 on: June 07, 2014, 06:20:42 pm »
Made collisions a bit less terrible, and added a menu that can be accessed with esc.

And here's one of our matches, with us the red robot labelled 2067, scoring for the alliance.
Despite being 2 on 3 with one of our robots dead, we won the match.
This is at the world championships in St Louis.

Offline 123outerme

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 458
  • Rating: +23/-0
  • Self-unpaid intern
    • View Profile
Re: Swerve Drive Simulator
« Reply #4 on: June 07, 2014, 07:48:32 pm »
I feel like the HUD at the top of the arena should float around and follow the camera.
But maybe that's just my spoiled-ness talking :P

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: Swerve Drive Simulator
« Reply #5 on: June 07, 2014, 08:04:42 pm »
As I said on chief delphi, I think you should Github the source. It would help a lot of people, as well as allow for contributions. Also: You should try your hand at a Java code simulator once the new control system comes out.

Java, oh ouch. I wish java would go die in a hole somewhere. Python++!




Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Swerve Drive Simulator
« Reply #6 on: June 07, 2014, 08:11:35 pm »
You can't write FRC-legal code in Python :P

EDIT: 100 moar posts until I'm 1337!
I am Bach.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Swerve Drive Simulator
« Reply #7 on: June 07, 2014, 08:17:28 pm »
FRC-legal ? ???

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Swerve Drive Simulator
« Reply #8 on: June 07, 2014, 08:21:58 pm »
There are only 3 languages you are allowed to program FRC robots in: Java, C, and Labview.
I am Bach.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Swerve Drive Simulator
« Reply #9 on: June 07, 2014, 08:23:43 pm »
Oh OK I guess they're too lazy to learn asm.
* Streetwalrus runs

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: Swerve Drive Simulator
« Reply #10 on: June 07, 2014, 08:25:05 pm »
Um, then use C, not Java.



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Swerve Drive Simulator
« Reply #11 on: June 07, 2014, 08:26:06 pm »
Well, you can't program a cRIO-controlled robot in asm. There is no existing assembly language for the cRIO.

EDIT: :ninja: 'd

And flyingfisch, you don't have a choice. You program the robots in whatever your team says you program them in. For me, it's Java. For him, it's LabView. He also doesn't program C.
« Last Edit: June 07, 2014, 08:28:19 pm by pimathbrainiac »
I am Bach.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Swerve Drive Simulator
« Reply #12 on: June 07, 2014, 08:27:56 pm »
If there's a CPU, there's asm.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Swerve Drive Simulator
« Reply #13 on: June 08, 2014, 02:12:21 am »
This is awesome epic7. Also I think juju participated in similar competitions before, but the robots seemed different in style.

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Swerve Drive Simulator
« Reply #14 on: June 08, 2014, 09:31:44 am »
If there's a CPU, there's asm.

As I said. There is no supported assembly language for the cRIO. There are no assemblers, and the processor is proprietary (National Instruments). You can't program it in asm, even if you wanted to.
I am Bach.