Skip to content

Commit

Permalink
setup field simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Shilab66 committed Dec 12, 2023
1 parent 8080bfa commit 5dbe480
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/com/team4099/robot2023/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.team4099.robot2023.auto.AutonomousSelector
import com.team4099.robot2023.auto.PathStore
import com.team4099.robot2023.config.ControlBoard
import com.team4099.robot2023.config.constants.Constants
import com.team4099.robot2023.config.constants.FieldConstants
import com.team4099.robot2023.subsystems.falconspin.MotorChecker
import com.team4099.robot2023.util.Alert
import com.team4099.robot2023.util.Alert.AlertType
Expand Down Expand Up @@ -157,6 +158,7 @@ object Robot : LoggedRobot() {
}

override fun robotPeriodic() {

// RobotContainer.measurementsWithTimestamps.forEach {
// RobotContainer.addVisionMeasurement(it) }

Expand Down Expand Up @@ -192,6 +194,9 @@ object Robot : LoggedRobot() {
Logger.getInstance().recordOutput("LoggedRobot/port3", port3.voltage)
*/

Logger.getInstance().recordOutput("AprilTagPose/0", FieldConstants.homeAprilTags[0].pose.pose3d)
Logger.getInstance().recordOutput("AprilTagPose/1", FieldConstants.homeAprilTags[1].pose.pose3d)
}

override fun teleopInit() {
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/com/team4099/robot2023/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.team4099.robot2023.commands.drivetrain.ResetGyroYawCommand
import com.team4099.robot2023.commands.drivetrain.TeleopDriveCommand
import com.team4099.robot2023.config.ControlBoard
import com.team4099.robot2023.config.constants.Constants
import com.team4099.robot2023.config.constants.FieldConstants
import com.team4099.robot2023.subsystems.drivetrain.drive.Drivetrain
import com.team4099.robot2023.subsystems.drivetrain.drive.DrivetrainIOReal
import com.team4099.robot2023.subsystems.drivetrain.drive.DrivetrainIOSim
Expand Down Expand Up @@ -101,6 +102,8 @@ object RobotContainer {
drivetrain.elevatorHeightSupplier = Supplier { superstructure.elevatorInputs.elevatorPosition }
drivetrain.objectiveSupplier = Supplier { superstructure.objective }
limelight.gamePieceToLookFor = { superstructure.objective }


}

fun mapDefaultCommands() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ object FieldConstants {
// church tags
val homeAprilTags: List<AprilTag> =
listOf(
AprilTag(1, Pose3d((40.45).inches, (108.19).inches, (45).centi.meters, Rotation3d())),
AprilTag(
0,
Pose3d(
Expand All @@ -172,7 +171,8 @@ object FieldConstants {
(46).centi.meters,
Rotation3d()
)
)
),
AprilTag(1, Pose3d((40.45).inches, (108.19).inches, (45).centi.meters, Rotation3d()))
)

// AprilTag locations (do not flip for red alliance)
Expand Down

0 comments on commit 5dbe480

Please sign in to comment.