Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   WCD vs. Swerve (http://www.chiefdelphi.com/forums/showthread.php?t=98833)

Siri 31-12-2011 17:56

Re: WCD vs. Swerve
 
Thanks! I'll show your code to our programmers. I don't understand the coding (we use LabVIEW and I'm not a programmer), but the idea's really intriguing. The video would also be amazingly helpful. Thanks so much.

JamesTerm 02-01-2012 15:30

Re: WCD vs. Swerve
 
Quote:

Originally Posted by JamesTerm (Post 1094883)
Pause in the code? I think I may throw an idea to you that can help with that! First let me show you my code snip of what I do here:

I have updated the code to support unlimited swivel movement here:
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();
                //This is normalized implicitly
                const double LastSwivelDirection=Swivel.GetPos_m();
                double DistanceToIntendedSwivel=fabs(NormalizeRotation2(LastSwivelDirection-SwivelDirection));

                if ((DistanceToIntendedSwivel>PI_2) ||
                        (Swivel.GetUsingRange() &&
                        ((SwivelDirection>Swivel.GetMaxRange()) || (SwivelDirection<Swivel.GetMinRange())))
                        )
                {
                        SwivelDirection=NormalizeRotation2(SwivelDirection+PI);
                        if (Swivel.GetUsingRange())
                        {
                                double TestIntendedFlipped=NormalizeRotation2(IntendedDirection+PI);
                                //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);
}

If anyone wants to see a new demo using unlimited swivel movement in the swivel angles let me know.

Siri: Our team is working on a new server for our web site... I am hoping they'll have this ready soon as I'll put that match (and the rest of them) on there.

Ether 02-01-2012 15:38

Re: WCD vs. Swerve
 

Quote:

Originally Posted by JamesTerm (Post 1095405)
If anyone wants to see a new demo using unlimited swivel movement in the swivel angles let me know.

I'd like to see it. Can you improve the resolution or make the image bigger so details can be seen?




JamesTerm 03-01-2012 14:45

Re: WCD vs. Swerve
 
Quote:

Originally Posted by Ether (Post 1095412)


I'd like to see it. Can you improve the resolution or make the image bigger so details can be seen?


I've over wrote the original demo (I didn't like it) so this link:
http://www.termstech.com/files/SwerveDriveDemo.wmv

Has the new changes.

Mike Soukup 03-01-2012 18:46

Re: WCD vs. Swerve
 
Quote:

Originally Posted by davidthefat (Post 1094844)
Just wondering, is there such thing as an "East Coast Drive"?

Yes, it's just a drive base with no appendages on top of it because all it's designed to do is play defense. Sorry Grady, I had to go there again. Those of you who have been around for a while will understand my humor. The rest will probably get upset.

JamesTerm 01-02-2016 10:45

Re: WCD vs. Swerve
 
Quote:

Originally Posted by Ether (Post 1092700)
If the wheel speeds and steering angles are not too far from an inverse kinematic solution, the following computation may be adequate to estimate vehicle behavior:

Code:

FWD = (sFR*cos(aFR)+sFL*cos(aFL)+sRL*cos(aRL)+sRR*cos(aRR))/4;

STR = (sFR*sin(aFR)+sFL*sin(aFL)+sRL*sin(aRL)+sRR*sin(aRR))/4;

omega = ((sFR*cos(atan2(W,L)+pi/2-aFR)+sFL*cos(atan2(-W,L)+pi/2-aFL)
+sRL*cos(atan2(-W,-L)+pi/2-aRL)+sRR*cos(atan2(W,-L)+pi/2-aRR))/4)/
(sqrt(L^2+W^2)/2);

... where:
L and W are wheelbase and trackwidth in inches

sFR, sFL, sRL, and sRR are wheel tangential speeds in feet/second

aFR, aFL, aRL, and aRR are wheel angles in radians clockwise from straight ahead

FWD and STR are vehicle velocity in feet/sec in the forward and strafe_right directions

and omega is the vehicle clockwise rotational velocity in radians/sec




Yeah... I realize this thread has been asleep for several years, but for the good of the group... I'd like ask and/or solve these equations (both kinematic and inverse kinematic) for 6 wheels. Where the 4 wheels work as they have before here using the same variables ability to change speed and angle direction, as well as other variables (e.g. wheelbase and trackwidth) as much as possible. But then have 2 extra wheels in the center... for my own requirements, I'd like the width distance between the center wheels to be a bit wider than the corner wheels... this helps minimize friction when it rotates, such a configuration of drive can be observed on say the Mars Curiosity drive, except the center wheels on this are fixed. That said... if it is easy to produce equations for center wheels fixed that would be nice to know, but ideally for the sake of having other 6 wheel drive solutions... if they can swerve as well that would be ideal set of equations to solve. Any feedback will be greatly appreciated... Thanks.


All times are GMT -5. The time now is 18:32.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi