Skip to content

v1.0

Latest
Compare
Choose a tag to compare
@Jake-Moore Jake-Moore released this 08 May 19:51

The initial release of our field-oriented swerve drive simulation using vectors for odometry calculations.

  • Controls are WASD or Arrows + Q and E for rotating the swerve
  • The swerve is coded entirely in vectors and the odometry vector is a sum of the individual wheel vectors.
  • The code cannot be exactly replicated to a real swerve bot. Since everything was calculated to be drawn on an image, some of the vector coordinates were negated to work with the pixel positioning on the image. The robot rotation also isn't simulated realistically, a heading of 0 always corresponds with a vector pointing to the top of the screen, not relative to the robot. As a result, the rotation code is also negated and adjusted in a few places to work and draw properly on the screen.
  • This project was a proof of concept for calculating odometry from our existing vector-based field-oriented swerve. Feel free to use it if you want, it's just math :)

Running the Jar

  • When running the jar, the java argument "-Dsun.java2d.opengl=True" needs to be included. Without it the JFrame flashes white, possibly because it's being updated rapidly. (We aren't entirely sure, this fixed it for us though)
  • Ex: java -jar -Dsun.java2d.opengl=True SwerveSim-1.0.jar

unknown