before mayhem elims
This commit is contained in:
parent
4386de4d4d
commit
d312e125cd
@ -16,12 +16,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 3.6442622950819668,
|
"x": 3.609900518622585,
|
||||||
"y": 5.031967213114754
|
"y": 5.005924534374863
|
||||||
},
|
},
|
||||||
"prevControl": {
|
"prevControl": {
|
||||||
"x": 3.328722911520323,
|
"x": 3.2943611350609414,
|
||||||
"y": 5.557866185717494
|
"y": 5.531823506977602
|
||||||
},
|
},
|
||||||
"nextControl": null,
|
"nextControl": null,
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
"waypoints": [
|
"waypoints": [
|
||||||
{
|
{
|
||||||
"anchor": {
|
"anchor": {
|
||||||
"x": 3.6442622950819668,
|
"x": 3.609900518622585,
|
||||||
"y": 5.031967213114754
|
"y": 5.005924534374863
|
||||||
},
|
},
|
||||||
"prevControl": null,
|
"prevControl": null,
|
||||||
"nextControl": {
|
"nextControl": {
|
||||||
"x": 3.5117625600811717,
|
"x": 3.47740078362179,
|
||||||
"y": 5.243966789116026
|
"y": 5.217924110376135
|
||||||
},
|
},
|
||||||
"isLocked": false,
|
"isLocked": false,
|
||||||
"linkedName": "L"
|
"linkedName": "L"
|
||||||
|
@ -7,7 +7,7 @@ package frc.robot;
|
|||||||
import org.littletonrobotics.junction.LoggedRobot;
|
import org.littletonrobotics.junction.LoggedRobot;
|
||||||
import org.littletonrobotics.junction.LogFileUtil;
|
import org.littletonrobotics.junction.LogFileUtil;
|
||||||
import org.littletonrobotics.junction.Logger;
|
import org.littletonrobotics.junction.Logger;
|
||||||
//import org.littletonrobotics.junction.networktables.NT4Publisher;
|
import org.littletonrobotics.junction.networktables.NT4Publisher;
|
||||||
import org.littletonrobotics.junction.wpilog.WPILOGReader;
|
import org.littletonrobotics.junction.wpilog.WPILOGReader;
|
||||||
import org.littletonrobotics.junction.wpilog.WPILOGWriter;
|
import org.littletonrobotics.junction.wpilog.WPILOGWriter;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ public class RobotContainer {
|
|||||||
drivetrain.drive(
|
drivetrain.drive(
|
||||||
() -> driver.getLeftY() * Math.pow(Math.abs(driver.getLeftY()) + Math.abs(driver.getLeftX()), 3),
|
() -> driver.getLeftY() * Math.pow(Math.abs(driver.getLeftY()) + Math.abs(driver.getLeftX()), 3),
|
||||||
() -> driver.getLeftX() * Math.pow(Math.abs(driver.getLeftY()) + Math.abs(driver.getLeftX()), 3),
|
() -> driver.getLeftX() * Math.pow(Math.abs(driver.getLeftY()) + Math.abs(driver.getLeftX()), 3),
|
||||||
driver::getRightX, //Math.signum(driver.getRightX()) * Math.pow(driver.getRightX(), 3)
|
() -> driver.getRightX(),
|
||||||
() -> true
|
() -> true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -16,6 +16,8 @@ public class AutoConstants {
|
|||||||
public static final double kMaxAngularSpeedRadiansPerSecond = Math.PI;
|
public static final double kMaxAngularSpeedRadiansPerSecond = Math.PI;
|
||||||
public static final double kMaxAngularSpeedRadiansPerSecondSquared = Math.PI;
|
public static final double kMaxAngularSpeedRadiansPerSecondSquared = Math.PI;
|
||||||
|
|
||||||
|
public static final double kMaxSpeedMetersPerSecondAutoAlign = 2.5;
|
||||||
|
|
||||||
public static final double kPXYController = 3.5;
|
public static final double kPXYController = 3.5;
|
||||||
public static final double kPThetaController = 5;
|
public static final double kPThetaController = 5;
|
||||||
|
|
||||||
|
@ -362,8 +362,8 @@ public class Drivetrain extends SubsystemBase {
|
|||||||
);
|
);
|
||||||
|
|
||||||
double speed = Math.hypot(controlEffort.vxMetersPerSecond, controlEffort.vyMetersPerSecond);
|
double speed = Math.hypot(controlEffort.vxMetersPerSecond, controlEffort.vyMetersPerSecond);
|
||||||
if (speed > AutoConstants.kMaxSpeedMetersPerSecond) {
|
if (speed > AutoConstants.kMaxSpeedMetersPerSecondAutoAlign) {
|
||||||
double mul = AutoConstants.kMaxSpeedMetersPerSecond / speed;
|
double mul = AutoConstants.kMaxSpeedMetersPerSecondAutoAlign / speed;
|
||||||
controlEffort.vxMetersPerSecond *= mul;
|
controlEffort.vxMetersPerSecond *= mul;
|
||||||
controlEffort.vyMetersPerSecond *= mul;
|
controlEffort.vyMetersPerSecond *= mul;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user