=Paper=
{{Paper
|id=Vol-2331/paper6
|storemode=property
|title=ASVTrafficSim: A simulator for Autonomous Surface Vehicle and Manned Vessel Collisions
|pdfUrl=https://ceur-ws.org/Vol-2331/paper6.pdf
|volume=Vol-2331
|authors=Colin Sauze
}}
==ASVTrafficSim: A simulator for Autonomous Surface Vehicle and Manned Vessel Collisions==
ASVTrafficSim: A simulator for Autonomous Surface Vehicle and Manned Vessel Collisions Colin Sauze Department of Computer Science Aberystwyth University Penglais Aberystwyth Ceredigion United Kingdom SY23 3DB cos@aber.ac.uk Abstract At present there is only limited data about the probability of collisions between autonomous surface vehicles (ASVs) and manned vessels. This paper describes a simulator for calculating the probability of collisions between them. It is intended to help formulate safety advice and policy on where and when ASVs can and can’t be safely used. The simulator tests hypothetical courses of the ASV against real traffic data recorded from automatic identification system (AIS) transponders. This allows simulated missions to be tested against real world traffic patterns. The simulator has successfully simulated example missions using a small set of example AIS data based in San Francisco bay. Future work will involve running simulations from large AIS datasets and with a variety of ASV types, as well as covering differing weather scenarios. 1 Introduction This paper discusses the design and implementation of an Open Source software tool: ASVTrafficSim for calcu- lating the probability of an ASV and manned vessel colliding or having a near miss. It is intended to give ASV operators a tool to evaluate the risk of potential missions and to be able to adjust their mission to reduce this risk. Recent experience from the Microtransat Challenge has been a number of ASVs accidentally retrieved by fishing boats. In several of these incidents the ASVs owners unknowingly planned courses which sailed through fishing grounds. The ability to test their routes for safety in advance might have prevented some of these incidents. ASVTrafficSim uses data recorded from Automatic Identification System (AIS) transponders to compare a simulated course with data from real traffic. By running multiple iterations of ASVTrafficSim each with slightly different courses accurate probabilities of collisions can be determined. It is also possible to determine which times of day, days of the week or times of year might be safer when comparing against regular traffic such as passenger ferries. Copyright c by the paper’s authors. Copying permitted for private and academic purposes. In: S. M. Schillai, N. Townsend (eds.): Proceedings of the International Robotic Sailing Conference 2018, Southampton, United Kingdom, 31-08-2018 63 ROBOTIC SAILING 2018 1.1 AIS AIS transponders broadcast the boat’s maritime mobile service identity (MMSI), position, heading, speed, rate of turn every few seconds over a VHF radio link. AIS is required by all manned vessels over 300 gross tonnes, with many smaller vessels also opting to use the system. Less frequently sent messages can also include the ship’s destination, name and dimensions. Two classes of AIS transmitter are available, class A and class B. Class A is intended for commercial traffic and transmits at higher power (12.5W) and more frequently, its typical range is around 40 nautical miles (Marine Management Organisation, 2014). The lower power class B system is intended for pleasure craft and only uses 2 watts of transmission power and transmits less frequently, its typical range is around 10 nautical miles(Marine Management Organisation, 2014). This lower power and frequency combined with many smaller boats still not being equipped with AIS mean that data for small craft is often lacking. A number of internet linked shore receivers pass on data to web services such as MarineTraffic (Marine Traffic, 2018) and AISHub (AISHub, 2018). In recent years satellite based reception has also become increasingly common, allowing sites like MarineTraffic to cover traffic out of range from shore. Analysis of shipping patterns from AIS data has become increasingly common (Ristic et al., 2008) (Fiorini et al., 2016). One common output of these analyses is traffic density maps which show a generalised view of how busy an area is. MarineTraffic(Marine Traffic, 2018), the US Coastguard(Beuaru of Ocean Energy Management, 2018) and UK government(Marine Management Organisation, 2014) are amongst those publishing density maps. Although these density maps can form a useful tool in planning ASV operations they are relatively crude and often lack time of day, day of week or time of year specific information. ASVTrafficSim aims to provide more a detailed and specific view of the risks involved with travelling a given route. 1.2 AIS Data Sources To test against real traffic patterns a source of AIS data was needed. There are a number of commercial sources of AIS data, however the cost of obtaining raw data from these was prohibitively expensive and not an option for this research. Several free alternatives were identified. The Marine Cadstre (Beuaru of Ocean Energy Management, 2018) from the US Coastguard offers a large amount of AIS data, but this is formatted for the commercial ArcGIS software and is difficult to read without ArcGIS. Several volunteer run networks make data freely available online. These include AISHub (AISHub, 2018) and aprs.fi. The data on aprs.fi was found to be lacking in coverage and there don’t appear to be many AIS receivers in their network. AISHub operates an exchange where free access to data is given in return for contributing data. At time of writing the author has not setup a receiver capable of contributing to AISHub, but intends to do so in future. The Exploratorium Museum in San Francisco operates a receiver on the San Francisco seafront that continuously streams raw data to their website (ais, a). Greenpeace have a collection of 1.2 million messages taken over two days in 2014 is available from their github page (ais, b). This data is in raw NMEA format and can be decoded using the open source LibAIS (Schwehr, 2015) software. 2 ASVTrafficSim ASVTrafficSim is an open source tool written in Python, it is available from (Sauze, 2018). It simulates sailing of a target route using the open source Sailsd simulator(Taylor, 2016) which has a reasonably accurate physics model based upon work by (Jaulin and Le Bars, 2012). The autopilot logic for controlling Sailsd operates through Boatd, another open source tool for presenting an HTTP and JSON based interface to an ASV. Output from Boatd is sent over a UDP datastream in the form of NMEA0183 GPS strings, these are received and processed by ASVTrafficSim’s collision detector which uses them to establish the ASV’s current location. Upon starting ASVTrafficSim loads a datafile of AIS messages and parses these with LibAIS, extracting each report’s Maritime Mobile Service Identity (MMSI), ship name (where given), latitude, longitude and time. This data was then used to test for collisions at the simulated time and location. Figure 1 shows how these components are integrated and communicate with each other. AIS data is interpolated between data points on a 1 second basis. Typically class A AIS data is transmitted every few seconds, so there is relatively little error in the interpolation. However class B messages are less frequent, typically being 10s of seconds apart and due to the lower power they are often not received as easily by shore stations. The linear interpolation was limited to a maximum of 15 minutes so that boats which are moored and have switched off their AIS aren’t projected as continuing to travel. This linear interpolation method will not be completely accurate as it only uses the last heading and speed and ignores if the boat was rotating. A 64 Safe Navigation small improvement to the accuracy of class B interpolation might also be possible using polynomial interpolation instead of linear interpolation. Figure 1: The data flows between the components in ASVTrafficSim and its dependencies. The Sailsd simulator operates on a realtime basis, to maintain realism ASVTrafficSim also does this. Each second that time advances in Sailsd corresponds to one second in AIS data of ship movements. This does have the disadvantage of simulations taking a long time to run. Ship movements are linearly interpolated between data points in the AIS data and these are generated on a second by second basis. At each one second iteration the position of every ship is compared with the position of the simulated ASV. Ideally collisions could be calculated by looking at the ship’s dimensions and working out if it overlapped with the ASV. Unfortunately the Exploratorium AIS dataset is missing any messages covering boat dimensions. Therefore any ship getting within 10 metres of the ASV is considered to be a collision and 100 metres a near miss. All collisions and near misses are recorded and saved by the output map generator. This saves data into a GPX file along with the ship and ASV tracks. 3 Results A simulated course was setup to sail a square around Alcatraz Island in San Francisco harbour, the simulation was set to use a northerly wind requiring upwind tacking on the northbound leg of the course. This crosses busy shipping channels in and out of San Francisco bay, tourist boat traffic going to and around the island and ferries operating from the city centre. The course taken on this route is shown in figure 2. The 2014 Exploratorium dataset from the Greenpeace was used to supply traffic information. The simulation run took place between 12:40 and 14:53 UTC (4:40 and 6:53 PST) on November 26th 2014. These times represent the start of the AIS dataset. 10 laps of the course were completed in this time. In running this simulation for just over two hours, there were two collisions and 69 near misses. All of these were with the ferry Zelinsky which operates tours around the island. Both of the collisions occurred when the boats were less than 10 metres apart over the course of two seconds. The near misses are clustered into two areas, one on the western side of the course where both boats were sailing in parallel and very closely. The others are either side of the point where the collision occurred. Figure 3 shows a map of this output, with the near misses marked as triangles and the collisions as circles. 65 ROBOTIC SAILING 2018 Figure 2: A map showing the waypoints used in the test route. Each waypoint is indicated with a triangle. Map from NOAA ENC Chart US5CA13M (National Oceanic and Atmospheric Administration, 2018). Figure 3: A map showing the collisions and near misses between the simulated ASV and real traffic. Each near miss is indicated with a triangle and a collision with a circle. The two collisions are within a few metres of each other and the first is obscured by the second in this map. The red line around the island is the ASV’s track and the dark blue line is from the ferry Zelinsky. The other coloured tracks are from other vessels. Map tiles from Stamen, licensed under CC BY 3.0. Map data from Open Street Map contributors, licensed under CC BY-SA. 4 Conclusion This work demonstrates the viability of ASVTrafficSim for detecting potential collisions. It allows fine grain identification of which vessels a collision occurred with or came close to occurring with. This is particularly valuable when planning routes in areas with regular traffic such as ferries. By running multiple simulation runs with differing start times or route predictions over wider areas can also be obtained. 66 Safe Navigation 5 Future Work Future work will involve improving the usability and accuracy of ASVTrafficSim. Usability could be improved so that a user can simply input the parameters of their USV and intended course and then receive a report showing the collisions and near misses. Currently the user must start five different programs to run the simulation, although Docker and Singularity containers are available to simplify this. Run times could be reduced by removing the real time nature of the simulator and running at faster than real time. At present the physics model available within Sailsd is still somewhat unrealistic. More fine tuning of its parameters is required to match the performance of a real USV. It does not include the effects of sea state, tides, currents or simulate any variations in the wind. A more realistic simulation could be achieved by including these variables. Tides are of particular importance given how small ASVs are often unable to travel fast enough to fight against strong tides. To give a clearer idea of the probability of a collision a monte carlo method could be used with the simulation being repeated many times with small random variations in weather conditions or the course being sailed. The use of larger AIS datasets will also help to improve the range of simulations which can be run and the geographic areas which can be tested. Obtaining AIS data remains an obstacle, although commercial providers of such data exist their prices are prohibitively expensive. AISHub (AISHub, 2018) is a potential alternative to this as they will provide access to data from their network in exchange for contributing a receiver. Alternatively datasets could be generated by setting up receivers comparable to the one used by the Exploratorium. Acknowledgements The author would like to thank Louis Taylor with his help with getting Boatd and Sailsd to work with this project. We acknowledge the support of the Supercomputing Wales project, which is part-funded by the European Regional Development Fund (ERDF) via Welsh Government. References AIS Exploratorium. http://ais.exploratorium.edu (Accessed Aug 2nd 2018). AIS Exploratorium Data - November 26th-27th 2014. https://github.com/greenpeace/oceansofdata/tree/ master/ais-exploratorium-edu (Accessed Aug 2nd 2018). AISHub (2018). AIS Data Exchange. http://www.aishub.net (Accessed Aug 2nd 2018). Beuaru of Ocean Energy Management (2018). Marine cadastre national viewer. https://marinecadastre.gov/ nationalviewer/ (Accessed Aug 2nd 2018). Fiorini, M., Capata, A., and Bloisi, D. D. (2016). AIS data visualization for maritime spatial planning (msp). International Journal of e-Navigation and Maritime Economy, 5:45 – 60. Jaulin, L. and Le Bars, F. (2012). A simple controller for line following of sailboats. In proceedings of the 5th International Robotic Sailing Conference, Cardiff, United Kingdom, September 2012, pages 117–129. Marine Management Organisation (2014). Mapping UK shipping density and routes from AIS. Marine Traffic (2018). Global ship tracking intelligence. http://www.marinetraffic.com (Accessed Aug 2nd 2018). National Oceanic and Atmospheric Administration (2018). ENC chart US5CA13M: San francisco bay candlestick point to angel island. http://www.charts.noaa.gov/ENCs/Agreement.shtml?US5CA13M (Accessed Aug 2nd 2018). Ristic, B., Scala, B. L., Morelande, M., and Gordon, N. (2008). Statistical analysis of motion patterns in AIS data: Anomaly detection and motion prediction. In 2008 11th International Conference on Information Fusion, pages 1–7. Sauze, C. (2018). ASVTrafficSim. https://github.com/colinsauze/ASVTrafficSim (Accessed Aug 2nd 2018). Schwehr, K. (2015). LibAIS. https://github.com/schwehr/libais (Accessed Aug 2nd 2018). Taylor, L. (2016). Sails simulator: A set of tools for robotic sailing boat simulation. https://github.com/ sails-simulator (Accessed Aug 2nd 2018). 67