Tuesday, March 31, 2020

Box Cat AMOS and Old Dog Learning New Software

The bottom half of the Catamaran AMOS was fiberglassed this week and the whole thing (without electronics) weighed in at 14.6 lbs. This is a bit heavier than the fiberglassed AMOS surfboard, which was only 10.6 lbs, but is to be expected, since the aluminum plates joining the Catamaran pontoons weighed 6.8 lbs. I feel like it would definitely be possible to cut a few pounds by using smaller plates, but this should be OK for now.

Ideally I would like to use smaller electronics enclosures than what I used before, and embed them into the pontoons to cut down on wind resistance, but I'll hold off trying that until after verifying the maneuverability of the boat in the water. So for now, it's just the same old electronics boxes:


The rest of this post will delve a bit into programming nerdiness, so if you have something better to do, go ahead and x this browser tab, I won't mind.

I have neglected the actual code operating on AMOS for a few months now, not really wanting to write something that couldn't be easily tested with all the local waterways frozen. Adding the code for reading in files with picture commands and then taking high resolution pictures at the desired heading(s) could be easily tested indoors, so that occupied a day or two, and seemed to work fine.

The mapping application for AMOS (called "BoatCaptainMap" for now) had some weird disabled navigation arrows in the top-left corner:


They were always there, but for some reason I only just noticed them this past week. After hours of reading, Googling, and frustration I eventually discovered that they were there because I was using a "UserControl" to hold the map grid, when I should have been using a regular Window instead. Fortunately it was relatively straightforward to transition the application to use a Window.

Here is a list of the menu headers and their associated menu items that I have identified for now as being the core user functions required for this app:

File: Load Map, Save Map, Download data file, Download log file, Download image files, Download AMOS code, Send AMOS code, Exit

Preferences: Connection, Alarms, Route, Sensors, Camera, LiDAR (object avoidance), Battery

Data: View data, Map view, Time view, Edit data, Data settings, Export data, Import data

Help: About, User Manual, Website

Some of these functions exist (at least partially) in the older BoatCaptain software, or in test code that I have written recently, but most of them are new functions which will need to be added over the next month or so.

Yesterday I started working on the "Save Map" function, which ideally should take the entire map (of data, or the route, or whatever) as it appears on the screen and save it to the user's ArcGIS account. There are more than a few examples floating around online of how to do this, and I happened to pick one that looked suitable, only to eventually discover after many hours (at 2:30 am) that it was an outdated example that wasn't really correct. I guess security-aware software that uses stuff like OAuth2 or similar technology needs to be updated from time to time, to ensure that it is still as secure as possible. After using more recent documentation and code, I was able to get it working, only to discover that the graphics overlays of sensor points and lines for AMOS to follow that I had in the app were not getting saved to the ArcGIS web map. Argh. Turns out that ArcGIS doesn't allow you to store graphic overlays to their system; rather you need to add things called "features" or "feature sets" to your map, and then those can be properly stored online. I think that the features can actually look the same as graphic overlays, but of course they are programmed differently, so it looks like I'll have to backtrack a bit and re-do most of my graphics code.




No comments:

Post a Comment