Fixed a bug with how the controllers where being setup and added include paths to the pid_tuner and pid_input files, also fixed a bug where I forgot to setup the default constructor for all the new classes I made.
This commit is contained in:
1 parent
b7af93220d
commit
0e8b70cf39
8 files changed
+17
-10
No files matched your search
@@ -10,8 +10,8 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
inline pros::Controller master;
|
inline pros::Controller master(pros::E_CONTROLLER_MASTER);
|
||||||
inline pros::Controller slave;
|
inline pros::Controller slave(pros::E_CONTROLLER_PARTNER);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare mechinism motors
|
* Declare mechinism motors
|
||||||
@@ -23,7 +23,7 @@ inline pros::Motor arm({12});
|
|||||||
/**
|
/**
|
||||||
* Declare pistons here
|
* Declare pistons here
|
||||||
*/
|
*/
|
||||||
inline ez::Piston claw({'A',true});
|
inline ez::Piston claw({'G',true});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare sensors here
|
* Declare sensors here
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
|
|||||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "setup/initialize.hpp"
|
||||||
#include "EZ-Template/drive/drive.hpp"
|
#include "EZ-Template/drive/drive.hpp"
|
||||||
#include "EZ-Template/sdcard.hpp"
|
#include "EZ-Template/sdcard.hpp"
|
||||||
#include "EZ-Template/util.hpp"
|
#include "EZ-Template/util.hpp"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
|
|||||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "setup/initialize.hpp"
|
||||||
#include "EZ-Template/PID.hpp"
|
#include "EZ-Template/PID.hpp"
|
||||||
#include "EZ-Template/drive/drive.hpp"
|
#include "EZ-Template/drive/drive.hpp"
|
||||||
#include "pros/misc.h"
|
#include "pros/misc.h"
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
using namespace ez;
|
using namespace ez;
|
||||||
|
|
||||||
|
Pneumatics::Pneumatics(){}
|
||||||
|
|
||||||
void Pneumatics::control_piston(Pistons activePiston, ControlPeriod currPeriod, Controller currController, Buttons buttonUsed) {
|
void Pneumatics::control_piston(Pistons activePiston, ControlPeriod currPeriod, Controller currController, Buttons buttonUsed) {
|
||||||
|
|
||||||
if (currPeriod == ControlPeriod::driver) {
|
if (currPeriod == ControlPeriod::driver) {
|
||||||
@@ -19,10 +21,10 @@ void Pneumatics::control_piston(Pistons activePiston, ControlPeriod currPeriod,
|
|||||||
switch (buttonUsed)
|
switch (buttonUsed)
|
||||||
{
|
{
|
||||||
case Buttons::arrow_buttons:
|
case Buttons::arrow_buttons:
|
||||||
if (master.get_digital(DIGITAL_LEFT)) {
|
if (master.get_digital(DIGITAL_RIGHT)) {
|
||||||
claw.set(true);
|
claw.set(true);
|
||||||
}
|
}
|
||||||
else if (master.get_digital(DIGITAL_RIGHT)) {
|
else if (master.get_digital(DIGITAL_DOWN)) {
|
||||||
claw.set(false);
|
claw.set(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -59,10 +61,10 @@ void Pneumatics::control_piston(Pistons activePiston, ControlPeriod currPeriod,
|
|||||||
switch (buttonUsed)
|
switch (buttonUsed)
|
||||||
{
|
{
|
||||||
case Buttons::arrow_buttons:
|
case Buttons::arrow_buttons:
|
||||||
if (slave.get_digital(DIGITAL_LEFT)) {
|
if (slave.get_digital(DIGITAL_RIGHT)) {
|
||||||
claw.set(true);
|
claw.set(true);
|
||||||
}
|
}
|
||||||
else if (slave.get_digital(DIGITAL_RIGHT)) {
|
else if (slave.get_digital(DIGITAL_DOWN)) {
|
||||||
claw.set(false);
|
claw.set(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using namespace ez;
|
using namespace ez;
|
||||||
|
|
||||||
|
ArmMech::ArmMech() {}
|
||||||
ArmMech::ArmMech(std::initializer_list<int> _armStates, int _numArmStates) {
|
ArmMech::ArmMech(std::initializer_list<int> _armStates, int _numArmStates) {
|
||||||
armStates = _armStates;
|
armStates = _armStates;
|
||||||
numArmStates = _numArmStates;
|
numArmStates = _numArmStates;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using namespace ez;
|
using namespace ez;
|
||||||
|
|
||||||
|
LiftMech::LiftMech() {}
|
||||||
LiftMech::LiftMech(std::initializer_list<int> _liftStates, int _numLiftStates) {
|
LiftMech::LiftMech(std::initializer_list<int> _liftStates, int _numLiftStates) {
|
||||||
liftStates = _liftStates;
|
liftStates = _liftStates;
|
||||||
numLiftStates = _numLiftStates;
|
numLiftStates = _numLiftStates;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using namespace ez;
|
using namespace ez;
|
||||||
|
|
||||||
|
WristMech::WristMech(){}
|
||||||
WristMech::WristMech(std::initializer_list<int> _wristStates, int _numWristStates) {
|
WristMech::WristMech(std::initializer_list<int> _wristStates, int _numWristStates) {
|
||||||
wristStates = _wristStates;
|
wristStates = _wristStates;
|
||||||
numWristStates = _numWristStates;
|
numWristStates = _numWristStates;
|
||||||
|
|||||||
+3
-3
@@ -9,8 +9,8 @@ WristMech wristObj;
|
|||||||
// Chassis constructor
|
// Chassis constructor
|
||||||
ez::Drive chassis(
|
ez::Drive chassis(
|
||||||
// These are your drive motors, the first motor is used for sensing!
|
// These are your drive motors, the first motor is used for sensing!
|
||||||
{-1, -2}, // Left Chassis Ports (negative port will reverse it!)
|
{12, 14}, // Left Chassis Ports (negative port will reverse it!)
|
||||||
{3, 4}, // Right Chassis Ports (negative port will reverse it!)
|
{-11, -13}, // Right Chassis Ports (negative port will reverse it!)
|
||||||
|
|
||||||
21, // IMU Port
|
21, // IMU Port
|
||||||
3.25, // Wheel Diameter (Remember, 4" wheels without screw holes are actually 4.125!)
|
3.25, // Wheel Diameter (Remember, 4" wheels without screw holes are actually 4.125!)
|
||||||
@@ -284,7 +284,7 @@ void opcontrol() {
|
|||||||
|
|
||||||
// Call custom drive functions here
|
// Call custom drive functions here
|
||||||
pistonControl.control_piston(Pistons::claw_piston, ControlPeriod::driver,
|
pistonControl.control_piston(Pistons::claw_piston, ControlPeriod::driver,
|
||||||
Controller::master, Buttons::arrow_buttons);
|
Controller::slave, Buttons::arrow_buttons);
|
||||||
|
|
||||||
// chassis.opcontrol_tank(); // Tank control
|
// chassis.opcontrol_tank(); // Tank control
|
||||||
chassis.opcontrol_arcade_standard(ez::SPLIT); // Standard split arcade
|
chassis.opcontrol_arcade_standard(ez::SPLIT); // Standard split arcade
|
||||||
|
|||||||
Reference in new issue
Block a user