-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created Arm Rotate and Arm Rotate Map
- Loading branch information
1 parent
dddb9ef
commit 588f3d1
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package frc.robot.maps.subsystems; | ||
|
||
import com.chopshop166.chopshoplib.logging.DataWrapper; | ||
import com.chopshop166.chopshoplib.logging.LoggableMap; | ||
import com.chopshop166.chopshoplib.logging.data.MotorControllerData; | ||
import com.chopshop166.chopshoplib.motors.SmartMotorController; | ||
import com.chopshop166.chopshoplib.sensors.IEncoder; | ||
|
||
public class ArmRotateMap implements LoggableMap<ArmRotateMap.Data> { | ||
|
||
public SmartMotorController motor; | ||
public final IEncoder encoder; | ||
|
||
public ArmRotateMap(SmartMotorController motor, IEncoder encoder) { | ||
this.motor = motor; | ||
this.encoder = encoder; | ||
} | ||
|
||
@Override | ||
public void updateData(Data data) { | ||
data.motor.updateData(motor); | ||
data.rotationAbsAngleDegrees = encoder.getAbsolutePosition(); | ||
} | ||
|
||
public static class Data extends DataWrapper { | ||
public MotorControllerData motor = new MotorControllerData(); | ||
public double rotationAbsAngleDegrees; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package frc.robot.subsystems; | ||
|
||
import com.chopshop166.chopshoplib.logging.LoggedSubsystem; | ||
|
||
import frc.robot.maps.subsystems.ArmRotateMap; | ||
import frc.robot.maps.subsystems.ArmRotateMap.Data; | ||
|
||
public class ArmRotate extends LoggedSubsystem<Data, ArmRotateMap> { | ||
|
||
public ArmRotate(ArmRotateMap armRotateMap) { | ||
super(new Data(), armRotateMap); | ||
} | ||
|
||
@Override | ||
public void safeState() { | ||
|
||
} | ||
} |