Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
TheEndIsNeverTheEndIsNeverTheEndIsNeverTheEndIsNe
Browse files Browse the repository at this point in the history
  • Loading branch information
superrm11 committed May 1, 2024
1 parent 5775828 commit 25c124b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .vscode/vex_project_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"json": 2
},
"project": {
"name": "Jover_BLUE",
"name": "Jover_RED",
"description": "",
"creationDate": "Tue, 30 Apr 2024 13:14:06 GMT",
"creationDate": "Tue, 30 Apr 2024 19:05:50 GMT",
"platform": "V5",
"language": "cpp",
"slot": 2,
"slot": 1,
"sdkVersion": "V5_20240223_11_00_00",
"cpp": {
"includePath": [],
Expand Down
4 changes: 2 additions & 2 deletions src/automation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
vision_filter_s default_vision_filter = {
.min_area = 2000,
.max_area = 1000000,
.aspect_low = 0.6,
.aspect_high = 1.6,
.aspect_low = 0.5,
.aspect_high = 2,

.min_x = 0,
.max_x = 320,
Expand Down
26 changes: 14 additions & 12 deletions src/competition/autonomous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define FWD vex::directionType::fwd
#define REV vex::directionType::rev

#define SIDE BLUE
#define SIDE RED

enum Side { LEFT, RIGHT };

Expand Down Expand Up @@ -125,7 +125,7 @@ class DebugCommand : public AutoCommand {
}
};

// #define ELIMS
#define ELIMS

void awp_auto() {
if (cata_sys.get_cata_state() != CataOnlyState::CataOff)
Expand All @@ -141,7 +141,7 @@ void awp_auto() {

static int vis_tball_num = 0;
#ifdef ELIMS
#define END_EARLY_TIME 40
#define END_EARLY_TIME 45
#else
#define END_EARLY_TIME 37
#endif
Expand Down Expand Up @@ -211,10 +211,10 @@ void awp_auto() {
new FunctionCommand([](){

const vision_filter_s filter = {
.min_area = 2200,
.min_area = 2000,
.max_area = 1000000,
.aspect_low = 0.6,
.aspect_high = 1.5,
.aspect_low = 0.5,
.aspect_high = 2,

.min_x = 0,
.max_x = 320,
Expand All @@ -225,7 +225,7 @@ void awp_auto() {
drive_sys.drive_tank_raw(-0.5, 0.5);

// After reaching a max heading, stop scanning
if(odom.get_position().rot > 225)
if(odom.get_position().rot > 270)
{
end_vision_scan = true;
return true;
Expand All @@ -240,7 +240,7 @@ void awp_auto() {
new FunctionCondition([]() -> bool {return end_vision_scan;}),
new InOrder{ // FALSE - do NOT end vision scan, start tracking the ball
cata_sys.IntakeToHold(),
(new VisionTrackTriballCommand())->withCancelCondition(new IsCrossingYValCondition(71)),
(new VisionTrackTriballCommand())->withCancelCondition((new IsCrossingYValCondition(71))->Or(drive_sys.DriveStalledCondition(1))),
new FunctionCommand(light_off),
drive_sys.DriveToPointCmd({98, 61}, REV),
drive_sys.TurnToHeadingCmd(0),
Expand Down Expand Up @@ -272,8 +272,8 @@ void awp_auto() {
const vision_filter_s filter = {
.min_area = 2000,
.max_area = 1000000,
.aspect_low = 0.6,
.aspect_high = 1.6,
.aspect_low = 0.5,
.aspect_high = 2,

.min_x = 0,
.max_x = 320,
Expand All @@ -284,7 +284,7 @@ void awp_auto() {
drive_sys.drive_tank_raw(-0.5, 0.5);

// After reaching a max heading, stop scanning
if(odom.get_position().rot > 225)
if(odom.get_position().rot > 270)
{
end_vision_scan = true;
return true;
Expand All @@ -300,7 +300,8 @@ void awp_auto() {
(new InOrder{ // USE VISION
cata_sys.IntakeToHold(),
(new VisionTrackTriballCommand())->withCancelCondition(drive_sys.DriveStalledCondition(2)),
drive_sys.DriveForwardCmd(3, REV),
drive_sys.DriveToPointCmd({92, 57}, REV),
// drive_sys.DriveForwardCmd(3, REV),
drive_sys.TurnToHeadingCmd(0),
cata_sys.Unintake(),
drive_sys.DriveForwardCmd(100, FWD, 0.5)->withTimeout(1),
Expand All @@ -320,6 +321,7 @@ void awp_auto() {
new FunctionCommand(light_off),
#ifdef ELIMS
drive_sys.TurnToHeadingCmd(305),
// new DelayCommand(3),
drive_sys.DriveToPointCmd({122, 14}, FWD),
drive_sys.TurnToHeadingCmd(55),
#else
Expand Down
7 changes: 6 additions & 1 deletion src/robot-config.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "robot-config.h"
#include "../core/include/subsystems/fun/video.h"
brain Brain;
controller con;
#define COMP_BOT
Expand Down Expand Up @@ -210,14 +211,18 @@ std::vector<screen::Page *> pages;
*/
void robot_init() {

set_video("funky_low.mpeg");


pages = {
new AutoChooser({"Auto 1", "Auto 2", "Auto 3", "Auto 4"}),
new screen::OdometryPage(odom, 12, 12, true),
cata_sys.Page(),
new screen::StatsPage(motor_names),
new VideoPlayer()
};

screen::start_screen(Brain.Screen, pages, 2);
screen::start_screen(Brain.Screen, pages, 4);
imu.calibrate();

l_endgame_sol.set(false);
Expand Down

0 comments on commit 25c124b

Please sign in to comment.