Skip to content

net-man/RobietUnion-Code-Repository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RobietUnion-Code-Repository

This is the repository used by the RobietUnion and their ever lasting attempts at world domination. Built from the ground up, this collection of libraries kind of sucks but they all pretty much work.

How to use it

The repository comes with a premade .ino file. To add logic to the robot you should only edit the methods. The code above manages the state machine and a lot of other junk that isn't worth messing with. If you want to change the pins, those are defined on the top.

 

Control Overview

The robot class has a few methods for controlling.

Drive

bot.Drive(int x, int y);

This will drive the robot via arcade drive. y will control drive speed and x will control rotation speed.

 

Tank Drive

bot.DriveTank(int right, int left);

This is for if you want to control the robot like a tank. right and left obviously corispond to how fast each side of the robot is.

 

Stop

bot.Stop();

This just stops the robot from moving. This is different from writing bot.Drive(0, 0) or bot.DriveTank(0, 0) because it instead never sends anything to the motors.

 

The robot can be adjusted by various variables defined within the Robot class.

Drive Speed

bot.speedBais = value;

This will adjust how much the y in bot.Drive(int x, int y) will be used over the x.

 

Rotation Speed

bot.rotationBias = value;

This will adjust how much the x in bot.Drive(int x, int y) will be used over the y.

 

State Overview

There are 3 different states the robot can be in.  

Idle

void Idle();

Runs continually before the robot can move. This state acts as time outside of the compitiion.

 

Autonomous

void Autonomous();

Runs throughout the autonomous part of the compitition. In this stage, controlling the robot is not allowed.

 

Teleop

void Teleop();

Runs after atonomous. The bot is now allowed to be controlled by a human.

 

Each state has 2 stages:  

Init

Init Runs once at the start of the state.

Loop

Loop Runs repeatedly until the state changes.

 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published