Skip to content

Commit

Permalink
chore: Update Robodash initialization and console usage
Browse files Browse the repository at this point in the history
  • Loading branch information
NoozAbooz committed May 23, 2024
1 parent 98282fc commit 47cd444
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 62 deletions.
3 changes: 3 additions & 0 deletions include/abstractGlobals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include "gif-pros/gifclass.hpp"
#include "robodash/api.h"

extern rd::Console console;
extern rd_view_t *gifview;

/* Functions */
// Slapper
void refreshSlapper();
Expand Down
3 changes: 1 addition & 2 deletions src/auton/autonomous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ void testPID() {
}

rd::Selector gui_selector({
{"PID test", &testPID},
{"PID test", &testPID, "/usd/images/pidtest.bin"},
});


void autonomous() {
chassis.setPose(0,0,0);
gui_selector.run_auton();
Expand Down
10 changes: 5 additions & 5 deletions src/init/initialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ void initialize() {

chassis.calibrate();
pros::Task odomTask(strait::odomThread);

rd::Console console;

rd_view_t *gifview = rd_view_create("Logo GIF");
static Gif gif("/usd/logo2.gif", rd_view_obj(gifview));
}

// Robodash inits
rd::Console console;
rd_view_t *gifview = rd_view_create("Logo");
static Gif gif("/usd/logo2.gif", rd_view_obj(gifview));

/**
* Runs while the robot is in the disabled state of Field Management System or
* the VEX Competition Switch, following either autonomous or opcontrol. When
Expand Down
2 changes: 1 addition & 1 deletion src/libSTRAITIS/drivetrain/pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void strait::LateralPID::move_lateral_pid(double target, double maxSpeed, double
double local_timer = 0;

while (true) {
double error = target - ((leftDrive.get_positions().at(0) + rightDrive.get_positions().at(0)) / 2);
double error = target - ((leftDrive.get_position(0) + rightDrive.get_position(0)) / 2);
integral = (integral + error);
derivative = (error - prevError);

Expand Down
54 changes: 0 additions & 54 deletions src/libSTRAITIS/util/led.cpp

This file was deleted.

2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "main.h"
#include "robodash/core.h"

/**
* Runs the operator control code. This function will be started in its own task
Expand All @@ -10,6 +11,7 @@
*/
void opcontrol() {
while (true) { // Main continuous loop
rd_view_focus(gifview);
/* Drive */
strait::arcadeDrive(12, 0, 0.5);

Expand Down

0 comments on commit 47cd444

Please sign in to comment.