Skip to content

Commit

Permalink
Merge pull request #294 from farmerbriantee/FinalUpdates
Browse files Browse the repository at this point in the history
Final updates
  • Loading branch information
farmerbriantee committed Jan 21, 2023
2 parents 402c82a + ce88486 commit b43182c
Show file tree
Hide file tree
Showing 30 changed files with 568 additions and 630 deletions.
1 change: 1 addition & 0 deletions SourceCode/AgIO/Source/AgIO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="AgIO_ico.ico" />
<None Include="btnImages\Nmea.png" />
<None Include="btnImages\ConS_ImplementAntenna.png" />
<None Include="btnImages\ScanNetwork.png" />
<None Include="btnImages\ToolAcceptChange.png" />
Expand Down
224 changes: 112 additions & 112 deletions SourceCode/AgIO/Source/Forms/FormLoop.Designer.cs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions SourceCode/AgIO/Source/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 23 additions & 20 deletions SourceCode/AgIO/Source/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
<data name="Com_Module2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Com_Module2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="VehFileLoad" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\VehFileLoad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AgIO_First" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\AgIO_First.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down Expand Up @@ -175,18 +178,15 @@
<data name="Edit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Cancel64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Cancel64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="ConS_ImplementAntenna" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\ConS_ImplementAntenna.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Check_Error" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Check_Error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="B_UDP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\B_UDP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Settings48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Settings48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="DnArrow64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\DnArrow64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand All @@ -199,6 +199,9 @@
<data name="NtripToUDP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\NtripToUDP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UpArrow64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\UpArrow64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NTRIP_Client" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\NTRIP_Client.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand All @@ -211,8 +214,11 @@
<data name="ArrowGrnLeft" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\ArrowGrnLeft.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NtripSettings" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\NtripSettings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="OK64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\OK64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Com_AutosteerModule" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Com_AutosteerModule.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="satellite" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\satellite.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
Expand All @@ -223,20 +229,17 @@
<data name="B_Machine" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\B_Machine.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Com_AutosteerModule" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Com_AutosteerModule.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Cancel64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Cancel64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="USB_Disconnect" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\USB_Disconnect.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LogNMEA" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\LogNMEA.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="B_IMU" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\B_IMU.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UpArrow64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\UpArrow64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Settings48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Settings48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ArrowGrnRight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\ArrowGrnRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
Expand All @@ -253,13 +256,13 @@
<data name="ArrowRight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\ArrowRight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="VehFileLoad" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\VehFileLoad.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="NtripSettings" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\NtripSettings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OK64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\OK64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="B_IMU" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\B_IMU.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ConS_ImplementAntenna" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\ConS_ImplementAntenna.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Nmea" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\btnImages\Nmea.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added SourceCode/AgIO/Source/btnImages/Nmea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions SourceCode/GPS/Classes/CABCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ public void GetCurrentCurveLine(vec3 pivot, vec3 steer)
radiusPointCu.easting = mf.yt.radiusPointYT.easting;
radiusPointCu.northing = mf.yt.radiusPointYT.northing;
ppRadiusCu = mf.yt.ppRadiusYT;
mf.vehicle.modeActualXTE = (distanceFromCurrentLinePivot);
}
else if (mf.isStanleyUsed)//Stanley
{
Expand Down Expand Up @@ -508,8 +509,8 @@ public void GetCurrentCurveLine(vec3 pivot, vec3 steer)
if (!isHeadingSameWay)
distanceFromCurrentLinePivot *= -1.0;

//used for smooth mode
mf.vehicle.ast.modeActualXTE = (distanceFromCurrentLinePivot);
//used for acquire/hold mode
mf.vehicle.modeActualXTE = (distanceFromCurrentLinePivot);

double steerHeadingError = (pivot.heading - curList[A].heading);
//Fix the circular error
Expand All @@ -523,7 +524,7 @@ public void GetCurrentCurveLine(vec3 pivot, vec3 steer)
else if (steerHeadingError < -glm.PIBy2)
steerHeadingError += Math.PI;

mf.vehicle.ast.modeActualHeadingError = glm.toDegrees(steerHeadingError);
mf.vehicle.modeActualHeadingError = glm.toDegrees(steerHeadingError);


//Convert to centimeters
Expand Down Expand Up @@ -589,7 +590,7 @@ public void DrawCurve()
{
GL.PointSize(4);
GL.Color3(0.95f, 0.2f, 0.95f);
GL.Begin(PrimitiveType.Points);
GL.Begin(PrimitiveType.LineStrip);
for (int h = 0; h < curList.Count; h++) GL.Vertex3(curList[h].easting, curList[h].northing, 0);
GL.End();

Expand Down
6 changes: 3 additions & 3 deletions SourceCode/GPS/Classes/CABLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void GetCurrentABLine(vec3 pivot, vec3 steer)
ppRadiusAB = mf.yt.ppRadiusYT;

mf.vehicle.modeTimeCounter = 0;
mf.vehicle.ast.modeActualXTE = (distanceFromCurrentLinePivot);
mf.vehicle.modeActualXTE = (distanceFromCurrentLinePivot);
}

//Stanley
Expand Down Expand Up @@ -293,7 +293,7 @@ double goalPointDistanceDSquared
distanceFromCurrentLinePivot *= -1.0;

//used for acquire/hold mode
mf.vehicle.ast.modeActualXTE = (distanceFromCurrentLinePivot);
mf.vehicle.modeActualXTE = (distanceFromCurrentLinePivot);

double steerHeadingError = (pivot.heading - abHeading);
//Fix the circular error
Expand All @@ -307,7 +307,7 @@ double goalPointDistanceDSquared
else if (steerHeadingError < -glm.PIBy2)
steerHeadingError += Math.PI;

mf.vehicle.ast.modeActualHeadingError = glm.toDegrees(steerHeadingError);
mf.vehicle.modeActualHeadingError = glm.toDegrees(steerHeadingError);

//Convert to millimeters
mf.guidanceLineDistanceOff = (short)Math.Round(distanceFromCurrentLinePivot * 1000.0, MidpointRounding.AwayFromZero);
Expand Down
13 changes: 0 additions & 13 deletions SourceCode/GPS/Classes/CAutoSteer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,10 @@ public class CAutoSteer
{
//private readonly FormGPS mf;

//flag for free drive window to control autosteer
public bool isInFreeDriveMode;

//the trackbar angle for free drive
public double driveFreeSteerAngle = 0;

public double modeXTE, modeMultiplier, modeMultiplierStanley, modeActualXTE = 0, modeActualHeadingError = 0;
public int modeTime = 0;

//constructor
public CAutoSteer()
{
isInFreeDriveMode = false;
modeXTE = Properties.Settings.Default.setAS_ModeXTE;
modeMultiplier = Properties.Settings.Default.setAS_ModeMultiplier;
modeMultiplierStanley = Properties.Settings.Default.setAS_ModeMultiplierStanley;
modeTime = Properties.Settings.Default.setAS_ModeTime;
}
}
}
2 changes: 1 addition & 1 deletion SourceCode/GPS/Classes/CContour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ public void DistanceFromContourLine(vec3 pivot, vec3 steer)
}

//used for smooth mode
mf.vehicle.ast.modeActualXTE = (distanceFromCurrentLinePivot);
mf.vehicle.modeActualXTE = (distanceFromCurrentLinePivot);

//fill in the autosteer variables
mf.guidanceLineDistanceOff = (short)Math.Round(distanceFromCurrentLinePivot * 1000.0, MidpointRounding.AwayFromZero);
Expand Down
27 changes: 3 additions & 24 deletions SourceCode/GPS/Classes/CGuidance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,9 @@ public CGuidance(FormGPS _f)
#region Stanley
private void DoSteerAngleCalc()
{
double xTE = Math.Abs(mf.vehicle.ast.modeActualXTE);
stanleyModeMultiplier = 1;

//the immediate version
if (xTE < mf.vehicle.ast.modeXTE)
{
if (mf.vehicle.modeTimeCounter > mf.vehicle.ast.modeTime * 10)
{
//stanleyModeMultiplier = ((mf.vehicle.ast.modeXTE - xTE) / mf.vehicle.ast.modeXTE * mf.vehicle.ast.modeMultiplier);
stanleyModeMultiplier = mf.vehicle.ast.modeMultiplierStanley;
}
else
{
mf.vehicle.modeTimeCounter++;
}
}
else
{
mf.vehicle.modeTimeCounter = 0;
}

if (mf.isReverse) steerHeadingError *= -1;
//Overshoot setting on Stanley tab
steerHeadingError *= mf.vehicle.stanleyHeadingErrorGain * stanleyModeMultiplier;
steerHeadingError *= mf.vehicle.stanleyHeadingErrorGain;

double sped = Math.Abs(mf.avgSpeed);
if (sped > 1) sped = 1 + 0.277 * (sped - 1);
Expand Down Expand Up @@ -121,7 +100,7 @@ private void DoSteerAngleCalc()
else if (steerAngleGu > mf.vehicle.maxSteerAngle) steerAngleGu = mf.vehicle.maxSteerAngle;

//used for smooth mode
mf.vehicle.ast.modeActualXTE = (distanceFromCurrentLinePivot);
mf.vehicle.modeActualXTE = (distanceFromCurrentLinePivot);

//Convert to millimeters from meters
mf.guidanceLineDistanceOff = (short)Math.Round(distanceFromCurrentLinePivot * 1000.0, MidpointRounding.AwayFromZero);
Expand Down Expand Up @@ -212,7 +191,7 @@ public void StanleyGuidanceABLine(vec3 curPtA, vec3 curPtB, vec3 pivot, vec3 ste
else if (steerHeadingError < -glm.PIBy2)
steerHeadingError += Math.PI;

mf.vehicle.ast.modeActualHeadingError = glm.toDegrees(steerHeadingError);
mf.vehicle.modeActualHeadingError = glm.toDegrees(steerHeadingError);

DoSteerAngleCalc();
}
Expand Down
2 changes: 1 addition & 1 deletion SourceCode/GPS/Classes/CRecordedPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ private void PurePursuitRecPath(int ptCount)
if (steerAngleRP > mf.vehicle.maxSteerAngle) steerAngleRP = mf.vehicle.maxSteerAngle;

//used for smooth mode
mf.vehicle.ast.modeActualXTE = (distanceFromCurrentLinePivot);
mf.vehicle.modeActualXTE = (distanceFromCurrentLinePivot);

//Convert to centimeters
mf.guidanceLineDistanceOff = (short)Math.Round(distanceFromCurrentLinePivot * 1000.0, MidpointRounding.AwayFromZero);
Expand Down
Loading

0 comments on commit b43182c

Please sign in to comment.