Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:FRC2994/FRC2994

  • Loading branch information...
commit abc161e02839bfbed26a661ebf76778dd4f9a647 2 parents dd538c5 + 96b6bec
@JackMc JackMc authored
View
235 Code/2012-Competition/CameraLight.cpp
@@ -0,0 +1,235 @@
+#include "CameraLight.h"
+
+/**
+ * Create an instance of a Solenoid controlled LED camera light using the default
+ * module
+ * @param innerLED The channel number of the solenoid that controls the inner ring.
+ * @param outerLED The channel number of the solenoid that controls the outer ring.
+ */
+SolenoidCameraLight::SolenoidCameraLight(UINT32 innerLED, UINT32 outerLED)
+{
+ m_innerLED = new Solenoid(innerLED);
+ m_outerLED = new Solenoid(outerLED);
+ m_allocatedLED = true;
+
+ Off();
+}
+
+/**
+ * Create an instance of a Solenoid controlled LED camera light using the given
+ * module
+ * @param innerLEDModuleNumber The solenoid module where the inner ring's
+ * solenoid is located.
+ * @param innerLED The channel number of the solenoid that controls the inner ring.
+ * @param innerLEDModuleNumber The solenoid module where the outer ring's
+ * solenoid is located.
+ * @param outerLED The channel number of the solenoid that controls the outer ring.
+ */
+SolenoidCameraLight::SolenoidCameraLight(UINT8 innerLEDModuleNumber, UINT32 innerLED,
+ UINT8 outerLEDModuleNumber, UINT32 outerLED)
+{
+ m_innerLED = new Solenoid(innerLEDModuleNumber, innerLED);
+ m_outerLED = new Solenoid(innerLEDModuleNumber, outerLED);
+ m_allocatedLED = true;
+
+ Off();
+}
+
+/**
+ * Create an instance of a Solenoid controlled LED camera light using previously
+ * allocated Solenoid objects.
+ * @param innerLED A pointer to the Solenoid object that controls the inner ring.
+ * @param outerLED A pointer to the Solenoid object that controls the outer ring.
+ */
+SolenoidCameraLight::SolenoidCameraLight(Solenoid *innerLED, Solenoid *outerLED)
+{
+ m_innerLED = innerLED;
+ m_outerLED = outerLED;
+ m_allocatedLED = false;
+
+ Off();
+}
+
+/**
+ * Create an instance of a Solenoid controlled LED camera light using previously
+ * allocated Solenoid objects.
+ * @param innerLED A reference to the Solenoid object that controls the inner ring.
+ * @param outerLED A reference to the Solenoid object that controls the outer ring.
+ */
+SolenoidCameraLight::SolenoidCameraLight(Solenoid &innerLED, Solenoid &outerLED)
+{
+ m_innerLED = &innerLED;
+ m_outerLED = &outerLED;
+ m_allocatedLED = false;
+
+ Off();
+}
+
+/**
+ * Destructor for the Solenoid controlled LED camera light.
+ * Turn off the LEDs, and if Solenoid objects were allocated for the inner and outer
+ * LEDs, delete them now.
+ */
+SolenoidCameraLight::~SolenoidCameraLight()
+{
+ Off();
+
+ if (m_allocatedLED)
+ {
+ delete m_innerLED;
+ delete m_outerLED;
+ }
+}
+
+/**
+ * Set the camera light to the given brightness.
+ * @param bright The brightness of the camera light, as a percentage of maximum brightness.
+ * For the Solenoid camera light, either LED ring can be fully on or off, in any combination.
+ * If bright is set to 0, both LED rings are turned off.
+ * If bright is set to 100, both LED rings are turned on.
+ * Intermediate values of bright are implemented by turing only one of the LED rings on.
+ * Note that the outer ring is a bit brighter than the inner ring.
+ */
+void SolenoidCameraLight::Set(UINT32 bright)
+{
+ if (bright == kDark) {
+ m_innerLED->Set(false);
+ m_outerLED->Set(false);
+ return;
+ }
+
+ if (bright >= kFullBrightness) {
+ m_innerLED->Set(true);
+ m_outerLED->Set(true);
+ return;
+ }
+
+ if ((bright > kDark) && (bright <= kThreshold1)) {
+ m_innerLED->Set(true);
+ m_outerLED->Set(false);
+ return;
+ }
+
+ if ((bright > kThreshold1) && (bright <= kThreshold2)) {
+ m_innerLED->Set(false);
+ m_outerLED->Set(true);
+ return;
+ }
+}
+/**
+ * Set the camera light fully on or fully off.
+ * These methods are provided for convenience when simple on/off behaviour is required.
+ * These methods just call Set() with the appropriate brightness value.
+ */
+void SolenoidCameraLight::On()
+{
+ Set(kFullBrightness);
+}
+
+void SolenoidCameraLight::Off()
+{
+ Set(kDark);
+}
+
+
+/**
+ * Create an instance of a GPIO controlled LED camera light using the default
+ * module
+ * @param innerLED The channel number of the GPIO that controls the inner ring.
+ */
+GPIOCameraLight::GPIOCameraLight(UINT32 LED)
+{
+ m_LED = new DigitalOutput(LED);
+ m_allocatedLED = true;
+
+ Off();
+}
+
+/**
+ * Create an instance of a GPIO controlled LED camera light using the given
+ * module
+ * @param LEDModuleNumber The digital module where the inner ring's
+ * solenoid is located.
+ * @param LED The channel number of the GPIO that controls the inner ring.
+ */
+GPIOCameraLight::GPIOCameraLight(UINT8 LEDModuleNumber, UINT32 LED)
+{
+ m_LED = new DigitalOutput(LEDModuleNumber, LED);
+ m_allocatedLED = true;
+
+ Off();
+}
+
+/**
+ * Create an instance of a GPIO controlled LED camera light using a previously
+ * allocated DigitalOutput object.
+ * @param innerLED A pointer to the DigitalOutput object that controls the inner ring.
+ * @param outerLED A pointer to the Solenoid object that controls the outer ring.
+ */
+GPIOCameraLight::GPIOCameraLight(DigitalOutput *LED)
+{
+ m_LED = LED;
+ m_allocatedLED = false;
+
+ Off();
+}
+
+/**
+ * Create an instance of a GPIO controlled LED camera light using a previously
+ * allocated GPIO object.
+ * @param innerLED A reference to the DigitalOutput object that controls the inner ring.
+ */
+GPIOCameraLight::GPIOCameraLight(DigitalOutput &LED)
+{
+ m_LED = &LED;
+ m_allocatedLED = false;
+
+ Off();
+}
+
+/**
+ * Destructor for the GPIO controlled LED camera light.
+ * Turn off the LEDs, and if a DigitalOutput object was allocated for the
+ * LED, delete it now.
+ */
+GPIOCameraLight::~GPIOCameraLight()
+{
+ Off();
+
+ if (m_allocatedLED)
+ {
+ delete m_LED;
+ }
+}
+
+/**
+ * Set the camera light to the given brightness.
+ * @param bright The brightness of the camera light, as a percentage of maximum brightness.
+ * For the GPIO camera light, both LED rings are either fully on or fully off. So a brightness
+ * of 0 turns off both LED rings, and any other value turns on both LED rings.
+ */
+void GPIOCameraLight::Set(UINT32 bright)
+{
+ if (bright == kDark) {
+ m_LED->Set(false);
+ return;
+ } else {
+ m_LED->Set(true);
+ return;
+ }
+}
+
+/**
+ * Set the camera light fully on or fully off.
+ * These methods are provided for convenience when simple on/off behaviour is required.
+ * These methods just call Set() with the appropriate brightness value.
+ */
+void GPIOCameraLight::On()
+{
+ Set(kFullBrightness);
+}
+
+void GPIOCameraLight::Off()
+{
+ Set(kDark);
+}
View
92 Code/2012-Competition/CameraLight.h
@@ -0,0 +1,92 @@
+#ifndef CAMERALIGHT_H_
+#define CAMERALIGHT_H_
+
+#include "Solenoid.h"
+#include "DigitalOutput.h"
+
+/**
+ * CameraLight class.
+ * This class is used to control the two concentric LED light rings
+ * surrounding the vision system camera's lens.
+ *
+ * There are different hardware configurations possible, so a base
+ * class is used to define a standard interface, and two derived
+ * classes are used to implement the hardware specific code.
+ * Calling code would normally allocate one of the derived classes,
+ * but manipulate the object via base class pointers.
+ *
+ * The base class is called CameraLight.
+ *
+ * The first derived class is SolenoidCameraLight. This class assumes
+ * the inner and outer LED rings are each controlled by a separate
+ * solenoid output.
+ *
+ * The second derived class is GPIOCameraLight. This class assumes
+ * the inner and outer LED rings are both controlled by a single
+ * GPIO.
+ *
+ */
+
+class CameraLight
+{
+public:
+ typedef enum {
+ kDark = 0,
+ kFullBrightness = 100
+ } LEDBrightness;
+
+ virtual void Set(UINT32 bright = kFullBrightness) = 0;
+ virtual void On() = 0;
+ virtual void Off() = 0;
+
+};
+
+class SolenoidCameraLight: public CameraLight
+{
+public:
+ // Brightness levels supported by Solenoid controlled
+ // camera LEDs.
+ typedef enum {
+ kThreshold1 = 25,
+ kThreshold2 = 50
+ };
+
+ SolenoidCameraLight(UINT32 innerLED, UINT32 outerLED);
+ SolenoidCameraLight(UINT8 innerLEDModuleNumber, UINT32 innerLED,
+ UINT8 outerLEDModuleNumber, UINT32 outerLED);
+ SolenoidCameraLight(Solenoid *innerLED, Solenoid *outerLED);
+ SolenoidCameraLight(Solenoid &innerLED, Solenoid &outerLED);
+
+ virtual ~SolenoidCameraLight();
+
+ void Set(UINT32 bright = kFullBrightness);
+ void On();
+ void Off();
+
+private:
+ Solenoid *m_innerLED;
+ Solenoid *m_outerLED;
+ bool m_allocatedLED;
+};
+
+class GPIOCameraLight: public CameraLight
+{
+public:
+ GPIOCameraLight(UINT32 LED);
+ GPIOCameraLight(UINT8 LEDModuleNumber, UINT32 LED);
+ GPIOCameraLight(DigitalOutput *LED);
+ GPIOCameraLight(DigitalOutput &LED);
+
+ virtual ~GPIOCameraLight();
+
+ void Set(UINT32 bright = kFullBrightness);
+ void On();
+ void Off();
+
+private:
+ DigitalOutput *m_LED;
+ bool m_allocatedLED;
+};
+
+
+#endif
View
142 Code/2012-Competition/DashboardDataSender.cpp
@@ -1,142 +0,0 @@
-#include "DashboardDataSender.h"
-#include "WPILib.h"
-
-/**
- * Send data to the dashboard.
- * This class sends two types of data to the dashboard program:
- * 1. Data representing all the ports on the robot
- * 2. Camera tracking data so the dashboard can annotate the video stream with
- * target information.
- */
-DashboardDataSender::DashboardDataSender()
-{
- // these timers make sure that the data is not sent to the dashboard more
- // than 10 times per second for efficiency.
- IOTimer = new Timer();
- IOTimer->Start();
-}
-
-/**
- * Send the vision tracking data.
- * Sends the vision information to the dashboard so that the images will be annotated
- * and the graphs will operate.
- */
-
-/**
- * Send IO port data to the dashboard.
- * Send data representing the output of all the IO ports on the cRIO to the dashboard.
- * This is probably not the best data to send for your robot. Better would be higher
- * level information like arm angle or collector status. But this is a sample and you're
- * free to modify it. Be sure to make the corresponding changes in the LabVIEW example
- * dashboard program running on your driver station.
- */
-void DashboardDataSender::sendIOPortData(Solenoid * sol8) {
- if (IOTimer->Get() < 0.1)
- return;
- IOTimer->Reset();
- Dashboard &dash = DriverStation::GetInstance()->GetLowPriorityDashboardPacker();
- unsigned char solBuf = 0;
- dash.AddCluster();
- {
- dash.AddCluster();
- { //analog modules
- dash.AddCluster();
- {
- for (int i = 1; i <= 8; i++) {
- dash.AddFloat((float) AnalogModule::GetInstance(1)->GetAverageVoltage(i));
- dash.AddFloat((float) i * 5.0 / 8.0);
- }
- }
- dash.FinalizeCluster();
-// dash.AddCluster();
-// {
-// for (int i = 1; i <= 8; i++) {
-// dash.AddFloat((float) AnalogModule::GetInstance(2)->GetAverageVoltage(i));
-// }
-// }
-// dash.FinalizeCluster();
- }
- dash.FinalizeCluster();
-
- dash.AddCluster();
- { //digital modules
- dash.AddCluster();
- {
- dash.AddCluster();
- {
- int module = 2;
- UINT16 value = 0;
- dash.AddU8(DigitalModule::GetInstance(module)->GetRelayForward());
- dash.AddU8(DigitalModule::GetInstance(module)->GetRelayReverse());
-
- //dash.AddU16((short)DigitalModule::GetInstance(module)->GetDIO());
- //dash.AddU16((short) 0xAAAA);
- for (int c = 1 ; c < 15 ; c++)
- {
- value |= (DigitalModule::GetInstance(module)->GetDIO(c) << (c - 1));
- }
- dash.AddU16((short)value);
-
- //dash.AddU16((short)DigitalModule::GetInstance(module)->GetDIODirection());
- //dash.AddU16((short) 0x7777);
- for (int c = 1 ; c < 15 ; c++)
- {
- value |= (DigitalModule::GetInstance(module)->GetDIODirection(c) << (c - 1));
- }
- dash.AddU16((short)value);
- dash.AddCluster();
- {
- for (int i = 1; i <= 10; i++) {
- dash.AddU8((unsigned char) DigitalModule::GetInstance(module)->GetPWM(i));
- //dash.AddU8((unsigned char) (i-1) * 255 / 9);
- }
- }
- dash.FinalizeCluster();
- }
- dash.FinalizeCluster();
- }
- dash.FinalizeCluster();
-
-// dash.AddCluster();
-// {
-// dash.AddCluster();
-// {
-// int module = 6;
-// dash.AddU8(DigitalModule::GetInstance(module)->GetRelayForward());
-// dash.AddU8(DigitalModule::GetInstance(module)->GetRelayForward());
-// dash.AddU16((short)DigitalModule::GetInstance(module)->GetDIO());
-// dash.AddU16(DigitalModule::GetInstance(module)->GetDIODirection());
-// dash.AddCluster();
-// {
-// for (int i = 1; i <= 10; i++) {
-// dash.AddU8((unsigned char) DigitalModule::GetInstance(module)->GetPWM(i));
-// //dash.AddU8((unsigned char) i * 255 / 10);
-// }
-// }
-// dash.FinalizeCluster();
-// }
-// dash.FinalizeCluster();
-// }
-// dash.FinalizeCluster();
- }
- dash.FinalizeCluster();
-
- // Can't read solenoids without an instance of the object
- // dash.AddU8((char) 0);
-
- // Get the solenoids as an 8-bit int
-// dash.AddCluster();
-// {
-//// for(unsigned i=1;i<8;i++) {
-//// solBuf |= (Solenoid(i).Get() << (i-1));
-//// }
-// solBuf |= sol8->Get() << 7;
-//// dash.AddU8(0x55);
-// dash.AddU8(solBuf);
-// }
-// dash.FinalizeCluster();
-
- }
- dash.FinalizeCluster();
- dash.Finalize();
-}
View
28 Code/2012-Competition/DashboardDataSender.h
@@ -1,28 +0,0 @@
-#ifndef __DashboardDataFormat_h__
-#define __DashboardDataFormat_h__
-
-#include <vector>
-#include "WPILib.h"
-
-class Timer;
-
-/**
- * This class is just an example of one way you could organize the data that you want
- * to send to the dashboard. The PackAndSend method does all the work. You could
- * put the packing code directly in your code, but this model protects you from
- * packing data in the wrong order throughout your code.
- *
- * The data and the format of this structure are just an example. It is written to
- * match the initial data format expected by the LabVIEW Dashboard project. Feel free
- * to add data elements or remove them. Just remember to make any changes consistently
- * between the LabVIEW "Dashboard Datatype" and the data that gets packed by this class.
- */
-class DashboardDataSender
-{
-public:
- DashboardDataSender();
- void sendIOPortData(Solenoid * sol8);
-private:
- Timer *IOTimer;
-};
-#endif // __DashboardDataFormat_h__
View
83 Code/2012-Competition/Robot.cpp
@@ -76,15 +76,6 @@
// Solenoids
#define SHOOTER_ELEVATION_SOLENOID 1
-// Driverstation Digital IO Assignments
-#define DRIVE_TYPE 1
-#define ARCADE_DRIVE_JOYSTICK 2
-#define INITIAL_POSITION_0 3
-#define INITIAL_POSITION_1 4
-#define BASKET_CHOICE_0 5
-#define BASKET_CHOICE_1 6
-#define DEBUG 8
-
// Gamepad (real) button assignments
#define SHOOT 1
#define LOW 2
@@ -190,26 +181,26 @@ typedef struct
} step_speed;
const shooter_table m_lowerBasketTable[SHOOTER_TABLE_ENTRIES] =
- {{5.0, 0.4, 0.4, 0, 0},
- {10.0, 0.4, 0.4, 0, 0},
- {15.0, 0.4, 0.4, 0, 0},
- {20.0, 0.4, 0.4, 0, 0},
- {25.0, 0.4, 0.4, 0, 0},
+ {{5.0, 0.45, 0.45, 0, 0}, // measured
+ {10.0, 0.45, 0.45, 0, 0},
+ {15.0, 0.45, 0.45, 0, 0},
+ {20.0, 0.45, 0.45, 0, 0},
+ {25.0, 0.45, 0.45, 0, 0},
};
const shooter_table m_middleBasketTable[SHOOTER_TABLE_ENTRIES] =
- {{5.0, 0.4, 0.4, 0, 0},
- {10.0, 0.4, 0.4, 0, 0},
- {15.0, 0.4, 0.4, 0, 0},
- {20.0, 0.4, 0.4, 0, 0},
- {25.0, 0.4, 0.4, 0, 0},
+ {{5.0, 0.55, 0.55, 0, 0}, // measured
+ {10.0, 0.60, 0.60, 0, 0}, // measured
+ {15.0, 0.70, 0.70, 0, 0},
+ {20.0, 0.80, 0.80, 0, 0}, // measured
+ {25.0, 0.90, 0.90, 0, 0},
};
const shooter_table m_upperBasketTable[SHOOTER_TABLE_ENTRIES] =
- {{5.0, 0.4, 0.4, 0, 0},
- {10.0, 0.4, 0.4, 0, 0},
- {15.0, 0.4, 0.4, 0, 0},
- {20.0, 0.4, 0.4, 0, 0},
- {25.0, 0.4, 0.4, 0, 0},
+ {{5.0, 0.60, 0.60, 0, 0},
+ {10.0, 0.70, 0.70, 0, 0}, // measured
+ {15.0, 0.75, 0.75, 0, 0}, // measured
+ {20.0, 0.875, 0.875, 0, 0},
+ {25.0, 1.00, 1.00, 0, 0}, // measured
};
const shooter_speed m_autoShootTable[SHOOTER_HEIGHT_ARRAY_SIZE][NUM_START_POSITION] =
@@ -273,7 +264,8 @@ class Robot2012 : public SimpleRobot
Encoder *topShooterEncoder;
// Encoder *shooterAzimuthEncoder;
MBUltrasonic *ultrasonicSensor;
- DigitalOutput *cameraLight;
+ Solenoid *cameraLight1;
+ Solenoid *cameraLight2;
// Motor Controllers
Jaguar *driveLeftMotor;
@@ -304,7 +296,7 @@ class Robot2012 : public SimpleRobot
DriverStation *ds;
Timer *ballCollectorTimer;
Compressor *compressor;
- Solenoid *shooterElevationValve;
+ // *shooterElevationValve;
Timer *cameraTimer;
Timer *ultrasonicTimer;
@@ -414,9 +406,9 @@ class Robot2012 : public SimpleRobot
shooterTopMotor = new Jaguar(TOP_SHOOTER_MOTOR);
shooterHelperMotor = new Relay(SHOOTER_FEED);
bottomShooterEncoder = new Encoder(BOTTOM_SHOOTER_ENCODER_A,
- BOTTOM_SHOOTER_ENCODER_A);
+ BOTTOM_SHOOTER_ENCODER_B);
topShooterEncoder = new Encoder(TOP_SHOOTER_ENCODER_A,
- TOP_SHOOTER_ENCODER_A);
+ TOP_SHOOTER_ENCODER_B);
// Complete the setup of the encoders and start them
leftDriveEncoder->SetDistancePerPulse(DRIVE_ENCODER_DISTANCE_PER_PULSE);
@@ -440,7 +432,7 @@ class Robot2012 : public SimpleRobot
topShooterEncoder->Start();
// Solenoid(s)
- shooterElevationValve = new Solenoid (SHOOTER_ELEVATION_SOLENOID);
+ //shooterElevationValve = new Solenoid (SHOOTER_ELEVATION_SOLENOID);
// Driver station I/O
ds = DriverStation::GetInstance();
@@ -449,7 +441,8 @@ class Robot2012 : public SimpleRobot
// Miscellaneous
compressor = new Compressor(PNEUMATIC_PRESSURE_SWITCH, COMPRESSOR);
- cameraLight = new DigitalOutput(CAMERA_LIGHT_ENABLE);
+ cameraLight1 = new Solenoid(1);
+ cameraLight2 = new Solenoid(2);
cameraTimer = new Timer();
ultrasonicTimer = new Timer();
ultrasonicSensor = new MBUltrasonic(ULTRASONIC_PING,
@@ -676,7 +669,7 @@ class Robot2012 : public SimpleRobot
(pressed == LeftJoystickButtonEvent(arm_downl))))
{
armUp = false;
- armMotor->Set(-1.0);
+ armMotor->Set(-0.2);
}
}
}
@@ -697,7 +690,7 @@ class Robot2012 : public SimpleRobot
{
high_gear = true;
leftShifter->SetAngle(SHIFTER_HIGH_GEAR);
- leftShifter->SetAngle(SHIFTER_HIGH_GEAR);
+ rightShifter->SetAngle(SHIFTER_HIGH_GEAR);
}
if (!m_ds->GetDigitalIn(DS_DRIVE_TYPE))
@@ -727,7 +720,7 @@ class Robot2012 : public SimpleRobot
((Servo::GetMaxAngle() - Servo::GetMinAngle()) / 2.0);
}
- joystickPosition = gamepad->GetRightX();
+ joystickPosition = gamepad->GetRightY();
if (joystickPosition > 0.5)
{
@@ -780,7 +773,7 @@ class Robot2012 : public SimpleRobot
}
else if (ds->GetDigitalIn(DS_USE_VISION_DISTANCE))
{
- cameraLight->Set(true);
+ //cameraLight->Set(true);
table->PutBoolean("getDistance", true);
}
else
@@ -799,7 +792,7 @@ class Robot2012 : public SimpleRobot
// button)
if (pressed == GamepadButtonEvent(low))
{
- m_targetBasketHeight = basket_low;
+ //m_targetBasketHeight = basket_low;
m_distance = SHORT_DISTANCE;
m_shootDataReady = true;
m_shootMode = manual;
@@ -807,7 +800,7 @@ class Robot2012 : public SimpleRobot
if (pressed == GamepadButtonEvent(medium))
{
- m_targetBasketHeight = basket_medium;
+ //m_targetBasketHeight = basket_medium;
m_distance = MEDIUM_DISTANCE;
m_shootDataReady = true;
m_shootMode = manual;
@@ -815,7 +808,7 @@ class Robot2012 : public SimpleRobot
if (pressed == GamepadButtonEvent(high))
{
- m_targetBasketHeight = basket_high;
+ //m_targetBasketHeight = basket_high;
m_distance = LONG_DISTANCE;
m_shootDataReady = true;
m_shootMode = manual;
@@ -850,21 +843,25 @@ class Robot2012 : public SimpleRobot
// Handle the DPad buttons (automatic mode basket select)
if (pressed == GamepadButtonEvent(basket_top))
{
+ m_targetBasketHeight = basket_high; // for manual mode
MakeAutoDistanceRequest(basket_high);
}
if (pressed == GamepadButtonEvent(basket_left))
{
+ m_targetBasketHeight = basket_medium; // for manual mode
MakeAutoDistanceRequest(basket_medium);
}
if (pressed == GamepadButtonEvent(basket_right))
{
+ m_targetBasketHeight = basket_medium; // for manual mode
MakeAutoDistanceRequest(basket_medium);
}
if (pressed == GamepadButtonEvent(basket_bottom))
{
+ m_targetBasketHeight = basket_low; // for manual mode
MakeAutoDistanceRequest(basket_low);
}
@@ -872,14 +869,14 @@ class Robot2012 : public SimpleRobot
{
dsLCD->PrintfLine(DriverStationLCD::kUser_Line2,"Setting up");
m_shooterElevationUp = true;
- shooterElevationValve->Set(m_shooterElevationUp);
+ //shooterElevationValve->Set(m_shooterElevationUp);
}
else if ((pressed == GamepadButtonEvent(elevation)) && m_shooterElevationUp)
{
dsLCD->PrintfLine(DriverStationLCD::kUser_Line2,"Setting down");
m_shooterElevationUp = false;
- shooterElevationValve->Set(m_shooterElevationUp);
+ //shooterElevationValve->Set(m_shooterElevationUp);
}
// Handle outstanding vision/ultrasonic distance requests
@@ -916,7 +913,7 @@ class Robot2012 : public SimpleRobot
m_distance = table->GetDouble("distance");
m_shootDataReady = true;
m_shootDataRequested = false;
- cameraLight->Set(false);
+ //cameraLight->Set(false);
}
}
else
@@ -1719,10 +1716,12 @@ class Robot2012 : public SimpleRobot
// Set the elevation to "down"
m_shooterElevationUp = false;
- shooterElevationValve->Set(m_shooterElevationUp);
+ //shooterElevationValve->Set(m_shooterElevationUp);
while (IsOperatorControl())
{
+ cameraLight1->Set(true);
+ cameraLight2->Set(true);
dsLCD->PrintfLine(DriverStationLCD::kUser_Line2, "l:%d r:%d", leftShifter->GetAngle(), rightShifter->GetAngle());
// Set debug flag
m_debug = m_ds->GetDigitalIn(DS_DEBUG);
@@ -1741,7 +1740,7 @@ class Robot2012 : public SimpleRobot
//robotDrive->ArcadeDrive(leftJoystick);
// Handle camera position change requests
- //HandleCameraServo();
+ HandleCameraServo();
// Process the shooter button and joystick inputs. This will result
if(m_debug)
Please sign in to comment.
Something went wrong with that request. Please try again.