New Map building

bernard

Well-known member
We need to try to find a way to create and edit map on a more easier way.

My suggestion :
Add button to enter in Creation or edition mode.
Then move robot in manual mode :
Firmware record the position each 500 ms or 1s and create a polygon
Record is stop by a button or if polygon is closed.
Using shapely.simplify the number of point is reduce.

In edition mode we can use the join function of shapely.

I am waiting on your suggestion (y)
 
It's Union
from shapely import union as PolygonUnion
Polygon2=PolygonUnion(mymower.polygon[7],mymower.polygon[4])


I have made some test:
On one already map registered using sunray app :
55 perimeter point for 427 m2

I use the mow perimeter to record each second the location of mower :
Result is 459 point and exactly same area AT 0.2 M/S
After simplify to 3 cm accuracy result is 151 point.
polygon2=polygon1.simplify(tolerance=0.03, preserve_topology=True) #tolerance is 2 cm here
a, b = polygon2.exterior.xy

So at the end the result show a *3 number of perimeter registration number of point.
 
Ok, I thought you ment with edit mode something else (moving points by drag and drop etc.)
Yes exactly the 2 methods are perfect :
Using shapely union or intersection you can easily expand or reduce a perimeter (into perimeter edition) using mower in manual driving mode.
Using your actual code you can adjust each point with high precision and without moving the mower.
 
It's brainstorming , so i post what i imagine and test :ROFLMAO: :ROFLMAO: :ROFLMAO:

Example of Recording loop with 2 conditions (certainly need more : GPS / button /wifi status etc....)
Not record if no movement (point_too_close)
Check polygon_closed by testing after 10 recorded point if distance between actual point and intial one is <3 cm (end of record)

Code:
if (mymower.record_perimeter) :
               
  if (dt.datetime.now()-last_time_add_point).seconds >= 1:
          
            last_time_add_point=dt.datetime.now()
            polygon_closed = False #check_if_polygon_is_closed
            point_too_close = False#check_if_point_is_close_to_last_one
                  
            actual_pos=Point(mymower.statex,mymower.statey)
            print(actual_pos)
            print(last_pos)
            move_dist=Point.distance(actual_pos,last_pos)
            if move_dist <= 0.02 :
                point_too_close=True
                print("trop pret" , move_dist)


            if (not bool(polygon_closed)) and (not bool(point_too_close)):
                print("rr")
                print()
               
                mymower.newPerimeterx.append(mymower.statex)
                mymower.newPerimetery.append(mymower.statey)
                last_pos=actual_pos
                #mymower.newPerimeter.append(actual_pos)

1713555215582.png

(e.g. driving backwards and record the same edge a second time),



Using .buffer(0) help to have a valid polygon and remove all include error
Code:
polygon1 = Polygon(np.squeeze(perimeterArray))
        from shapely.validation import explain_validity
        print(explain_validity(polygon1))
        print("valid  polygon init " ,polygon1.is_valid)
        new_polygon = polygon1.buffer(0)
        print("valid  polygon2 " ,new_polygon.is_valid)

1713555171512.png
For GPS float or invalid we need to pause the record until FIX is back and only record on a FIX gps signal.

Unfortunatly since 1 year i can't join picture or file there is trouble on the site ???
 
Ich wollte sagen:
Kennt Ihr das? Evtl. dazu geeignet das Polygon zu editieren.

Ich nutze Mission Planner (auch weil ich sonst nichts anderes habe). Mit der Fernsteuerung setze ich die Eckpunkte, berechne das Raster und editiere von Hand die Feinheiten. Unter anderem lasse ich den Mäher im Zickzack vorwärts/rückwärts laufen und verändere auch die Geschwindigkeit. Natürlich gibt es mehrere Raster für die gleiche Fläche.
Aber: Ja, ist sehr aufwendig.
Ungeeignet für Rasenroboter würde ich nicht sagen - hat sicherlich den Fokus auf Dronen.
Es gibt aber beeindruckende Videos von Traktoren und selbstfahrenden, großen Rasenmähern die das System benutzen.
Wenn ich nur den Rasen mähen will, dann ist das sicherlich nicht die Lösung. Aber wer von uns will NUR Rasen mähen ?
Ich wünsche mir im Moment nur eine Satellitenkarte mit cm-Auflösung, damit ich direkt am PC das Raster planen kann.
Was ich auch gut finde, ist die Möglichkeit im Routenplan direkt weitere Parameter und Kommandos zu hinterlegen (zB. Messer-Geschwindigkeit, Fahrgeschwindigkeit, usw) letztlich beliebige Größen, wenn man die Schnittstelle auf dem PCB selbst programmiert. Damit kann man auch Events im Routenplan aufzeichnen.
 
Oben