Beta8397 / virtual_robot

A 2D robot simulator to help beginners learn Java programming for FTC Robotics
126 stars 190 forks source link

Add Differential swerve #52

Closed adamrubinfeld closed 4 years ago

adamrubinfeld commented 4 years ago

Hi It's not issue it's suggestion I think you need to add swerve and Differential swerve it's can be very helpful for team I mentor (I make one on yours sim but it's not working so good) I can help if you want

jkenney2 commented 4 years ago

I'll look into it. A couple of questions for you:

  1. What's the difference between a swerve and a differential swerve?
  2. What do you use to steer each wheel, servo or motor?

Edit: looks like a differential swerve would use two dc motors for each of two pods, for a total of four motors. Regular swerve would use one dc motor and one servo/crservo for each of four pods for a total of four dc motors and four servo/crservo.

adamrubinfeld commented 4 years ago

The different is the diff swerve is have more torque beacuse you combine two motors to control the velocity and the module heading For standard swerve on ftc you use CR and DC motor for each module and the torque is less then the diff swerve In diff swerve the software is harder beacuse you need to calculate the ratio between two motors on each module to set the module at the wanted angle

I work with two teams on diff swerve and with one team I work on standard swerve I can say 100% for FTC diff swerve is better but again the software is very hard against the standard swerve

jkenney2 commented 4 years ago

If you use crservo to steer a swerve, do you need to add an encoder to each pod, so you can tell what it's orientation is at any moment?

adamrubinfeld commented 4 years ago

You need to add encoder just for standard swerve with CR if it's with DC motor you don't need

For diff swerve you don't need at all

jkenney2 commented 4 years ago

@adamrubinfeld Started a "swerve" branch that you can check out. At this point just a swerve drive, along with a TestSwerve op mode. The op mode is very crude at this point. Will work on this, and eventually try a differential swerve.

jkenney2 commented 4 years ago

@adamrubinfeld TestSwerve opmode re-written to demonstrate operation of a swerve drive with gamepad: left-stick for forward-reverse and left-right; right stick for turning. The details of the swerve drive control are in a separate class: SwerveDrive.java. swerve branch merged into master.

jkenney2 commented 4 years ago

@adamrubinfeld Added Differential Swerve Drive robot config, and test op mode.