WaveGlider Acoustic Tracking to ODSS
There is a script running on pismo (currently under the kgomes account) that will connect to WGMS and look for specific commands that indicate it is tracking an acoustic target. It then takes that command position and publishes it as an acoustic target location to the tracking database (and then the ODSS).
You can find the repository and documentation for this script in the repository but I have repeated the README here for documentation purposes.
This software was written in order to pull acoustic tracking positions from the Waveglider. From what I gather, the only way they know where those positions are is by the command log where the gotoWatch command is issued. The idea is that the WaveGlider is being directed to that location because that is where the acoustic position was last determined. So, this script logs into the WGMS system and brings up the command log window (I guess the command listing is not available through the firehose portal) and then parses the page for the gotoWatch commands to get time and lat and lon. It then publishes that position to an AMQP exchange.
Usage
To use this application, you need to have git and Python 2.7.x installed somewhere (recommend virtualenv). After that:
git clonethis project from the repo- Create a directory named
.credentials - Copy the
loginsoap-waveglider-template.xmlfile to the.credentialsdirectory and rename it using the vehicle name you will be querying for. For example. If the name of the waveglider that is tracking is 'tiny', then name of the file would be.credentials/loginsoap-tiny.xml. - Edit this file and put in the login credentials that are used to log in to the WGMS portal.
- cd into the 'configs' folder and make a copy of the template.json file and name it using the same name as in the last step. For example, this file would be named tiny.json.
- In order to properly fill out the .json file you created, you will need some information from the WGMS portal. Login to WGMS portal and then navigate to the Piloting portal.
- Click on "Show System Menus" in the left hand navigation pane.
- In order for this software to work, you need to have an existing "Export" created in the WGMS portal. If you need to create one:
- If there is no existing export that can be used, you will need to create one. If you click on the "Home" section of the left hand navigation pane, then click on 'Raw Outputs' under the Vehicles section in the left pane. You will see a folder icon near the top toolbar that if you pause your mouse over, will show the tool tip "Export Raw Outputs". Click on this.
- A new window will open and you can input the name of the 'Export filter' in the first box. I normally name it '24h gotoWatch vehicle' where 24h let's the user know it will query back 24 hours, the gotoWatch indicates it is looking for 'gotoWatch' commands and the vehicle should be the name of the vehicle used.
- Next select the 'vehicle' entry from the 'Select Column' dropdown, then click on 'Add'
- A new row appears with 'vehicle' as the first column, then click on the 'search' icon to the right and choose the vehicle you want to query against, then click OK
- Then go back up to the 'Select Column' dropdown, select 'Timestamp' and then 'Add'.
- Change the 'Between' dropdown box to the 'Last 24 Hours'.
- TODO kgomes: For some reason, I cannot find the way to add the 'Command Reason -> Contains' query clause for these instructions. There is one in the existing Exports, but I can't figure out how to make a new one. Will need to work on that.
- Once you have the export defined, click "Saved Exports" in the top tool bar. You will get a popup window listing any 'Exports' that have been created in the portal.
- Double click on the export you want to use, a new window will open and you will see an 'orgid' and 'id' in the address bar in the browser. Record those two numbers as you will need them later.
cd configs- Edit the waveglider-name.json file and put the appropriate properties in the correct fields.
- amqp_host is the hostname of the AMQP server where messages will be sent
- amqp_username is the username for the connection to the AMQP server.
- amqp_password is the password to log in to the AMQP server for sending messages
- amqp_vhost is the VHost that messages will be sent to on the AMQP server
- amqp_target_exchange is the name of the exchange on the AMQP server where location messages will be sent to
- amqp_target_platform_type is the type of platform that the waveglider is tracking (auv most likely, but could be drifter, etc.)
- wgms-login-url is the URL where the script will attempt to login to WGMS. Usually of the form: 'https://orgname.wgms.com/webservices/entityapi.asmx'
- wgms-export-url is the URL that the script will call to get the data from your export page. Usually of the form 'http://gliders.wgms.com/pages/exportPage.aspx?orgid=XXX' (where XXX is the orgid that you recorded above)
- goto-watch-send-positions is a true/false flag to indicate if the script should send the gotoWatch parsed command positions. This is so you can run the script and have the capability to turn this feature on or off in case you want to just send the waveglider positions.
- goto-watch-viewid is the viewid number that was created when you created the gotoWatch view and will be the view used to pull and parse the gotoWatch commands
- goto-watch-entity-type Actually, not sure this is necessary, but the call to the view seemed to need this in the body. TODO kgomes, update this as to how you get this number.
- goto-watch-target is the name of the platform that is the acoustic target and is the name that will show up in the tracking database. We usually tack on a '_ac' to the end of the real platform to distinguish that these are acoustically derived positions.
- tz_name is the name of the timezone that the timestamps are expressed as in the WGMS. This should be something like GMT, HST, PDT, PST, etc. and must be the same as what the TZ is for the WGMS data.
- tz_offset_seconds is how many seconds offset the WGMS timezone is from UTC
- Now change up to parent directory using
cd .. - If you are using virtualenv, make sure you are in the virtual env and install the following python packages:
- 'pip install requests'
- 'pip install python-dateutil'
- 'pip install amqplib'
- Run the script using: 'python extract-publish-soap.py --config_name waveglider-name', where wavglider-name is the same used above (i.e. tiny)
MBARI Properties
- orgid:24
- vehicleId:
- Tiny (SV3110) -> 5961
- viewid=88071
- Tiny (SV3110) -> 5961
Hawaii
- orgid:139
- vehicleId:
- Mola: 4286
- viewid=59961
- Mola: 4286