<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wiegert.link/index.php?action=history&amp;feed=atom&amp;title=OpenMower_Edit_map</id>
	<title>OpenMower Edit map - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wiegert.link/index.php?action=history&amp;feed=atom&amp;title=OpenMower_Edit_map"/>
	<link rel="alternate" type="text/html" href="https://wiki.wiegert.link/index.php?title=OpenMower_Edit_map&amp;action=history"/>
	<updated>2026-06-22T20:52:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.wiegert.link/index.php?title=OpenMower_Edit_map&amp;diff=490&amp;oldid=prev</id>
		<title>Damme at 21:16, 20 June 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.wiegert.link/index.php?title=OpenMower_Edit_map&amp;diff=490&amp;oldid=prev"/>
		<updated>2026-06-20T21:16:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:16, 20 June 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Only use this wiki if you are running bare metal custom build! Otherwise go to the official wiki, this is just a backup for personal reference!&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Introduction ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Introduction ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This tutorial shows how to use an orthophoto (generated by taking aerial pictures with a drone) and modify the open mower map. In my case I recorded the boundary of my lawn area driving the mower around and later divided the area and added obstacles using the drone footage.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This tutorial shows how to use an orthophoto (generated by taking aerial pictures with a drone) and modify the open mower map. In my case I recorded the boundary of my lawn area driving the mower around and later divided the area and added obstacles using the drone footage.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff::1.12:old-475:rev-490 --&gt;
&lt;/table&gt;</summary>
		<author><name>Damme</name></author>
	</entry>
	<entry>
		<id>https://wiki.wiegert.link/index.php?title=OpenMower_Edit_map&amp;diff=475&amp;oldid=prev</id>
		<title>Damme: Created page with &quot;=== Introduction === This tutorial shows how to use an orthophoto (generated by taking aerial pictures with a drone) and modify the open mower map. In my case I recorded the boundary of my lawn area driving the mower around and later divided the area and added obstacles using the drone footage.  openmower map boundary with orthophoto layer   === Generate an orthophoto === I took about 50 pictures with a drone ca....&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.wiegert.link/index.php?title=OpenMower_Edit_map&amp;diff=475&amp;oldid=prev"/>
		<updated>2026-06-20T20:59:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=== Introduction === This tutorial shows how to use an orthophoto (generated by taking aerial pictures with a drone) and modify the open mower map. In my case I recorded the boundary of my lawn area driving the mower around and later divided the area and added obstacles using the drone footage.  &lt;a href=&quot;/index.php?title=File:Openmower_map_boundary_orthophoto.png&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;File:Openmower map boundary orthophoto.png (page does not exist)&quot;&gt;none|thumb|openmower map boundary with orthophoto layer&lt;/a&gt;   === Generate an orthophoto === I took about 50 pictures with a drone ca....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Introduction ===&lt;br /&gt;
This tutorial shows how to use an orthophoto (generated by taking aerial pictures with a drone) and modify the open mower map. In my case I recorded the boundary of my lawn area driving the mower around and later divided the area and added obstacles using the drone footage.&lt;br /&gt;
&lt;br /&gt;
[[File:Openmower map boundary orthophoto.png|none|thumb|openmower map boundary with orthophoto layer]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Generate an orthophoto ===&lt;br /&gt;
I took about 50 pictures with a drone ca. 10m above ground and generated an orthophoto using OpenDroneMap WebODM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can read about the process here: https://docs.opendronemap.org/tutorials/&lt;br /&gt;
&lt;br /&gt;
OpenDroneMap WebODM runs in a docker container and can be found here: https://www.opendronemap.org/webodm/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can export an orthophoto .tif format there&lt;br /&gt;
&lt;br /&gt;
=== convert map.bag into GPX ===&lt;br /&gt;
Obviously back up your map.bag&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I wrote a python script to convert the map area coordinates into utm coordinates. I ran this on the robots raspberry pi. In reads the map.bag from .ros folder and exports a .gpx format file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following python packages are needed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;pip install utm gpxpy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You need to &amp;lt;code&amp;gt;source /opt/ros/noetic/setup.bash&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Modify the base point coodinates in the script. I use the roof mouned RTK GPS antenna as base coordinates.&lt;br /&gt;
&lt;br /&gt;
Modify the input and output file paths to your needs and run the python script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a file wit following content: &amp;lt;code&amp;gt;bag_to_gpx_tracks_utm.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod +x bag_to_gpx_tracks_utm.py&amp;lt;/code&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python3&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
#===========================================&lt;br /&gt;
# Christoph Sobel 11.05.2023&lt;br /&gt;
# script to convert openmower ros map.bag to gpx file&lt;br /&gt;
#===========================================&lt;br /&gt;
&lt;br /&gt;
from codecs import latin_1_decode&lt;br /&gt;
import rosbag&lt;br /&gt;
import utm&lt;br /&gt;
import gpxpy.gpx&lt;br /&gt;
import math&lt;br /&gt;
import os&lt;br /&gt;
from tf.transformations import euler_from_quaternion&lt;br /&gt;
&lt;br /&gt;
bag = rosbag.Bag('/home/pi/.ros/map.bag')&lt;br /&gt;
# bag = rosbag.Bag('output.bag')&lt;br /&gt;
&lt;br /&gt;
lat0 = 53.00&lt;br /&gt;
lon0 = 8.00&lt;br /&gt;
# lat0 = float(os.getenv('OM_DATUM_LAT'))&lt;br /&gt;
# lon0 = float(os.getenv('OM_DATUM_LONG'))&lt;br /&gt;
print(&amp;quot;base_point&amp;quot;, lat0, &amp;quot; &amp;quot;, lon0)&lt;br /&gt;
&lt;br /&gt;
topics = bag.get_type_and_topic_info()[1].keys()&lt;br /&gt;
print(topics)&lt;br /&gt;
&lt;br /&gt;
gpx = gpxpy.gpx.GPX()&lt;br /&gt;
gpx.name = 'open_mower_map'&lt;br /&gt;
gpx.description = 'Map data from openmower map.bag'&lt;br /&gt;
&lt;br /&gt;
# base point (e.g. gps antenna)&lt;br /&gt;
# base_point = gpxpy.gpx.GPXWaypoint(latitude=lat0, longitude=lon0, name=&amp;quot;base_point&amp;quot;)&lt;br /&gt;
# gpx.waypoints.append(base_point)&lt;br /&gt;
&lt;br /&gt;
x0, y0, zone, ut = utm.from_latlon(lat0, lon0)&lt;br /&gt;
print(&amp;quot;base_point in utm&amp;quot;, x0, &amp;quot; &amp;quot;, y0)&lt;br /&gt;
&lt;br /&gt;
gpx_track = gpxpy.gpx.GPXTrack(name=&amp;quot;base_point&amp;quot;)&lt;br /&gt;
gpx.tracks.append(gpx_track)&lt;br /&gt;
gpx_segment = gpxpy.gpx.GPXTrackSegment()&lt;br /&gt;
gpx_track.segments.append(gpx_segment)&lt;br /&gt;
gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(lat0, lon0, elevation=0))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Loop through areas and obstacles&lt;br /&gt;
area_counter = 0&lt;br /&gt;
&lt;br /&gt;
for area_type in ['mowing_areas', 'navigation_areas']:&lt;br /&gt;
    for topic, msg, t in bag.read_messages(topics=[area_type]):&lt;br /&gt;
        print(&amp;quot;{}_{}_area&amp;quot;.format(area_type[:-1], area_counter))&lt;br /&gt;
        # Create track in GPX:&lt;br /&gt;
        gpx_track = gpxpy.gpx.GPXTrack(name=&amp;quot;{}_{}_area&amp;quot;.format(area_type[:-1], area_counter))&lt;br /&gt;
        gpx.tracks.append(gpx_track)&lt;br /&gt;
        # Create segment in GPX track:&lt;br /&gt;
        gpx_segment = gpxpy.gpx.GPXTrackSegment()&lt;br /&gt;
        gpx_track.segments.append(gpx_segment)&lt;br /&gt;
&lt;br /&gt;
        # outline&lt;br /&gt;
        for point in msg.area.points:&lt;br /&gt;
            # Create points:&lt;br /&gt;
            lat, lon = utm.to_latlon(x0 + point.x, y0 + point.y, zone, ut)&lt;br /&gt;
            gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(lat, lon, elevation=0))&lt;br /&gt;
&lt;br /&gt;
        # obstacles&lt;br /&gt;
        obstacle_counter = 0&lt;br /&gt;
        for obst in msg.obstacles:&lt;br /&gt;
            print(&amp;quot;{}_{}_obstacle_{}&amp;quot;.format(area_type[:-1], area_counter, obstacle_counter))&lt;br /&gt;
            # Create track in GPX:&lt;br /&gt;
            gpx_track = gpxpy.gpx.GPXTrack(name=&amp;quot;{}_{}_obstacle_{}&amp;quot;.format(area_type[:-1], area_counter, obstacle_counter))&lt;br /&gt;
            gpx.tracks.append(gpx_track)&lt;br /&gt;
            # Create segment in GPX track:&lt;br /&gt;
            gpx_segment = gpxpy.gpx.GPXTrackSegment()&lt;br /&gt;
            gpx_track.segments.append(gpx_segment)&lt;br /&gt;
            for point in obst.points:&lt;br /&gt;
                # Create points:&lt;br /&gt;
                lat, lon = utm.to_latlon(x0 + point.x, y0 + point.y, zone, ut)&lt;br /&gt;
                gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(lat, lon, elevation=0))&lt;br /&gt;
            obstacle_counter += 1&lt;br /&gt;
        area_counter += 1&lt;br /&gt;
&lt;br /&gt;
# docking point&lt;br /&gt;
for topic, msg, t in bag.read_messages(topics=['docking_point']):&lt;br /&gt;
    # print(msg)&lt;br /&gt;
    print(&amp;quot;parsing docking point&amp;quot;)&lt;br /&gt;
    quat_list = [msg.orientation.x, msg.orientation.y, msg.orientation.z, msg.orientation.w]&lt;br /&gt;
    (roll, pitch, yaw) = euler_from_quaternion(quat_list)&lt;br /&gt;
    # print((roll, pitch, yaw))&lt;br /&gt;
    x2 = msg.position.x + math.cos(yaw)&lt;br /&gt;
    y2 = msg.position.y + math.sin(yaw)&lt;br /&gt;
&lt;br /&gt;
    lat1, lon1 = utm.to_latlon(x0 + msg.position.x, y0 + msg.position.y, zone, ut)&lt;br /&gt;
    lat2, lon2 = utm.to_latlon(x0 + x2,y0 + y2, zone, ut)&lt;br /&gt;
&lt;br /&gt;
    gpx_track = gpxpy.gpx.GPXTrack(name=&amp;quot;docking_point&amp;quot;)&lt;br /&gt;
    gpx.tracks.append(gpx_track)&lt;br /&gt;
    gpx_segment = gpxpy.gpx.GPXTrackSegment()&lt;br /&gt;
    gpx_track.segments.append(gpx_segment)&lt;br /&gt;
    gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(lat1, lon1, elevation=0))&lt;br /&gt;
    gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(lat2, lon2, elevation=0))&lt;br /&gt;
&lt;br /&gt;
print('Created GPX file')&lt;br /&gt;
with open(&amp;quot;map_bag.gpx&amp;quot;, &amp;quot;w&amp;quot;) as f:&lt;br /&gt;
    f.write(gpx.to_xml())&lt;br /&gt;
&lt;br /&gt;
bag.close()&lt;br /&gt;
print('Done')&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== load GPX file into JOSM ===&lt;br /&gt;
Install the Java OpenStreetMap Editor from:&lt;br /&gt;
&lt;br /&gt;
https://josm.openstreetmap.de/wiki/Download&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start JOSM and install the PicLayer Plugin. For this go to ''Edit-&amp;gt;Preferences-&amp;gt;Plugins'' and search for PicLayer and tick the checkbox.&lt;br /&gt;
&lt;br /&gt;
Open your .gpx file, you shoud see the recorded boundaries&lt;br /&gt;
[[File:JOSM imported GPX file.png|none|thumb|Boundaries visible in JOSM from imported GPX file]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Right click on the Layer output.gpx and select &amp;quot;convert to data layer&amp;quot;. Proceed without simplifying. Now every node should be visible.&lt;br /&gt;
&lt;br /&gt;
=== overlay and align with an orthophoto ===&lt;br /&gt;
&lt;br /&gt;
* select ''Imagery-&amp;gt;More...-&amp;gt;New picture layer from file...'' and open your orthophoto .tif file&lt;br /&gt;
* you can now use the PicLayer tools from the toolbar to align you image layer. When all is aligned, right click on the picture layer and save the picture calibration for later use.&lt;br /&gt;
[[File:JOSM with orthophoto.png|none|thumb|mowing area boundaries in JOSM with orthophoto]]&lt;br /&gt;
&lt;br /&gt;
=== modify the boundaries ===&lt;br /&gt;
you can now add/remove/modify/merge/divide:&lt;br /&gt;
&lt;br /&gt;
* mowing or navigation areas&lt;br /&gt;
* obstacles&lt;br /&gt;
* docking point&lt;br /&gt;
&lt;br /&gt;
Using all the nice tools from JOSM.&lt;br /&gt;
&lt;br /&gt;
Following rules for this:&lt;br /&gt;
&lt;br /&gt;
* mowing and navigation areas need to be in counter clockwise direction&lt;br /&gt;
* obstacles need to be in clockwise direction&lt;br /&gt;
&lt;br /&gt;
definition of the feature is in the value of gpx:name tag of each way like this:&lt;br /&gt;
&lt;br /&gt;
* mowing_area_0_area&lt;br /&gt;
* mowing_area_0_obstacle_0&lt;br /&gt;
*mowing_area_0_obstacle_1&lt;br /&gt;
* mowing_area_1_area&lt;br /&gt;
* navigation_area_0_area&lt;br /&gt;
*navigation_area_1_area&lt;br /&gt;
*navigation_area_1_obstacle_0&lt;br /&gt;
* docking_point&lt;br /&gt;
[[File:JOSM gpsname tag information.png|none|thumb|area boundary JOSM gps:name tag information]]&lt;br /&gt;
Here you can see an added obstacle.&lt;br /&gt;
&lt;br /&gt;
=== export as GPX and convert back to openmower map.bag ===&lt;br /&gt;
Right click on the gpx layer and &amp;quot;save as&amp;quot;. Select gpx format.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source /opt/ros/noetic/setup.bash&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need to &amp;lt;code&amp;gt;source ./devel/setup.bash&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;open_mower_ros&amp;lt;/code&amp;gt; folder to get the MapArea custom ros message&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Modify the base point coordinates in the script. I use the roof mounted RTK GPS antenna as base coordinates.&lt;br /&gt;
&lt;br /&gt;
Modify the input and output file paths to your needs in the python script.&lt;br /&gt;
&lt;br /&gt;
Run following python script and put the output_map.bag where your ros.bag was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a file wit following content: &amp;lt;code&amp;gt;gpx_to_bag.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;chmod +x gpx_to_bag.py&amp;lt;/code&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;python3&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
#===========================================&lt;br /&gt;
# Christoph Sobel 11.05.2023&lt;br /&gt;
# script to convert gpx files to openmower ros map.bag&lt;br /&gt;
#===========================================&lt;br /&gt;
&lt;br /&gt;
import gpxpy.gpx&lt;br /&gt;
import utm&lt;br /&gt;
import rosbag&lt;br /&gt;
import math&lt;br /&gt;
from geometry_msgs.msg import Polygon, Point32, Pose&lt;br /&gt;
from mower_map.msg import MapArea  # Imports the custom message from its package&lt;br /&gt;
from tf.transformations import quaternion_from_euler&lt;br /&gt;
&lt;br /&gt;
# Base point&lt;br /&gt;
lat0 = 53.00&lt;br /&gt;
lon0 = 8.00&lt;br /&gt;
# lat0 = float(os.getenv('OM_DATUM_LAT'))&lt;br /&gt;
# lon0 = float(os.getenv('OM_DATUM_LONG'))&lt;br /&gt;
print(&amp;quot;base_point&amp;quot;, lat0, &amp;quot; &amp;quot;, lon0)&lt;br /&gt;
x0, y0, zone, ut = utm.from_latlon(lat0, lon0)&lt;br /&gt;
print(&amp;quot;base_point in utm&amp;quot;, x0, &amp;quot; &amp;quot;, y0)&lt;br /&gt;
&lt;br /&gt;
gpx_file = open('map_bag_osm.gpx', 'r')&lt;br /&gt;
gpx = gpxpy.parse(gpx_file)&lt;br /&gt;
&lt;br /&gt;
mowing_area_dict = {}&lt;br /&gt;
navigation_area_dict = {}&lt;br /&gt;
base_point = []&lt;br /&gt;
docking_points = []&lt;br /&gt;
&lt;br /&gt;
for track in gpx.tracks:&lt;br /&gt;
	print(&amp;quot;reading from gpx: &amp;quot;, track.name)&lt;br /&gt;
	# get points&lt;br /&gt;
	point_list = []&lt;br /&gt;
	for segment in track.segments:&lt;br /&gt;
		print(&amp;quot;Point count:{}&amp;quot;.format(len(segment.points)))&lt;br /&gt;
		for point in segment.points:&lt;br /&gt;
			# print(f'Point at ({point.latitude},{point.longitude}) -&amp;gt; {point.elevation}')&lt;br /&gt;
			x, y, zone, ut = utm.from_latlon(point.latitude, point.longitude)&lt;br /&gt;
			point_list.append(Point32(x=x-x0, y=y-y0, z=0.0))&lt;br /&gt;
	# store in deciated dict&lt;br /&gt;
	if &amp;quot;mowing&amp;quot; in track.name:&lt;br /&gt;
		mowing_area_dict[track.name] = point_list&lt;br /&gt;
	elif &amp;quot;navigation&amp;quot; in track.name:&lt;br /&gt;
		navigation_area_dict[track.name] = point_list&lt;br /&gt;
	elif &amp;quot;base&amp;quot; in track.name:&lt;br /&gt;
		base_point = point_list&lt;br /&gt;
	elif &amp;quot;docking&amp;quot; in track.name:&lt;br /&gt;
		docking_points  = point_list&lt;br /&gt;
&lt;br /&gt;
docking_pose = Pose()&lt;br /&gt;
if len(docking_points) == 2:&lt;br /&gt;
	yaw = math.atan2(docking_points[1].y - docking_points[0].y, docking_points[1].x - docking_points[0].x)&lt;br /&gt;
	quaternion = quaternion_from_euler(0,0,yaw)&lt;br /&gt;
	&lt;br /&gt;
	docking_pose.position.x = docking_points[0].x&lt;br /&gt;
	docking_pose.position.y = docking_points[0].y&lt;br /&gt;
	# Pose Orientation&lt;br /&gt;
	docking_pose.orientation.x = quaternion[0]&lt;br /&gt;
	docking_pose.orientation.y = quaternion[1]&lt;br /&gt;
	docking_pose.orientation.z = quaternion[2]&lt;br /&gt;
	docking_pose.orientation.w = quaternion[3]&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
def sort_dict_return_MapAreas(area_dict):&lt;br /&gt;
	areas = {}&lt;br /&gt;
	for track_name, point_list in sorted(area_dict.items()): # store sorted polygons to MapArea&lt;br /&gt;
		map_area = MapArea()&lt;br /&gt;
		print(&amp;quot;converting:&amp;quot;, track_name)&lt;br /&gt;
		area_number = track_name.split(&amp;quot;_&amp;quot;)[2]&lt;br /&gt;
		poly = Polygon(points=point_list)&lt;br /&gt;
		if &amp;quot;area&amp;quot; in track_name[-4:]:&lt;br /&gt;
			map_area.area = poly&lt;br /&gt;
			areas[area_number] = map_area&lt;br /&gt;
		elif &amp;quot;obstacle&amp;quot; in track_name:&lt;br /&gt;
			map_area = areas[area_number]&lt;br /&gt;
			map_area.obstacles.append(poly)&lt;br /&gt;
			areas[area_number] = map_area&lt;br /&gt;
	return areas&lt;br /&gt;
&lt;br /&gt;
mowing_areas_list = sort_dict_return_MapAreas(mowing_area_dict).values()&lt;br /&gt;
navigation_areas_list = sort_dict_return_MapAreas(navigation_area_dict).values()&lt;br /&gt;
&lt;br /&gt;
with rosbag.Bag('output_map.bag', 'w') as outbag:&lt;br /&gt;
	print('writing bag file')&lt;br /&gt;
	for mowing_area in mowing_areas_list:&lt;br /&gt;
		outbag.write(&amp;quot;mowing_areas&amp;quot;, mowing_area)&lt;br /&gt;
	for navigation_area in navigation_areas_list:	&lt;br /&gt;
		outbag.write(&amp;quot;navigation_areas&amp;quot;, navigation_area)&lt;br /&gt;
	outbag.write(&amp;quot;docking_point&amp;quot;, docking_pose)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Damme</name></author>
	</entry>
</feed>