diff --git a/2072X-lets-try-that-again/.vscode/c_cpp_properties.json b/2072X-lets-try-that-again/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..4eafdc7 --- /dev/null +++ b/2072X-lets-try-that-again/.vscode/c_cpp_properties.json @@ -0,0 +1,29 @@ +{ + "configurations": [ + { + "name": "PROS Project", + "includePath": [ + "${workspaceFolder}/**", + "c:\\Users\\cjans\\OneDrive\\Documents\\GitHub\\ary-over-under\\2072X-lets-try-that-again\\include" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "compilerPath": "c:\\Users\\cjans\\AppData\\Roaming\\Code\\User\\globalStorage\\sigbots.pros\\install\\pros-toolchain-windows\\usr\\bin\\arm-none-eabi-g++", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "gcc-arm", + "compileCommands": "c:\\Users\\cjans\\OneDrive\\Documents\\GitHub\\ary-over-under\\2072X-lets-try-that-again\\compile_commands.json", + "browse": { + "path": [ + "c:\\Users\\cjans\\OneDrive\\Documents\\GitHub\\ary-over-under\\2072X-lets-try-that-again" + ], + "limitSymbolsToIncludedHeaders": true, + "databaseFilename": "" + } + } + ], + "version": 4 +} \ No newline at end of file diff --git a/2072X-lets-try-that-again/project.pros b/2072X-lets-try-that-again/project.pros new file mode 100644 index 0000000..ee1a794 --- /dev/null +++ b/2072X-lets-try-that-again/project.pros @@ -0,0 +1,9 @@ +{ + "py/object": "pros.conductor.project.Project", + "py/state": { + "project_name": null, + "target": "cortex", + "templates": {}, + "upload_options": {} + } +} \ No newline at end of file diff --git a/RELENTLESS-Lite/include/globals.hpp b/RELENTLESS-Lite/include/globals.hpp index 2ff5184..3302d75 100644 --- a/RELENTLESS-Lite/include/globals.hpp +++ b/RELENTLESS-Lite/include/globals.hpp @@ -20,14 +20,10 @@ namespace globals { extern pros::Motor_Group left_drive; extern pros::Motor_Group right_drive; - extern lemlib::Drivetrain_t chassis_odom; + extern lemlib::Drivetrain drivetrain; + extern lemlib::linearController; + extern lemlib::angularController; + extern lemlib::sensors; + extern lemlib::Chassis chassis; extern Drive chassisRight; - extern Drive chassisLeft; - - extern pros::Motor cata_left; - extern pros::Motor cata_right; - - extern pros::Rotation enc_left; - extern pros::Rotation enc_right; - extern pros::Rotation enc_theta; -} \ No newline at end of file + extern Drive chassisLeft; \ No newline at end of file diff --git a/RELENTLESS-Lite/src/globals.cpp b/RELENTLESS-Lite/src/globals.cpp index 23878ae..338ce73 100644 --- a/RELENTLESS-Lite/src/globals.cpp +++ b/RELENTLESS-Lite/src/globals.cpp @@ -19,14 +19,6 @@ namespace globals { Two seperate drivetrains, chassis */ - lemlib::Drivetrain_t chassis_odom { - &left_drive, - &right_drive, - TRACK_WIDTH, - WHEEL_SIZE, - DRIVE_RPM - }; - Drive chassisLeft( {-20, -17, 8}, {12, 1, -4}, @@ -45,15 +37,43 @@ namespace globals { 0.75 ); - // pros::Motor cata_left(15, MOTOR_GEAR_100, true); - // pros::Motor cata_right(13, MOTOR_GEAR_100, false); + lemlib::Drivetrain drivetrain(&leftMotors, // left motor group + &rightMotors, // right motor group + 10, // 10 inch track width + lemlib::Omniwheel::NEW_325, // using new 3.25" omnis + 360, // drivetrain rpm is 360 + 2 // chase power is 2. If we had traction wheels, it would have been 8 + ); - - // Electronics / Pneumatics / Sensors - // pros::Rotation enc_left(); - // pros::Rotation enc_right(); - // pros::Rotation enc_theta(); + // lateral motion controller + lemlib::ControllerSettings linearController(10, // proportional gain (kP) + 30, // derivative gain (kD) + 1, // small error range, in inches + 100, // small error range timeout, in milliseconds + 3, // large error range, in inches + 500, // large error range timeout, in milliseconds + 20 // maximum acceleration (slew) + ); - // Misc + // angular motion controller + lemlib::ControllerSettings angularController(2, // proportional gain (kP) + 10, // derivative gain (kD) + 1, // small error range, in degrees + 100, // small error range timeout, in milliseconds + 3, // large error range, in degrees + 500, // large error range timeout, in milliseconds + 20 // maximum acceleration (slew) + ); +// sensors for odometry +// note that in this example we use internal motor encoders, so we don't pass vertical tracking wheels + lemlib::OdomSensors sensors(nullptr, // vertical tracking wheel 1, set to nullptr as we don't have one + nullptr, // vertical tracking wheel 2, set to nullptr as we don't have one + &horizontal, // horizontal tracking wheel 1 + nullptr, // horizontal tracking wheel 2, set to nullptr as we don't have a second one + &imu // inertial sensor + ); + + // create the chassis + lemlib::Chassis chassis(drivetrain, linearController, angularController, sensors); } \ No newline at end of file