Skip to content

Commit

Permalink
switch to n poe and do some other stuff it still sucks though feel fr…
Browse files Browse the repository at this point in the history
…ee to like git checkout the previous commit
  • Loading branch information
PascalSkylake committed Dec 7, 2024
1 parent b2250ed commit 5729e20
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"env": {
"vex_compilerPath": "${config:vexrobotics.vexcode.Cpp.Toolchain.Path}\\clang\\bin\\clang",
"vex_sdkPath": "${config:vexrobotics.vexcode.Cpp.Sdk.Home}\\V5\\V5_20240802_15_00_00\\vexv5",
"vex_compilerPath": "${config:vexrobotics.vexcode.Cpp.Toolchain.Path}/clang/bin",
"vex_sdkPath": "${config:vexrobotics.vexcode.Cpp.Sdk.Home}/V5/V5_20240802_15_00_00/vexv5",
"vex_gcc": "${vex_sdkPath}/gcc/include/c++/4.9.3",
"vex_sdkIncludes": [
"${vex_sdkPath}/clang/8.0.0/include/**",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"C_Cpp.default.systemIncludePath": [
"${config:vexrobotics.vexcode.Cpp.Sdk.Home}\\V5\\V5_20240802_15_00_00\\vexv5\\gcc\\include\\sys"
"${config:vexrobotics.vexcode.Cpp.Sdk.Home}/V5/V5_20240802_15_00_00/vexv5/gcc/include/sys"
],
"makefile.configureOnOpen": true,
"C_Cpp.errorSquiggles": "disabled"
Expand Down
2 changes: 1 addition & 1 deletion .vscode/vex_project_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"creationDate": "Wed, 20 Nov 2024 02:36:10 GMT",
"platform": "V5",
"language": "cpp",
"slot": 8,
"slot": 1,
"sdkVersion": "V5_20240802_15_00_00",
"cpp": {
"includePath": [],
Expand Down
4 changes: 2 additions & 2 deletions include/robot-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ extern PID::pid_config_t drive_correction_pid;

extern robot_specs_t robot_cfg;

// extern OdometryNWheel<3> odom;
extern OdometryTank odom;
extern OdometryNWheel<3> odom;
// extern OdometryTank odom;
extern TankDrive drive_sys;

/**
Expand Down
12 changes: 6 additions & 6 deletions src/competition/autonomous.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class DebugCommand : public AutoCommand {

void skills() {
CommandController cc {
odom.SetPositionCmd({.x = 12, .y = 96, .rot = 0}),
odom.SetPositionCmd({.x = 9, .y = 96, .rot = 0}),

new Async(new FunctionCommand([]() {
while(true) {
Expand Down Expand Up @@ -140,18 +140,18 @@ void skills() {
drive_sys.DriveToPointCmd({24, 120}, vex::forward, .8) -> withTimeout(1),

// Fifth Ring
drive_sys.TurnToPointCmd(0, 144, vex::directionType::fwd, .6) -> withTimeout(1),
drive_sys.DriveToPointCmd({6, 138}, vex::forward, .8) -> withTimeout(1),
drive_sys.TurnToPointCmd(4, 144, vex::directionType::fwd, .6) -> withTimeout(1),
drive_sys.DriveToPointCmd({6, 137}, vex::forward, .8) -> withTimeout(1),

// Deposit First Stake
drive_sys.DriveForwardCmd(8, vex::directionType::rev, .6) -> withTimeout(.7),
drive_sys.DriveForwardCmd(18, vex::directionType::rev, .6) -> withTimeout(.7),
// drive_sys.TurnToPointCmd(96, 120, vex::directionType::fwd, .6) -> withTimeout(3),
drive_sys.TurnToHeadingCmd(-45, .6) -> withTimeout(.5),
conveyor_stop_command(),

//drop goal/move away
goal_grabber_command(false),
drive_sys.DriveForwardCmd(4, vex::directionType::rev, .8) -> withTimeout(.3),
drive_sys.DriveForwardCmd(7, vex::directionType::rev, .8) -> withTimeout(.3),
drive_sys.DriveToPointCmd({24, 120}, vex::forward, .8) -> withTimeout(.6),


Expand All @@ -161,7 +161,7 @@ void skills() {

//grab second goal
drive_sys.TurnToHeadingCmd(90, .6) -> withTimeout(1),
drive_sys.DriveForwardCmd(24,vex::directionType::rev,.6)-> withTimeout(1),
drive_sys.DriveToPointCmd({96, 96},vex::directionType::rev,.6)-> withTimeout(1),
goal_grabber_command(true),
conveyor_intake_command()->withCancelCondition(new ConveyorStalled),

Expand Down
7 changes: 4 additions & 3 deletions src/competition/opcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ void testing();
*/
void opcontrol()
{
autonomous();
// autonomous();
testing();
// ================ INIT ================
while (imu.isCalibrating()) {
vexDelay(1);
Expand Down Expand Up @@ -116,8 +117,8 @@ void testing() {
// drive_sys.DriveForwardCmd(24.0, vex::fwd, 0.6)->withTimeout(12),
// new DelayCommand(500),
// }, new TimesTestedCondition(4)),
drive_sys.DriveForwardCmd(48.0, vex::fwd, 0.8)->withTimeout(3),
drive_sys.TurnToHeadingCmd(90.0, 0.7)->withTimeout(3),
// drive_sys.DriveForwardCmd(48.0, vex::fwd, 0.8)->withTimeout(3),
// drive_sys.TurnToHeadingCmd(90.0, 0.7)->withTimeout(3),
// drive_sys.DriveForwardCmd(96.0, vex::fwd, 0.8)->withTimeout(3),
// drive_sys.TurnToHeadingCmd(180.0, 0.7)->withTimeout(3),
// drive_sys.DriveForwardCmd(96.0, vex::fwd, 0.8)->withTimeout(3),
Expand Down
14 changes: 7 additions & 7 deletions src/robot-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ CustomEncoder left_enc{Brain.ThreeWirePort.C, 2048};
CustomEncoder right_enc{Brain.ThreeWirePort.E, 2048};
CustomEncoder front_enc{Brain.ThreeWirePort.G, 2048};

tracking_wheel_cfg_t left_enc_cfg{-0.0625, 3.625, M_PI, 0.9};
tracking_wheel_cfg_t right_enc_cfg{-0.0625, -3.625, 0, 0.9};
tracking_wheel_cfg_t front_enc_cfg{4.5, -0.375, (M_PI/2), 0.9};
tracking_wheel_cfg_t left_enc_cfg{-0.0625, 3.625, M_PI, 1.0625};
tracking_wheel_cfg_t right_enc_cfg{-0.0625, -3.625, 0, 1.0625};
tracking_wheel_cfg_t front_enc_cfg{4.5, -0.375, (M_PI/2), 1.0625};

// ================ OUTPUTS ================
// Motors
Expand Down Expand Up @@ -86,7 +86,7 @@ PID::pid_config_t turn_pid_cfg{
.i = 0.005,
.d = 0.001,
//.deadband = 1.5,
.deadband = 3,
.deadband = 2,
.on_target_time = 0.1,
};

Expand All @@ -98,16 +98,16 @@ robot_specs_t robot_cfg{
.robot_radius = 12.0,
.odom_wheel_diam = 2.125,
.odom_gear_ratio = 1.0,
.dist_between_wheels = 11.0,
.dist_between_wheels = 12.5,

// .drive_correction_cutoff = 0,
.drive_feedback = &drive_pid,
.turn_feedback = &turn_pid,
.correction_pid = drive_correction_pid,
};

// OdometryNWheel<3> odom({left_enc, right_enc, front_enc}, {left_enc_cfg, right_enc_cfg, front_enc_cfg}, &imu, true);
OdometryTank odom(left_enc, right_enc, robot_cfg, &imu);
OdometryNWheel<3> odom({left_enc, right_enc, front_enc}, {left_enc_cfg, right_enc_cfg, front_enc_cfg}, &imu, true);
// OdometryTank odom(left_enc, right_enc, robot_cfg, &imu);
TankDrive drive_sys(left_motors, right_motors, robot_cfg, &odom);

/**
Expand Down

0 comments on commit 5729e20

Please sign in to comment.