mirror of
https://github.com/brendanhaines/mecanum.git
synced 2024-11-09 21:14:51 -07:00
should fix controllability from driver station of enabling/disabling buddy box
This commit is contained in:
parent
82ba59546d
commit
266b38afce
|
@ -66,6 +66,9 @@ public:
|
||||||
SlaveInterLink = new InterLinkElite( Slave_InterLink_ID );
|
SlaveInterLink = new InterLinkElite( Slave_InterLink_ID );
|
||||||
ds = DriverStation::GetInstance();
|
ds = DriverStation::GetInstance();
|
||||||
lw = LiveWindow::GetInstance();
|
lw = LiveWindow::GetInstance();
|
||||||
|
|
||||||
|
SmartDashboard::PutBoolean( "Buddy Box Enabled", false );
|
||||||
|
SmartDashboard::PutBoolean( "Slave Controls Speed", false );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
|
@ -89,10 +92,10 @@ public:
|
||||||
{
|
{
|
||||||
double throttle;
|
double throttle;
|
||||||
|
|
||||||
bool BuddyBoxEnabled = SmartDashboard::GetBoolean( "Buddy Box Enabled" , false);
|
bool BuddyBoxEnabled = SmartDashboard::GetBoolean( "Buddy Box Enabled" );
|
||||||
bool SlaveInControl = MasterInterLink->GetCh5();
|
bool SlaveInControl = MasterInterLink->GetCh5();
|
||||||
SmartDashboard::PutBoolean( "Slave In Control", SlaveInControl );
|
SmartDashboard::PutBoolean( "Slave In Control", SlaveInControl );
|
||||||
bool SlaveControlsSpeed = SmartDashboard::GetBoolean( "Slave Controls Speed", false );
|
bool SlaveControlsSpeed = SmartDashboard::GetBoolean( "Slave Controls Speed" );
|
||||||
|
|
||||||
if( BuddyBoxEnabled && SlaveInControl ) ActiveInterLink = SlaveInterLink;
|
if( BuddyBoxEnabled && SlaveInControl ) ActiveInterLink = SlaveInterLink;
|
||||||
else ActiveInterLink = MasterInterLink;
|
else ActiveInterLink = MasterInterLink;
|
||||||
|
@ -105,9 +108,9 @@ public:
|
||||||
double elev = ActiveInterLink->getElev();
|
double elev = ActiveInterLink->getElev();
|
||||||
double rudd = ActiveInterLink->getRudd();
|
double rudd = ActiveInterLink->getRudd();
|
||||||
SmartDashboard::PutNumber( "Rudder", rudd );
|
SmartDashboard::PutNumber( "Rudder", rudd );
|
||||||
SmartDashboard::PutNumber( "Throttle", ch6 );
|
SmartDashboard::PutNumber( "Throttle", throttle );
|
||||||
|
|
||||||
throScale = ch6 + 1;
|
throScale = throttle + 1;
|
||||||
|
|
||||||
double driveAngle = atan2( -aile*aileScale, elev*elevScale );
|
double driveAngle = atan2( -aile*aileScale, elev*elevScale );
|
||||||
SmartDashboard::PutNumber( "Drive Angle", driveAngle );
|
SmartDashboard::PutNumber( "Drive Angle", driveAngle );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user