<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mardy (Entratas super gps)</title><link>http://mardy.it/</link><description></description><atom:link href="http://mardy.it/ia/categories/gps.xml" rel="self" type="application/rss+xml"></atom:link><language>ia</language><copyright>Contents © 2026 &lt;a href="mailto:info@mardy.it"&gt;Alberto Mardegan&lt;/a&gt; </copyright><lastBuildDate>Sat, 11 Apr 2026 13:54:02 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>New website for Mappero Geotagger, and cross-compiling stuff</title><link>http://mardy.it/ia/blog/2020/04/new-website-for-mappero-geotagger.html</link><dc:creator>Alberto Mardegan</dc:creator><description>&lt;p&gt;Mappero Geotagger has now moved from &lt;a href="http://www.mardy.it/mappero-geotagger/"&gt;its previous page from this
site&lt;/a&gt; to a &lt;a href="http://mappero.mardy.it"&gt;new, separate
website&lt;/a&gt; built with the awesome &lt;a href="http://getnikola.com"&gt;Nikola static website
generator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The main reason for this change is that I didn't have an online space where to
host the application binaries, and I wanted to experiment with a different
selling method. Now, downloads are (poorly) hidden behind a payment page,
whereas in multiple places of the website I also mention that I can provide
the application for free to whomever asks for it. While it might seem weird at
first, I do honestly believe that this will not stop people from buying it:
first of all, many people just think it's fair to pay for a software
applications, and secondly, for some people writing an e-mail and establishing
a personal contact with a stranger is actually harder than paying a small
amount of money. And in all sincerity, the majority of the income I've had so
far for Mappero Geotagger came from donations, rather than purchases; so, not
much to lose here.&lt;/p&gt;
&lt;h3&gt;QBS and MXE&lt;/h3&gt;
&lt;p&gt;Anyway, since this is primarily a technical blog, I want to share my
experiences with cross-building from Linux to Windows. As you might remember,
&lt;a href="http://mardy.it/ia/blog/2019/07/qbs-and-code-coverage-reports.html"&gt;some time ago I switched the build system of Mappero from qmake to
QBS&lt;/a&gt;, and I haven't regretted it at
all. I've managed to build the application in Linux (of course), macOS, as a
Debian package on the &lt;a href="https://launchpad.net/~mardy/+archive/ubuntu/mappero"&gt;Ubuntu PPA
builders&lt;/a&gt;, on &lt;a href="https://ci.appveyor.com/project/mardy/mappero"&gt;Windows
with AppVeyor&lt;/a&gt; and, last but not
least, on Linux for Windows using the mingw setup provided by the &lt;a href="http://mxe.cc"&gt;MXE
project&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;QBS worked surprisingly well also in this case, though I had to fight with a
small bug on the toolchain detection, which is hopefully going to be &lt;a href="https://codereview.qt-project.org/c/qbs/qbs/+/296870"&gt;fixed
soon&lt;/a&gt;. For the few of you
who are interested in achieving something similar, here's the steps I ran to
configure QBS for mingw:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;MXE_BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;path-to-mxe&amp;gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;MXE_TARGET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;x86_64-w64-mingw32.shared&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# 32 bit or static targets are also available&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;MXE_PROFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"mxe"&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;QT_PROFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;MXE_PROFILE&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;-qt"&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;qbs&lt;span class="w"&gt; &lt;/span&gt;setup-toolchains&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;MXE_BASE&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/usr/bin/&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;MXE_TARGET&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;-g++"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MXE_PROFILE&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;qbs&lt;span class="w"&gt; &lt;/span&gt;config&lt;span class="w"&gt; &lt;/span&gt;profiles.&lt;span class="nv"&gt;$MXE_PROFILE&lt;/span&gt;.cpp.toolchainPrefix&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;MXE_TARGET&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;-"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# temporary workaround&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;qbs&lt;span class="w"&gt; &lt;/span&gt;setup-qt&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MXE_BASE&lt;/span&gt;&lt;span class="s2"&gt;/usr/&lt;/span&gt;&lt;span class="nv"&gt;$MXE_TARGET&lt;/span&gt;&lt;span class="s2"&gt;/qt5/bin/qmake"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;QT_PROFILE&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;qbs&lt;span class="w"&gt; &lt;/span&gt;config&lt;span class="w"&gt; &lt;/span&gt;profiles.&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;QT_PROFILE&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;.baseProfile&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MXE_PROFILE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Sorry for using that many environment variables ☺. After qbs is configured,
it's just a matter of running &lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="w"&gt;    &lt;/span&gt;qbs&lt;span class="w"&gt; &lt;/span&gt;profile:&lt;span class="nv"&gt;$QT_PROFILE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to build the application. You will get a nice window binary and, once you
collect all the needed library dependencies, you'll be able to run it on
Windows. Or WINE ☺.&lt;/p&gt;
&lt;p&gt;As part of this effort, I also had to build &lt;a href="http://libraw.org"&gt;libraw&lt;/a&gt;, so I
didn't miss the occasion to &lt;a href="https://github.com/mxe/mxe/pull/2481"&gt;contribute its recipe to
MXE&lt;/a&gt;. I'm also trying to get a change
accepted, that would make MXE &lt;a href="https://github.com/mxe/mxe/pull/2480"&gt;support the dynamic OpenGL
selection&lt;/a&gt; available since Qt 5.4.&lt;/p&gt;</description><guid>http://mardy.it/ia/blog/2020/04/new-website-for-mappero-geotagger.html</guid><pubDate>Sun, 12 Apr 2020 09:20:55 GMT</pubDate></item><item><title>Fixing berserk rotations in Mapper</title><link>http://mardy.it/ia/blog/2010/03/fixing-berserk-rotations-in-mapper.html</link><dc:creator>Alberto Mardegan</dc:creator><description>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.mardy.it/archivos/imagines/angle_diff.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="198" src="http://www.mardy.it/archivos/imagines/angle_diff.png" width="320"&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;Maemo Mapper has a nice feature which is called "automatic rotation" and consists in automatically rotating the map so that the direction you are going to is always oriented toward the top of the screen. The direction information comes from the GPS device, and applications can access it from a &lt;a href="http://maemo.org/api_refs/5.0/5.0-final/liblocation/LocationGPSDevice.html#LocationGPSDeviceFix"&gt;liblocation structure&lt;/a&gt;.&lt;br&gt;
Unfortunately, while this value is rather reliable when you are moving fast, it's totally pointless when you are not moving: and this can be easily seen in the alpha versions of Mapper, when the map starts spinning crazily as soon as you stop moving. One thing that I didn't notice is that besides giving the direction, liblocation also gives the estimated error: the &lt;tt&gt;epd&lt;/tt&gt; field in the &lt;tt&gt;LocationGPSDeviceFix&lt;/tt&gt; structure represents the error on the angle, as a value from 0 to 359. In my opinion it doesn't make much sense to have an error greater than 180 on an angle, so I assume that it must be divided by two.&lt;/p&gt;&lt;p&gt;In the image on the right, the &lt;tt&gt;epd&lt;/tt&gt; is represented by 2 × β. Now, if v⃗&lt;sub&gt;0&lt;/sub&gt;is the current direction the map is oriented towards, and v⃗&lt;sub&gt;1&lt;/sub&gt; is the new direction reported by the GPS with an error (uncertainty) of β, how do we decide if (and how much) we should rotate towards v⃗&lt;sub&gt;1&lt;/sub&gt;?&lt;br&gt;
The algorithm I've implemented goes like this:&lt;br&gt;
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;if β is greater than 90°, ignore the information altogether (i.e., don't change the rotation). Or,&lt;/li&gt;
&lt;li&gt;if α (the angle between v⃗&lt;sub&gt;0&lt;/sub&gt; and v⃗&lt;sub&gt;1&lt;/sub&gt;) is less than 5°, then let the map rotate to v⃗&lt;sub&gt;1&lt;/sub&gt;. Or,&lt;/li&gt;
&lt;li&gt;rotate towards v⃗&lt;sub&gt;1&lt;/sub&gt; by γ = α × &lt;sup&gt;(90 - β)&lt;/sup&gt;⁄&lt;sub&gt;90&lt;/sub&gt;, that is the rotation is limited according to the error.&lt;/li&gt;
&lt;/ul&gt;I've been testing the algorithm in the last few days, and it is indeed a huge improvement over the previous situation: now the map does not rotate while I'm not moving, or it does fairly seldom. But still, the map almost always rotates once just right after stopping, and not by a small amount, which is pretty annoying as it means that most of the times when you pause you'll have the map wrongly oriented — and pauses are usually the very moment when you'd look at the map...&lt;p&gt;I'll investigate this a bit more; this means that I'll have to keep a terminal window open with a view on the &lt;tt&gt;syslog&lt;/tt&gt;, while using Mapper :-)&lt;/p&gt;</description><guid>http://mardy.it/ia/blog/2010/03/fixing-berserk-rotations-in-mapper.html</guid><pubDate>Tue, 16 Mar 2010 13:53:00 GMT</pubDate></item></channel></rss>