|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#61
|
||||
|
||||
|
Re: WCD vs. Swerve
Just to be clear: There is a divide-by-4 (which divides all 4 terms) in the original equations I posted:
Quote:
|
|
#62
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
So I do this Code:
//const double R = sqrt((L*L)+(W*W)); const double R = GetWheelDimensions().length(); double RCW=GetAngularVelocity(); //in radians double RPS=RCW / Pi2; RCW=RPS * (PI * R); //R is really diameter //and this: AngularVelocity=(omega / (PI * D)) * Pi2; http://www.termstech.com/files/SwerveDriveDemo2.wmv I was able to use similar equations for the tank drive: Code:
m_LeftLinearVelocity = FWD + RCW; m_RightLinearVelocity = FWD - RCW; //const double FWD = (LeftLinearVelocity*cos(1.0)+RightLinearVelocity*cos(1.0))/2.0; const double FWD = (LeftLinearVelocity + RightLinearVelocity) / 2.0; //const double STR = (LeftLinearVelocity*sin(0.0)+ RightLinearVelocity*sin(0.0))/2.0; const double STR = 0.0; const double omega = ((LeftLinearVelocity) + (RightLinearVelocity*-1))/2.0; |
|
#63
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
Quote:
More: Team 1640's LogoMotion Drive Train Last edited by Siri : 30-12-2011 at 12:41. Reason: fixed the link |
|
#64
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
It seems like that swerve-drive teams are of a rare breed. ![]() |
|
#65
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
Couple of questions: 1) why did you restrict steering to 270 degrees 2) it would be helpful if you would add some sort of indicator on each wheel to show which direction it is spinning*. * yes, I see the red and green. these indicate which is the forward and reverse direction for the wheel, not which way the wheel is actually spinning at the moment. |
|
#66
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
As for direction of the wheels there are treads " <-- that rotate where height is portraited by white on top and gradient to dark grey on bottom. Unfortunately the wmv quality makes this difficult to see... I should put the mp4 of this on you tube at some point. |
|
#67
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
http://www.chiefdelphi.com/forums/sh...9&postcount=63 others here: http://www.chiefdelphi.com/forums/sh...75&postcount=3 |
|
#68
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
Who knows... maybe in 2012 we'll be on the same alliance. ![]() |
|
#69
|
|||
|
|||
|
Re: WCD vs. Swerve
And that's what I love about FIRST.
![]() |
|
#70
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
![]() |
|
#71
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
www.termstech.com/files/WCDvsSwerve.wmv I apologize on the low framerate... I REALLY need to find a free way to share high quality media (The original is AVCHD 1080i)... I'll look into this soon. Check out towards the last 15 seconds when we attempt to block you for minibot deployment... cool stuff. ![]() |
|
#72
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
|
|
#73
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
James: Thanks, I was hoping you had the video to share. We don't have any championship video. Could I try to find a way to get the higher resolution version? |
|
#74
|
|||
|
|||
|
Re: WCD vs. Swerve
Just wondering, is there such thing as an "East Coast Drive"?
|
|
#75
|
||||
|
||||
|
Re: WCD vs. Swerve
Quote:
Code:
void Swerve_Robot::InterpolateThrusterChanges(Vec2D &LocalForce,double &Torque,double dTime_s)
{
//Now the new UpdateVelocities was just called... work with these intended velocities
for (size_t i=0;i<4;i++)
{
const double IntendedDirection=GetIntendedVelocitiesFromIndex(i+4);
double SwivelDirection=IntendedDirection; //this is either the intended direction or the reverse of it
const Ship_1D &Swivel=m_DrivingModule[i]->GetSwivel();
const double LastSwivelDirection=Swivel.GetPos_m();
double DistanceToIntendedSwivel=LastSwivelDirection-SwivelDirection;
NormalizeRotation(DistanceToIntendedSwivel);
DistanceToIntendedSwivel=fabs(DistanceToIntendedSwivel);
if ((DistanceToIntendedSwivel>PI_2) || (SwivelDirection>Swivel.GetMaxRange()) || (SwivelDirection<Swivel.GetMinRange()) )
{
SwivelDirection+=PI;
NormalizeRotation(SwivelDirection);
double TestIntendedFlipped=IntendedDirection+PI;
NormalizeRotation(TestIntendedFlipped);
//If we flipped because of a huge delta check that the reverse position is in range... and flip it back if it exceed the range
if ((SwivelDirection>Swivel.GetMaxRange()) || (SwivelDirection<Swivel.GetMinRange()) ||
(TestIntendedFlipped>Swivel.GetMaxRange()) || (TestIntendedFlipped<Swivel.GetMinRange()))
{
SwivelDirection+=PI;
NormalizeRotation(SwivelDirection);
}
}
//Note the velocity is checked once before the time change here, and once after for the current
//Only apply swivel adjustments if we have significant movement (this matters in targeting tests)
if ((fabs(LocalForce[0])>1.5)||(fabs(LocalForce[1])>1.5)||(fabs(m_DrivingModule[i]->GetDrive().GetPhysics().GetVelocity()) > 0.05))
m_DrivingModule[i]->SetIntendedSwivelDirection(SwivelDirection);
const double IntendedSpeed=GetIntendedVelocitiesFromIndex(i);
//To minimize error only apply the Y component amount to the velocity
//The less the difference between the current and actual swivel direction the greater the full amount can be applied
double VelocityToUse=cos(DistanceToIntendedSwivel)*IntendedSpeed;
m_DrivingModule[i]->SetIntendedDriveVelocity(VelocityToUse);
m_DrivingModule[i]->TimeChange(dTime_s);
const double CurrentVelocity=m_DrivingModule[i]->GetDrive().GetPhysics().GetVelocity();
const double CurrentSwivelDirection=Swivel.GetPos_m();
//if (i==0)
// DOUT4("S= %f %f V= %f %f",CurrentSwivelDirection,SwivelDirection,CurrentVelocity,VelocityToUse);
//Now to grab and update the actual swerve velocities
//Note: using GetIntendedVelocities() is a lesser stress for debug purposes
#if 1
m_Swerve_Robot_Velocities.Velocity.AsArray[i+4]=CurrentSwivelDirection;
m_Swerve_Robot_Velocities.Velocity.AsArray[i]=CurrentVelocity;
#else
m_Swerve_Robot_Velocities=GetIntendedVelocities();
#endif
}
__super::InterpolateThrusterChanges(LocalForce,Torque,dTime_s);
}
Code:
//To minimize error only apply the Y component amount to the velocity //The less the difference between the current and actual swivel direction the greater the full amount can be applied double VelocityToUse=cos(DistanceToIntendedSwivel)*IntendedSpeed; Quote:
![]() I'll keep you posted... I WILL get this to you somehow! ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|