mirror of
https://github.com/brendanhaines/mecanum.git
synced 2024-12-25 18:38:12 -07:00
makes rudder turn robot
This commit is contained in:
parent
37719b4889
commit
be2130610c
|
@ -7,6 +7,7 @@
|
|||
|
||||
// Tuning Parameters
|
||||
#define throScale 1
|
||||
#define ruddScale 1
|
||||
|
||||
// Wiring Parameters
|
||||
#define frontLeftChannel 4
|
||||
|
@ -83,6 +84,7 @@ public:
|
|||
double aile = InterLink->getAile();
|
||||
double elev = InterLink->getElev();
|
||||
double rudd = InterLink->getRudd();
|
||||
SmartDashboard::PutNumber( "Rudder", rudd );
|
||||
|
||||
double driveAngle = atan2( -aile, elev );
|
||||
SmartDashboard::PutNumber( "Drive Angle", driveAngle );
|
||||
|
@ -91,16 +93,16 @@ public:
|
|||
SmartDashboard::PutNumber( "Drive Speed", driveSpeed );
|
||||
|
||||
frontLeft->Set( (float)(
|
||||
throScale * frontLeftSpeed * driveSpeed * sin( frontLeftAngle-driveAngle )
|
||||
throScale * frontLeftSpeed * ( driveSpeed * sin( frontLeftAngle-driveAngle ) + ruddScale * rudd )
|
||||
) );
|
||||
backLeft->Set( (float)(
|
||||
throScale * backLeftSpeed * driveSpeed * sin( backLeftAngle-driveAngle )
|
||||
throScale * backLeftSpeed * ( driveSpeed * sin( backLeftAngle-driveAngle ) + ruddScale * rudd )
|
||||
) );
|
||||
frontRight->Set( (float)(
|
||||
throScale * frontRightSpeed * driveSpeed * sin( frontRightAngle-driveAngle )
|
||||
throScale * frontRightSpeed * ( driveSpeed * sin( frontRightAngle-driveAngle ) + ruddScale * rudd )
|
||||
) );
|
||||
backRight->Set( (float)(
|
||||
throScale * backRightSpeed * driveSpeed * sin( backRightAngle-driveAngle )
|
||||
throScale * backRightSpeed * ( driveSpeed * sin( backRightAngle-driveAngle ) + ruddScale * rudd )
|
||||
) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user