Showing posts with label GPS. Show all posts
Showing posts with label GPS. Show all posts

Tuesday, January 26, 2021

AMOS Servers and Correction Data

Over the past couple of weeks some good improvements were made to the internal communications software running on AMOS. When using the network / Internet communications mode, the previous method of communications relied upon running a server with a fixed IP address to act as a communications broker between AMOS and the host computer or phone that was being used to control the boat and view data. The server used some software that I had written called "BoatServer" and it just ran on an available Windows computer here at In Nature Robotics HQ (i.e. my basement). It required setting up the WiFi router to forward network traffic on a particular port to that computer, and also required both the host device and AMOS knowing what IP address our Internet service provider had assigned to the house. From time to time this address would change, perhaps once every few weeks. The solution was reliable most of the time, except when it wasn't. And when it wasn't, it would sometimes mean that either AMOS or the host device was unable to talk to the BoatServer software until the BoatServer software was forcibly closed and restarted. 

For a while I had been considering going back to the original simple network communications approach that I had started with a couple of years ago: running a TCP server directly on AMOS. This always worked quite well over the home WiFi network, but did not work at all when using the hotspot device on AMOS to get a cellular 4G connection to the Internet. Incoming server connections were not supported over the 4G connection. At least not directly. One possible solution was to make use of the remote.it service that I had used previously for controlling the boat over a PuTTY connection. Unfortunately though, this service seemed to have grown a bit in complexity since I used it last 2 years ago, and I was unable to follow their instructions for installing it on the Raspbian operating system that AMOS uses. So I tried switching to ngrok (https://ngrok.com/) instead, which thankfully worked great and was quite simple to install, allowing me to setup fixed IP addresses and ports for a PuTTY connection and a general TCP network / data connection for communicating between AMOS and the host device software. 

This new reliable mode of network communication was used to include RTK correction data from an RTK base antenna (once again setup on the playhouse roof). An FTDI USB-serial converter was used to receive the RTK correction data at the PC and transmit it to AMOS over the regular data / command link. At AMOS, the RTK data was extracted from the incoming commands and data and sent over a second USB-serial converter to the GPS receiver board, where it was used to apply corrections to AMOS's GPS position. The software running on AMOS was also slightly modified to output a GPS status number which was just 0, 1, or 2 depending on whether no GPS data was available, regular GPS data was available, or RTK-corrected GPS data was available. This was tested out in cold, windy weather this past weekend with pretty good results:


The above screenshot came from the map which was directly uploaded from BoatCaptain to ArcGIS. I'll try to embed the map below:

If the above map does not work, then this link will go directly to the ArcGIS web map: https://arcg.is/eLWaX0. 
I tried to position the boat next to known geographical landmarks: our fence, the corner of the driveway, the mailbox, a telephone pole, etc. At first, AMOS was consistently appearing about 2.5 m northwest of these real-world landmarks, until I realized that the base station position being used (it self-surveyed for about half an hour to find its own base position) was also off by about 2.5 m to the northwest. The GPS software had an option to key in your own latitude, longitude, and elevation. I was unsure of the elevation, so just used the self-surveyed result, but fine-tuning the latitude and longitude to the correct point on the playhouse roof resulted in very accurate AMOS positions, I believe to within 10's of cm of the actual location.
There have been some recent developments occurring in the workshop of Steven Fox. Check out these construction photos of the latest AMOS hull:

Tuesday, May 26, 2020

New Look For the Website!

Jata has been working on improving the appearance of the website; you should definitely go have a look: https://www.innaturerobotics.com/. There are now alternating pictures on the main page, color schemes consistent with the company logo, nice looking fonts and text that is properly lined up, and overall just way better organization and appearance!



This past weekend I realized that so far this year AMOS must have been using an incorrect magnetometer calibration file. I must have copied over an old version of the file by mistake at some point over the winter. Certain orientations like east or southeast were still fairly accurate, which explains why the first couple of tests in April, where AMOS was travelling southeast down the St. John River went well. The previous method that I had used for calibrating the magnetometers involved maximizing and minimizing the X, Y, and Z magnetometer signals by slowly rotating the AMOS- IMU around and observing the data outputs on the screen until the observed min and max values no longer changed. This method could give inaccurate results however if for example there were some occasional spurious low or high outputs. So I decided to try a new method for calibrating just the X and Y magnetometers by rotating them slowly in a horizontal circle. By doing this, it was possible to use an iterative best-fit method to accurately estimate what the X and Y sensor offsets were. Testing out the calibration later on, the accuracy seemed to be typically within +/- 10 degrees, which is good enough for AMOS's navigation needs. On Saturday I took the boat out for a test in the same spot as the week before. It followed the track pretty well, and no towing was required, although I did need to push the boat away from some overhanging trees a few times, since I had forgotten to bring the chicken wire cage to protect the propeller.

The yellow dots and lines correspond to the planned waypoints and routes respectively. The white dots and lines correspond to the actual route that AMOS took, as measured by the GPS. The wind was pretty strong that day, so it was good to see that it could navigate the 4 km course correctly in about two hours.

Here are the interpolated versions of the depth and temperature that the fish finder recorded:



At the moment I'm updating the BoatCaptainMap software to include a lot of the functionality that the old version of the c++ application had. I created a C++ DLL from the old existing code to handle the communications routines, since these were a bit of a pain to write and I didn't want to do it again in c#. I also re-used some of the bitmap button images (stop sign and arrow buttons) from the old app in the new one:


At some point, these will need to be made over too, but for now they're good enough.


Tuesday, May 12, 2020

Ready to Compete!

Our 3 minute pitch presentation was re-worked and fine-tuned this week and in my unbiased opinion it looks awesome! The big event happens tomorrow (Wednesday) at 5:30 pm AST, see https://voltaeffect.com/cohort/ for links to watch online. We are scheduled to be the 4th of 15 teams presenting, at 5:55 pm.

I had been hoping to get AMOS out on the water this weekend for a bit, but the weather did not really cooperate:


We got over 15 cm of snow on Saturday, May 9!!! There isn't really a spring season in New Brunswick. Just winter, 2nd winter, and then black fly season.

Last week this new little GPS stick arrived:

so I plugged it into the Pi and tried it out. From a cold start it wasn't as fast as advertised. It took 5 minutes to find 4 satellites (instead of the advertised 29 seconds). But this was still quite a bit faster than the 15 minutes that it was sometimes taking for the old GPS unit. The specified average accuracy was 5 m, and a quick backyard test (no I didn't really jump over the fence with AMOS) seemed to confirm this:


It's kind of a scary amount of detail that you can get in this Esri / ArcGIS mapping software... it allows you to zoom in even more than the level of this picture. Good thing I wasn't nude sun-bathing when the satellite took that picture. 😎