Exemple #1
0
        public void GeneratePathToStartInfield()
        {
            //go to the startpoint
            CDubins dubPathToStart = new CDubins();

            CDubins.turningRadius = mf.vehicle.minTurningRadius * 1.2;

            ////get the dubins path vec3 point coordinates of turn
            //dubList.Clear();
            //dubList = dubPathToStart.GenerateDubins(endHeadlandPoint, startInfieldPoint, mf.bnd);

            //transfer point list to genList class
            for (int i = 0; i < dubList.Count; i++)
            {
                CGenPathPt pt = new CGenPathPt(dubList[i].easting, dubList[i].northing, dubList[i].heading);
                if (i < 10)
                {
                    pt.sequence = 1;
                }
                genList.Add(pt);
            }

            //made the path so set the flag
            isPathToInfieldMade = true;

            genListCount        = genList.Count;
            currentPositonIndex = 0;
            isEndOfTheGenLine   = false;
        }
Exemple #2
0
        public void GeneratePathHome()
        {
            genList.Clear();
            currentPositonIndex = 0;
            isEndOfTheGenLine   = false;

            //go to the startpoint
            CDubins dubPathToStart = new CDubins();

            CDubins.turningRadius = mf.vehicle.minTurningRadius * 2.0;

            ////get the dubins path vec3 point coordinates of turn
            //dubList.Clear();
            //dubList = dubPathToStart.GenerateDubins(mf.pivotAxlePos, homePoint, mf.bnd);

            //transfer point list to genList class
            for (int i = 0; i < dubList.Count; i++)
            {
                CGenPathPt pt = new CGenPathPt(dubList[i].easting, dubList[i].northing, dubList[i].heading);
                genList.Add(pt);
            }

            genListCount        = genList.Count;
            currentPositonIndex = 0;

            //shut everything off
            isDrivingHome = true;
        }
Exemple #3
0
        public void GenerateHeadlandPath()
        {
            //first find out which side is inside the boundary
            //insideOutside = glm.PIBy2;
            //point.easting = mf.bnd.ptList[3].easting - (Math.Sin(insideOutside + mf.bnd.ptList[3].heading) * 2.0);
            //point.northing = mf.bnd.ptList[3].northing - (Math.Cos(insideOutside + mf.bnd.ptList[3].heading) * 2.0);
            //if (!mf.bnd.IsPointInsideBoundary(point)) insideOutside *= -1.0;

            //keep copy of original position/heading
            homePoint = mf.pivotAxlePos;

            //clear the main list
            genList.Clear();

            for (int passNumber = 1; passNumber <= numHeadlandPasses; passNumber++)
            {
                //determine the start point of first headland -
                accList.Clear();
                BuildOneHeadlandPath((mf.vehicle.toolWidth - mf.vehicle.toolOverlap) * ((double)passNumber - 0.4));
                startHeadlandPoint = accList[0];

                CDubins dubPath = new CDubins();
                CDubins.turningRadius = mf.vehicle.minTurningRadius * 1.2;

                ////get the dubins path vec3 point coordinates of turn
                //dubList.Clear();
                //if (passNumber == 1) dubList = dubPath.GenerateDubins(mf.pivotAxlePos, startHeadlandPoint, mf.bnd);
                //else dubList = dubPath.GenerateDubins(endHeadlandPoint, startHeadlandPoint, mf.bnd);

                //transfer point list to genList class
                for (int i = 0; i < dubList.Count; i++)
                {
                    CGenPathPt pt = new CGenPathPt(dubList[i].easting, dubList[i].northing, dubList[i].heading);
                    if (i < 5)
                    {
                        pt.sequence = 1;
                    }
                    genList.Add(pt);
                }

                for (int i = 0; i < accList.Count; i++)
                {
                    CGenPathPt pt = new CGenPathPt(accList[i].easting, accList[i].northing, accList[i].heading);
                    if (i < 5)
                    {
                        pt.sequence = 2;
                    }
                    genList.Add(pt);
                }

                for (int i = 0; i < 5; i++)
                {
                    CGenPathPt pt = new CGenPathPt(accList[i].easting, accList[i].northing, accList[i].heading);
                    genList.Add(pt);
                }
                endHeadlandPoint = accList[5];
            }
            genListCount        = genList.Count;
            currentPositonIndex = 0;
            isEndOfTheGenLine   = false;
        }