Skip to content

Commit

Permalink
roadrunner until track width
Browse files Browse the repository at this point in the history
  • Loading branch information
arunaassijaqa committed Nov 10, 2024
1 parent 5d0b024 commit 180f942
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ManualFeedforwardTuner : LinearOpMode() {
}

companion object {
private var DISTANCE = 72.0 // in
private var DISTANCE = 110.0 // in
private fun generateProfile(movingForward: Boolean): MotionProfile {
val start = MotionState(if (movingForward) 0.0 else DISTANCE, 0.0, 0.0, 0.0)
val goal = MotionState(if (movingForward) DISTANCE else 0.0, 0.0, 0.0, 0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class DriveSubsystem @JvmOverloads constructor(
companion object {
var TRANSLATIONAL_PID = PIDCoefficients(8.0, 0.0, 0.0)
var HEADING_PID = PIDCoefficients(8.0, 0.0, 0.0)
var LATERAL_MULTIPLIER = 1.0
var LATERAL_MULTIPLIER = 1.0126582278481012658227848101266
var VX_WEIGHT = 1.0
var VY_WEIGHT = 1.0
var OMEGA_WEIGHT = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ object DriveConstants {
*/
var WHEEL_RADIUS = 1.88976 // in`
var GEAR_RATIO = 1.0 // output (wheel) speed / input (motor) speed
@JvmField
var TRACK_WIDTH = 15.5 // in

/*
Expand All @@ -54,9 +55,12 @@ object DriveConstants {
* motor encoders or have elected not to use them for velocity control, these values should be
* empirically tuned.
*/
var kV = 1.0 / rpmToVelocity(MAX_RPM)
var kA = 0.0
var kStatic = 0.0
@JvmField
var kV = 0.0123
@JvmField
var kA = 0.003
@JvmField
var kStatic = 0.01

/*
* These values are used to generate the trajectories for you robot. To ensure proper operation,
Expand All @@ -71,7 +75,7 @@ object DriveConstants {
* ((MAX_RPM / 60) * GEAR_RATIO * WHEEL_RADIUS * 2 * Math.PI) * 0.85
* Resulting in 73.17330064499293 in/s.
* This is only 85% of the theoretical maximum velocity of the bot, following the recommendation above.
* This is capped at 85% because there are a number of variables that will prevent your bot from actually
* This is capped at 85% because there are a number of variables that will preve nt your bot from actually
* reaching this maximum velocity: voltage dropping over the game, bot weight, general mechanical inefficiencies, etc.
* However, you can push this higher yourself if you'd like. Perhaps raise it to 90-95% of the theoretically
* max velocity. The theoretically maximum velocity is 86.08623605293286 in/s.
Expand All @@ -86,10 +90,10 @@ object DriveConstants {
* You are free to raise this on your own if you would like. It is best determined through experimentation.
*/
var MAX_VEL = 73.17330064499293
var MAX_ACCEL = 73.17330064499293
var MAX_ANG_VEL = Math.toRadians(270.4852451612903)
var MAX_ANG_ACCEL = Math.toRadians(270.4852451612903)
var MAX_VEL = 30.0
var MAX_ACCEL = 30.0
var MAX_ANG_VEL = Math.toRadians(180.0)
var MAX_ANG_ACCEL = Math.toRadians(170.0)
fun encoderTicksToInches(ticks: Double): Double {
return WHEEL_RADIUS * 2 * Math.PI * GEAR_RATIO * ticks / TICKS_PER_REV
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class StandardTrackingWheelLocalizer(hardwareMap: HardwareMap) : ThreeTrackingWh
val GEAR_RATIO = 1.0 // output (wheel) speed / input (encoder) speed

@JvmField
var LATERAL_DISTANCE = 15.5 // in; distance between the left and right wheels
var LATERAL_DISTANCE = 15.153260857569071 // in; distance between the left and right wheels

@JvmField
var FORWARD_OFFSET = -2.1 // in; offset of the lateral wheel
Expand Down

0 comments on commit 180f942

Please sign in to comment.