Skip to content

Stage1a auto + additonal motors - #194

Open
Spaceman113138 wants to merge 10 commits into
frcsoftware:mainfrom
Spaceman113138:stage1a-auto
Open

Stage1a auto + additonal motors#194
Spaceman113138 wants to merge 10 commits into
frcsoftware:mainfrom
Spaceman113138:stage1a-auto

Conversation

@Spaceman113138

@Spaceman113138 Spaceman113138 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description

Adds stage 1a curriculum for programing a simple auto as well as progiraming the IntakeLauncher and Feeder motors. Makes progress on #13 .

Todo:

  • Video + text on running the simple auto
  • Talk about FuelSim
  • Update FuelSim to use periodic() over update()
  • Video + text on AScope graph with additonal motors
  • Video + text on Ascope 3d with additional motors

Meta

Merge checklist:

@github-actions github-actions Bot added Curriculum material Curriculum materials, lessons for students, etc stage1 examples labels Aug 19, 2026
@github-actions

Copy link
Copy Markdown

🌐 Preview URL: https://pr-194.frcsoftware.pages.dev

@Spaceman113138
Spaceman113138 marked this pull request as ready for review August 24, 2026 03:04

Now that the kitbot can move in teleop mode, it is time to make it move during the auto mode.
To do this, another `OpMode` needs to be written that contains all the code needed to make the robot do what's wanted in auto.
Additionally the `@Autonomous` annotation is added above the class definition so it shows up in the driverstation under autonomous OpModes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Additionally the `@Autonomous` annotation is added above the class definition so it shows up in the driverstation under autonomous OpModes.
When writing an `OpMode` for kitbot, there is an `@Autonomous` annotation that is added above the class definition so it shows up in the driverstation under autonomous OpModes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense but basically tying it back to the code more to make a better connection that the autonomous annotation is something that is in the robot that the students will be writing. Before it just seemed like a cool fact and the connection to kitbot/robot code wasn't quite there


# Autonomous OpMode

Now that the kitbot can move in teleop mode, it is time to make it move during the auto mode.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding on why kitbot needs an auto would be really helpful. It can be as simple as explaining how auto points are typically doubled or whatever. Kind of helps answer the "why" in "why should students learn this"
I think since this is a timed based auto, it's probably good to note here that auto is typically 15 seconds or something like that. so students don't try writing 30 second autos and then get confused on why the full code doesn't work. also it's good to know (new students might not know there is a time limit in auto)

This auto will be a timed based auto, meaning everything the robot does will be based on how long it has been since the start of autonomous.
To keep track of how long it has been since the start of auto an instance of `Timer` is created in the OpMode and reset when the robot is enabled.

The code for the auto should be added to the `MyAuto.java` file inside the opmode folder.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The code for the auto should be added to the `MyAuto.java` file inside the opmode folder.
The code for the auto will be added to the `MyAuto.java` file inside the opmode folder.

This can be accomplished by periodically checking if it has been four seconds since the start of auto using the `Timer` instance.
If it has been at least four seconds then command the drivetrain with zero speed.
Otherwise command the drivetrain to drive forward at half speed.
Writing that out in code will look like this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not but is there a way to make it less "copy and paste" and have the steps be broken down more? Could be something like

  1. Explaining how we want to check if the if it has been four seconds since the start of auto using the Timer instance.
  2. If so, then we want the robot to drive forward
  3. If the 4 seconds are up, then we want the robot to stop driving

Because it's 1a, I think breaking it down more will be helpful in giving students that foundational understanding

@@ -25,6 +25,7 @@ public void start() {
autoTimer.restart(); // Reset the timer to zero at the start of auto

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's autoTimer here but it's timer in the Rev solution. Should probably pick one and use it throughout


If the code was to be simulated at this point, the motors could be controlled using keyboard inputs and the resulting motor speeds could be viewed with a graph inside of Advantage Scope.
While this is a functional solution, it can be made more interesting by taking advantage of Advantage Scope's 3d tab.
Advantage Scope's 3d tab displays robots and game pieces inside of a game field using poses published from the robot code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Advantage Scope's 3d tab displays robots and game pieces inside of a game field using poses published from the robot code.
AdvantageScope's 3d tab displays robots and game pieces inside of a game field using poses published from the robot code.

Advantage Scope's 3d tab displays robots and game pieces inside of a game field using poses published from the robot code.
This allows fuel to be shown entering or exiting the robot while is intaking or launching.

The `FuelSim` class is provided which takes the current state of the IntakeLauncher and Feeder motors and publishes new poses for the fuel to be visualized at in Advantage Scope.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `FuelSim` class is provided which takes the current state of the IntakeLauncher and Feeder motors and publishes new poses for the fuel to be visualized at in Advantage Scope.
The `FuelSim` class is provided which takes the current state of the IntakeLauncher and Feeder motors and publishes new poses for the fuel to be visualized at in AdvantageScope.


If the code was to be simulated at this point, the motors could be controlled using keyboard inputs and the resulting motor speeds could be viewed with a graph inside of Advantage Scope.
While this is a functional solution, it can be made more interesting by taking advantage of Advantage Scope's 3d tab.
Advantage Scope's 3d tab displays robots and game pieces inside of a game field using poses published from the robot code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also might be helpful to quickly explain what a pose is

<ContentFigure
width="650px"
alt="Using Line Graph"
src="/learning-course/stage1/stage1a/LineGraph.webm"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw the videos dont show up correctly.

Image

<ContentFigure
width="650px"
alt="Using 3D Field"
src="/learning-course/stage1/stage1a/3dField.webm"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same video issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Curriculum material Curriculum materials, lessons for students, etc examples stage1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants