toward maritime robotic simulation in gazebo

10
Toward Maritime Robotic Simulation in Gazebo Brian Bingham Naval Postgraduate School [email protected] Carlos Ag¨ uero Open Robotics [email protected] Michael McCarrin Naval Postgraduate School [email protected] Joseph Klamo Naval Postgraduate School [email protected] Joshua Malia Naval Postgraduate School [email protected] Kevin Allen University of Florida kmallen@ufl.edu Tyler Lum University of British Columbia [email protected] Marshall Rawson University of Florida marshallrawson@ufl.edu Rumman Waqar University of London [email protected] Abstract—Simulation plays an important role in the development, testing and evaluation of new robotic appli- cations, reducing implementation time, cost and risk. For much of the robotics community, the open-source Gazebo robot simulator has emerged as the de facto standard envi- ronment for prototyping and testing robotic systems. While Gazebo offers strong support for terrestrial, aerial and space robotics applications, less support is available for ma- rine applications involving vehicles at and below the water surface. To address this deficiency, we present the Virtual RobotX (VRX) simulation, a general purpose open-source development and testing tool, based on Gazebo, capable of approximating the behavior of unmanned surface vessels operating in complex ocean environments. We highlight the application of these capabilities using the VRX challenge reference implementation, a new simulation-based robot competition designed to complement the physical Maritime RobotX Challenge. I. I NTRODUCTION The open-source Virtual RobotX (VRX) simulator 1 is designed to support the development, testing and evalu- ation of unmanned surface vehicles operating in ocean environments. VRX extends the Gazebo robot simulator through the addition of new domain-specific elements including environmental models, vessel dynamics repre- sentations, sensor emulation and general purpose ocean object models. The new capabilities featured in the VRX simulator include: Wave representations, based on ocean spectra, to influence vessel motion, visual rendering and sensor feedback. The Maritime RobotX Challenge and Virtual RobotX Challenge projects are sponsored by the Office of Naval Research. 1 https://bitbucket.org/osrf/vrx/ Water surface visual representation, including ap- proximation of reflection and refraction. Stochastic wind speed representation to influence vessel motion. Parameterized six degree-of-freedom surface vessel model. Approximation of buoyancy forces on geometric objects to simulate floating objects. Lidar (3D) simulation, including interaction with water surface. A configurable propulsion system with a parame- terized non-linear thrust model. These new capabilities are applicable to a wide range of ocean robotic scenarios. The specific reference imple- mentation, which serves as a demonstration of these new features, is the VRX challenge, a new simulation-based robot competition designed to complement the physical Maritime RobotX Challenge. This competition uses a common vessel platform, the wave adaptive modular vessel (WAM-V), and includes a series of robotic tasks meant to stimulate innovation in maritime autonomy. To support this competition, the VRX simulator approxi- mates a number of aspects of the WAM-V platform including a 3D visual model, dynamic and hydrodynamic characteristics, collision model, coefficients to character- ize wind effects and non-linear static thruster behavior. The propulsion and sensor configuration is parameterized to allow users to easily specify the exact configuration of the vessel under test. In addition the VRX simulator provides models (visual, collision and dynamic) of the elements used in competition tasks, including navigation

Upload: others

Post on 18-Dec-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Toward Maritime Robotic Simulation in Gazebo

Toward Maritime Robotic Simulation inGazebo

Brian BinghamNaval Postgraduate School

[email protected]

Carlos AgueroOpen Robotics

[email protected]

Michael McCarrinNaval Postgraduate School

[email protected]

Joseph KlamoNaval Postgraduate School

[email protected]

Joshua MaliaNaval Postgraduate School

[email protected]

Kevin AllenUniversity of Florida

[email protected]

Tyler LumUniversity of British Columbia

[email protected]

Marshall RawsonUniversity of Florida

[email protected]

Rumman WaqarUniversity of [email protected]

Abstract—Simulation plays an important role in thedevelopment, testing and evaluation of new robotic appli-cations, reducing implementation time, cost and risk. Formuch of the robotics community, the open-source Gazeborobot simulator has emerged as the de facto standard envi-ronment for prototyping and testing robotic systems. WhileGazebo offers strong support for terrestrial, aerial andspace robotics applications, less support is available for ma-rine applications involving vehicles at and below the watersurface. To address this deficiency, we present the VirtualRobotX (VRX) simulation, a general purpose open-sourcedevelopment and testing tool, based on Gazebo, capable ofapproximating the behavior of unmanned surface vesselsoperating in complex ocean environments. We highlight theapplication of these capabilities using the VRX challengereference implementation, a new simulation-based robotcompetition designed to complement the physical MaritimeRobotX Challenge.

I. INTRODUCTION

The open-source Virtual RobotX (VRX) simulator1 isdesigned to support the development, testing and evalu-ation of unmanned surface vehicles operating in oceanenvironments. VRX extends the Gazebo robot simulatorthrough the addition of new domain-specific elementsincluding environmental models, vessel dynamics repre-sentations, sensor emulation and general purpose oceanobject models. The new capabilities featured in the VRXsimulator include:• Wave representations, based on ocean spectra, to

influence vessel motion, visual rendering and sensorfeedback.

The Maritime RobotX Challenge and Virtual RobotX Challengeprojects are sponsored by the Office of Naval Research.

1https://bitbucket.org/osrf/vrx/

• Water surface visual representation, including ap-proximation of reflection and refraction.

• Stochastic wind speed representation to influencevessel motion.

• Parameterized six degree-of-freedom surface vesselmodel.

• Approximation of buoyancy forces on geometricobjects to simulate floating objects.

• Lidar (3D) simulation, including interaction withwater surface.

• A configurable propulsion system with a parame-terized non-linear thrust model.

These new capabilities are applicable to a wide rangeof ocean robotic scenarios. The specific reference imple-mentation, which serves as a demonstration of these newfeatures, is the VRX challenge, a new simulation-basedrobot competition designed to complement the physicalMaritime RobotX Challenge. This competition uses acommon vessel platform, the wave adaptive modularvessel (WAM-V), and includes a series of robotic tasksmeant to stimulate innovation in maritime autonomy. Tosupport this competition, the VRX simulator approxi-mates a number of aspects of the WAM-V platformincluding a 3D visual model, dynamic and hydrodynamiccharacteristics, collision model, coefficients to character-ize wind effects and non-linear static thruster behavior.The propulsion and sensor configuration is parameterizedto allow users to easily specify the exact configurationof the vessel under test. In addition the VRX simulatorprovides models (visual, collision and dynamic) of theelements used in competition tasks, including navigation

Page 2: Toward Maritime Robotic Simulation in Gazebo

aids, buoys, obstacles and docks.Although simulation is never a substitute for physical

field experimentation, the VRX simulator offers suf-ficient fidelity to enable developers to prototype newsolutions, with the aim of transitioning smoothly toon-water deployments for tuning and refinement. Themodels used in the simulator are designed so that thekind of response experienced in simulation is equivalentto that experienced in the field, even if the degree ofthe response is different. The result is a simulation envi-ronment simple enough to execute faster than real-timesimulations with sufficient fidelity to guide choices onthe kind of autonomy necessary for the salient challengesof the ocean environment. The simulator design adheresto the following rubric: autonomy that does not workin simulated world will not work in the physical world,and autonomy that does work in the physical world willwork in the simulated world.

A. Related Work

1) Gazebo Simulation: Gazebo was created in 2002to support development of ground robot applicationsfor indoor and outdoor environments [1]. Since thenGazebo has become a mature open-source project thatis developed and relied upon by the global roboticscommunity for a wide variety of applications. Gazeboemploys a highly modular approach to provide the fourkey components needed for robot simulation.

1) To resolve collision, contact, and reaction forcesamong rigid bodies, Gazebo supports the use ofmultiple physics engines.

2) Gazebo has an extensive library of common robotsensors, such as camera, laser, sonar, GPS, andIMU, as well as standard noise models that can beparameterized as needed.

3) Gazebo supports multiple interfaces allowing usersto interact programmatically with the simulation,including C++ (for writing plugins), a customnetwork transport, and Robot Operating System(ROS) messaging.

4) Gazebo includes a graphical interface that allowsexploration and manipulation of the 3D simulatedworld.

Gazebo has been extended to support a varietyof domain-specific applications such as the DARPARobotics Challenge (DRC) [2], the NASA SpaceRobotics Challenge (SRC) [3], the DARPA Hand Pro-prioception & Touch Interfaces (HAPTIX), the NISTAgile Robotics for Industrial Automation Competi-tion (ARIAC), the DARPA Service Academies Swarm

Challenge (SASC), the DARPA Robotic Servicing ofGeosynchronous Satellites (RSGS) and NASA Lunarexploration [4].

2) Marine Robotics Simulation: While a standardsimulator for marine robotics is not yet available, a num-ber of groups have recognized the need for simulationas part of the development process and highlighted theunique challenges of marine simulations, particularly forunderwater applications [5]–[7]. Some of these simula-tions build upon the foundation of Gazebo [8], [9] andothers use different underlying simulation frameworksto emulate the dynamics. An overview of the currenttechnology is provided by [10].

3) Wave Induced Forcing: The proposed approach toapproximating wave induced motion uses evaluation ofrestoring forces at discrete locations along the vesselhull. A similar approach is used by [11] to generaterepresentative ship motion for the purposes of operatortraining in virtual reality. A related method was usedby [12] and validated using a higher fidelity, non-real-time model and experimental results. This approach iseven further simplified in [13] to generate roll, pitch andheave motion by evaluating the wave height at just fourlocations along a mono-hull. In this previous work thevessel hull is approximated as a cuboid and the waterheight is evaluated at 1× 1 m grid points. Single forcesfor heave, pitch and roll are obtained from the discreteheight fields. Because of the geometry of the WAM-V,a catamaran with approximately circular demi-hulls, wecan solve for the displacement directly as a function ofhull location relative to water height.

II. ENVIRONMENT MODELING

A key aspect of extending the Gazebo robotics simula-tor to support maritime robotics is the ability to representthe influence of the ocean environment on the roboticsystem. The two important environmental influences wemodel are the waves and wind.

A. Wave Modeling

We adapt the approach proposed in [14] to representocean waves based on oceanographic statistical descrip-tions that are visually realistic. The model balancesphysical fidelity, visual realism and computational com-plexity.

1) Gerstner Waves: Gerstner waves, a common rep-resentation in computer graphics [15], [16], represent thewater surface as a trochoidal shape. While closely relatedto a regular sinusoidal shape, Gerstner waves of largeramplitude exhibit sharper crests and broader troughs pro-viding for additional visual realism. We model the water

2

Page 3: Toward Maritime Robotic Simulation in Gazebo

surface using a summation of Gerstner waves where anundisturbed horizontal location is x0 = (x0, y0) with avertical height of ζ0 = 0. The wave field is representedas horizontal (x) and vertical (ζ) displacements relativeto this undisturbed location, and can be expressed as

x(x0, t) = x0 (1a)

−N∑i=1

qi(ki/ki)Ai sin (ki · x0 − ωit+ φi)

ζ(x0, t) =

N∑i=1

Ai cos (ki · x0 − ωit+ φi), (1b)

where each component wave has an associated amplitude(Ai), wavenumber (ki), angular frequency (ωi), steep-ness (qi) and random phase (φi). The wave numberk is related to the wavelength λ by k = 2π/λ. Thewavevector (ki) is a horizontal vector in the direction oftravel with magnitude ki. A single steepness parameter(q) is specified between [0.0, 1.0] where a value ofq = 0.0 yields regular sinusoidal wave shapes and avalue of q = 1.0 yields maximum wave crest steep-ness. The individual steepness values are constrained byqi = min (q, 1/(kiAi)) to prevent loops forming in thewave crests, a phenomenon which is not physically real-izable. We use the linear, infinite water depth dispersionequation to relate the angular frequency and wavenumberas ω2 = gk where g is the acceleration of gravity.

2) Wave Spectrum: If visual fidelity were the soleconsideration, empirically selecting a small set of com-ponent wave amplitudes and directions for use in (1)can generate qualitatively realistic wave fields, but withlimited connection between the simulated wave field andthe physical ocean environment. One method to generatecomponent wave characteristics representative of a par-ticular ocean and weather condition is to generate theseparameters by sampling a parametric wave spectrum[14], [17], [18]. The wave spectrum S(ω) captures themean energy in a wave field as a function of angularfrequency (ω). A number of standard ocean spectra canbe used to describe the wave field environment [19]. In[18] a single-value Pierson-Moskowitz wave spectrumis sampled to generate the wave field. The Pierson-Moskowitz spectrum represents a fully developed seain deep water and depends upon specifying the peakangular frequency (ωp) or the significant wave height(Hs) which are related by

Hs =0.162(g)

ω2p

. (2)

We find that the two-parameter Pierson-Moskowitzspectrum (often referred to as a Bretschneider spectrum)

provides both physical relevance and user customizabil-ity while maintaining a simple formulation. The two-parameter spectrum is specified by the peak frequencyand an independent significant wave height Hs:

SB(ω) =1.25

4

(ω4p

ω5

)(Hs)

2 exp

[−5

4

(ωpω

)4]. (3)

We introduce a user-specified non-dimensional gainvalue,

KH =Hs

Hs, (4)

as the ratio of desired significant wave height to thesignificant wave height from the one-parameter Pierson-Moskowitz spectrum (2). The resulting expression forthe simulated wave field is

SB(ω) = (KH)2 αg

2

ω5exp

[−5

4

(ωpω

)4]

(5)

where α = 8.1 × 10−3. For the purposes of generatinglinear, sinusoidal waves from a spectrum, the amplitudeof a particular wave component (Ai) is related to thespectrum by

A2i = 2

∫∆ωi

S(ω)dω ≈ 2S(ωi)∆ωi(6)

where ωi are the sample locations along the spectrumand ∆ωi is width of the frequency band associated withthe individual samples.

The user interface for defining a particular simulatedwave field consists of specifying the two-parameterPierson-Moskowitz spectrum via the peak period, Tp =(2π)/ωp, and wave height gain multiplier KH from(4). Example spectra are shown in Fig. 1 to illustratethe ability to independently specify the characteristicperiod (frequency) and wave height of the desired wavefield. Once the spectrum is defined, the individual waveamplitude values are determined by sampling the wavespectrum according to (6).

3) Directional Spectra: For modeling the directionof wave components within the wave field we followthe general approach of [18], but pre-calculate the rela-tionship between wave characteristics (period, frequency,etc.) and directionality in order to reduce computationalcomplexity.

The direction of wave travel can be taken into accountusing the directional wave spectrum expressed as

E(ω, θ) = S(ω)D(ω, θ) (7)

where θ represents the wave direction and D(ω, θ) is thedirectional spreading function.

3

Page 4: Toward Maritime Robotic Simulation in Gazebo

Fig. 1. Two-parameter Pierson-Moskowitz wave spectrum shown as afunction of wave period for a series of peak period (Tp) values, usingtwo different wave height gains (KH ).

The form of D(ω, θ) is based on the empirical re-lations that were proposed in [20]. The directionalityis a function of the normalized frequency ω = ω/ωpand can be expressed as a function of the differencebetween the angle and the mean angle, ∆θ = θm − θ.The directionality function is then

D(ω,∆θ) = N(s(ω)) cos (∆θ/2)2s(ω) (8)

where the normalizing function

N(s(ω)) =

(1

2√π

)Γ(s(ω) + 1)

Γ(s(ω) + 1/2)(9)

uses the gamma function Γ() and the function

s(ω) =

{17.01 ω5 if ω ≤ ωp17.01 ω−2.5 if ω > ωp

. (10)

The shape of the directionality depends upon the compo-nent frequency. Spectral components near the peak fre-quency contain the majority of the wave energy and havea more narrow directional distribution, tending to travelin the mean direction. Spectral components on either sideof the peak frequency tend to have larger variation indirection of travel, in particular lower frequency (longerperiod) components have a wider distribution of direc-tions than high frequency (shorter period) components.

To characterize the width of the directional spreadingfunction we use the second moment

µ2(ω) =

∫ π

−π(∆θ)2D(ω,∆θ)d(∆θ) (11)

which we evaluate numerically. This relationship is pre-computed and used as a lookup table for the componentwaves which make up the wave field. For each wavecomponent in (1) the direction of the wavevector isdetermined by the user-specified mean direction and anadditional random direction component. This additionalcomponent is generated as a sample from a zero mean,normally distribution with a variance set equal to µ2(ω).

4) Specifying a Wave Environment: To summarize,the user specifies the directional two-parameter Pierson-Moskowitz spectrum through the peak period (Tp), waveheight gain (KH ) and mean wave direction. The user alsospecifies the wave steepness (q). The remaining param-eters of the Gerstner waves (1) are determined basedon sampling the wave spectrum and using the lineardeep water dispersion relation. The resulting wave fielddescription provides a three dimensional representationof the ocean surface. The representation is used by boththe visual and physical aspects of the simulator to excitethe physical motion of bodies at the water surface and togenerate the user interface and sensor (camera) views.

B. Wind ModelingWind is a significant disturbance for objects at the

sea surface. We consider the total wind speed Vw(t)consisting of the sum of the constant mean wind speed(v) and the temporally varying, zero-mean, variable windspeed (vg(t)), i.e., Vw(t) = v+vg(t). The user specifiesthe following aspects of the wind:• the constant wind direction (βw),• the constant mean wind speed (v), and• the standard deviation (σg) and time constant (τg)

of the variable component of the wind speed.The variable component of the wind speed is modeled

as a first-order, linear approximation of the Harris spec-trum [21] with time constant τg as reported in [22]. Weexpress the spectrum as the transfer function

h(s) =Kw

1 + τgs(12)

where Kw is the magnitude of the response. In discretetime the variable wind speed at time k + 1 is generatedas

vg[k + 1] = vg[k] + (1/τg)(−vg[k] +Kwn[k])δt (13)

where n[k] is a pseudo-random number generated witha Gaussian distribution, zero mean and unity varianceand δt is the simulation time step. The spectrum of thevariable wind speed generated by (13) is

Sg(ω) =

{K2

w

1+(ωτg)2 δt, |ω| < ωs/2

0, |ω| ≥ ωs/2(14)

4

Page 5: Toward Maritime Robotic Simulation in Gazebo

where ωs is the sampling frequency of ωs = 2π/δt.Assuming that ωs >> 2π/T , we can find the value ofthe parameter Kw necessary to produce the variable windcomponent with the user specified standard deviation andtime constant as

Kw = σg

√2τgδt. (15)

III. VEHICLE MODEL

To approximate the motion of a vehicle in the oceanenvironment, we adapt Fossen’s six degree-of-freedomrobot-like vectorial model for marine craft [23] ex-pressed as

MRBν +CRB(ν)ν︸ ︷︷ ︸rigid body forces

+

MAνr +CA(νr)νr +D(νr)νr︸ ︷︷ ︸hydrodynamic forces

+ g(η)︸︷︷︸hydrostatic forces

= τpropulsion + τwind + τwaves

(16)

where

η = [x, y, z, φ, θ, ψ]T (17a)ν = [u, v, w, p, q, r]T (17b)

are position and velocity vectors respectively for surge,sway, heave, roll, pitch and yaw. The total velocity, ν, isthe sum of an irrotational water current velocity, νc, andthe vessel velocity relative to the fluid, νr, i.e., ν = νr+νc. The forces and moments due to propulsion (control),wind and waves are represented as τpropulsion, τwindand τwaves.

Traditionally, surface vessel models are often sepa-rated into maneuvering models (representing the surge,sway and yaw degrees-of-freedom) and seakeeping mod-els (representing the heave, pitch and roll degrees-of-freedom). For the purposes of supporting developmentof autonomy, it is important that the unified simulationmodel include both maneuvering and seakeeping compo-nents, but our approach to formulating each componentis slightly different. The maneuvering aspects of themodel influence the vessel motion control. Becausethe motion control should account for rigid-body andhydrodynamic terms, these aspects of the model includeadditional detail. If the model is to demonstrate theappropriate type of dynamics to exercise these aspectsof motion control, it is necessary to include the addedmass and non-linear damping hydrodynamic terms; ne-glecting these hydrodynamic terms would result not justa different degree of response, but a different kind ofvessel response.

On the other hand, while inclusion of the seakeepingaspects of the model is critical for exercising the sensoryperception capabilities of the autonomy solution, the hy-drodynamics in this portion of the model can be simpli-fied while preserving the appropriate type of response. Inthe seakeeping degrees-of-freedom we neglect the added-mass and non-linear damping terms without changing thekind of vessel response the simulation produces to inducesensor motion than can impact perception. Includingthese terms would change the degree of the response,perhaps with more fidelity, but not a different typeresponse. For the intended uses of the VRX simulationthese changes in degree do not justify the additionalcomplexity and challenges associated with estimatingthese model terms empirically.

A. Hydrodynamic Forces

The hydrodynamic forces in (16) include the addedmass terms due to inertia of the surrounding fluid andhydrodynamic damping. The hydrodynamic derivativesare expressed using SNAME (1950) notation [23]. Thesimplified added mass matrix is expressed as

MA = −

Xu 0 0 0 0 00 Yv 0 0 0 Yr0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 00 Nv 0 0 0 Nr

(18)

where Nv = Yr. The Coriolis-centripetal matrix for theadded mass is expressed using the same hydrodynamicderivatives

CA(νr) =0 0 0 0 0 Yvvr + Yrr0 0 0 0 0 −Xuur0 0 0 0 0 00 0 0 0 0 00 0 0 0 0 00 0 0 −Yvvr − Yrr Xuur 0

.(19)

The hydrodynamic damping includes forces due toradiation-induced potential damping, skin friction, wavedrift damping, vortex shedding and lifting forces [23],[24]. These effects are aggregated in the hydrodynamicdamping matrix

D(νr) = Dl +Dl(νr) (20)

5

Page 6: Toward Maritime Robotic Simulation in Gazebo

expressed as a sum of linear and quadratic terms:

Dl = −

Xu 0 0 0 0 00 Yv 0 0 0 Yr0 0 Zw 0 0 00 0 0 Kp 0 00 0 0 0 Mq 00 Nv 0 0 0 Nr

(21)

and

Dn(νr) = −

Xu|u||ur| 0 0

0 Yv|v||vr|+ Y|r|v|r| 00 0 00 0 00 0 00 N|v|v|vr|+N|r|v|r| 0

0 0 00 0 Y|v|r|vr|+ Y|r|r|r|0 0 00 0 00 0 00 0 N|v|r|vr|+Nr|r||r|

.(22)

This approximation of the hydrodynamic effects isimplemented as parameterized Gazebo plugin. The userdefines the characteristics of the vessel under test througha vessel-specific configuration file that includes the hy-drodynamic derivatives. During each time step of thesimulation, the plugin is executed with access to the stateof the vessel and environment. The hydrodynamic forceterms in (16) are calculated based on this state infor-mation and the user-defined vessel characteristics. Theresulting force and moment values are then applied tothe vessel through the Gazebo application programminginterface (API) for inclusion in the next iteration of thephysics engine.

This simplified six degree-of-freedom model and theGazebo plugin are generally applicable to surface ves-sels. Applying this model to a specific vessel requiresdetermining values for the hydrodynamic derivatives.These values can be approximated from first principles(e.g., potential flow theory) or estimated through ex-perimental testing (e.g., scale model testing). In [25]the authors estimate the hydrodynamic derivatives fora three degree-of-freedom model of the WAM-V vesselby manually tuning the coefficients so that the modeloutputs agree with experimental measurements from at-sea maneuvering tests. Each of the of linear drag termsin (21) are estimated, but only the surge term in thequadratic drag matrix (22) is identified, implying that theremaining quadratic terms are neglected. These specific

values are adopted for modeling the WAM-V within thesimulation as part of the VRX challenge use-case.

B. Hydrostatic and Wave Forces

The presence of ocean waves has two important effectsin the context of developing autonomy for surface ves-sels: motion control effects and perception effects. Thesetwo effects are captured in the vessel model hydrostatic(g(η)) and wave excitation (τwaves) terms in (16) and bythe wave modeling presented in Section II-A. The visualmodel is implemented as a custom OpenGL shader torender the water surface based on the wave state. Thephysical model uses the wave surface state at the vessellocation to approximate the induced motion.

For the WAM-V catamaran, a discretization of eachdemi-hull is performed based on the user-supplied gridresolution, N . Algorithm 1 outlines the structure of theGazebo plugin used to generate the effect of incidentwaves. On line 11 the wave force is generated based onthe position and velocity of the vessel grid point, thevelocity at the corresponding location on the wave fieldsurface and the demi-hull geometry. This restoring forceis applied to the corresponding vessel location using theGazebo API to generate the wave induced motion.

Algorithm 1 Wave Forcing1: pose = GetWorldPose()2: vel = GetWorldVelocity()3: for i = 0 to 2 do . For each WAM-V hull.4: for j = 0 to N do . For each grid point.5: x = GridPosition(pose.position,i,j)6: z = GridHeight(pose.position,7: pose.orientation, i,j)8: z = GridVelocity(vel.linear, vel.angular, i,j)9: ζ = WaveHeight(x,t)

10: ζ = WaveVelocity(x,t)11: f = WaveForce(z − ζ, z − ζ)12: ApplyForceAtPosition(f ,x)13: end for14: end for

This approach to approximating the influence of oceanwaves is a simplification intended to balance physicalfidelity and visual realism with real-time execution re-quirements. The result is consistent simulated motionand sensor feedback to exercise the pertinent aspects ofautonomy, particularly motion control and sensor-basedperception. To preserve real-time execution, the modelneglects wave influence factors typically included in ap-plications where the precise motion of a particular vesselor structure design are of critical importance, e.g., studies

6

Page 7: Toward Maritime Robotic Simulation in Gazebo

that include slamming, green water on deck and dynamicstability. A variety of naval architecture design softwareapplications provide methods to assess the affect ofvessel design on resulting motion, but these solutionstypically run much slower than real-time. Previous workby the authors [26] compared the proposed approachwith a commercial naval architecture design softwarepackage under similar sea conditions, taking into accountmodel forces and motions to quantify the trade-offs incomplexity and fidelity. The results quantified the fidelitydifferences between the approaches and demonstratedthat the proposed method could sufficiently exerciserobotic autonomy while executing in real-time.

C. Wind Forces

The model used for simulating the windenvironment—consisting of horizontal wind speed(Vw) and direction (βw)—is described in Section II-B.We consider the influence of this wind on themaneuvering degrees-of-freedom of the model. Weneglect the wind-induced motion in heave, pitch androll. While the influence on heave and pitch are typicallyvery small, for certain vessels, under certain conditions,the wind can have an effect on roll. For such cases thesame coefficient-based model presented below can beextended.

We adapt the model and notation described in [22].The relative (apparent) wind velocities are

urw = u− uw (23a)vrw = v − vw (23b)

where uw and vw are the x and y components ofthe simulated wind velocity in the vessel body frame,expressed as

uw = Vw cos(βw − ψ) (24a)vw = Vw sin(βw − ψ). (24b)

The surge, sway and yaw components of the wind forcevector (τwind in (16)) are dependent upon the apparentwind and the coefficients for each mode. For symmet-rical vessels, these wind coefficients can be consideredconstant. Using dimensional wind coefficients cx, cy andcn we express the forcing terms as

Xwind = cxurw|urw| (25a)Ywind = cyvrw|vrw| (25b)Nwind = −2.0cnurwvrw. (25c)

This wind forcing model is implemented as anotherstandalone Gazebo plugin. At runtime the user specifies

the wind characteristics (direction, mean speed, standarddeviation and time constant) and the vessel-specific windcoefficients in (25). The wind speed and direction atsimulation time is calculated according to the windgeneration model in (13), the components of the apparentwind are calculated in the vessel body-frame and theresulting forces from (25) are applied to the simulatedvessel for inclusion in the next cycle of the physicsengine update.

Analogous to the hydrodynamic model, this approachto representing wind-induced forces is generally appli-cable to surface vessels and a vessel-specific applicationrequires estimation of the wind coefficients. For theWAM-V model, wind coefficients have been estimatedbased on experimental testing [25]. We use these numer-ical values for the WAM-V for the purposes of the VRXchallenge reference implementation.

D. Propulsion Forces

The propulsion system consists of a set of vessel-mounted thrusters to implement vessel motion control bygenerating external forces on the vehicle. Design of thepropulsion system includes specification of the thrustertype, thruster characteristics, and thruster location onthe vessel. To accommodate user-defined configurations,we model the force from an individual thruster as afunction of a thrust command between -1.0 (full reverse)and 1.0 (full forward). At each time step the resultingexternal force is included in the model according to(16). Implemented as a Gazebo plugin, this force isapplied at the geometric location of the propeller jointas illustrated in Fig. 2. Each thruster can also be artic-ulated by commanding the angle of the thruster relativeto the mount, allowing for the possibility of vectoredthrust solutions. The motion of the angular articulationis simulated through a proportional-derivative controllerto move the thrust vector to the desired location withtemporal dynamics representative of typical electrome-chanical dynamics.

While Fig. 2 shows a typical configuration with twothrusters at the stern of the vessel, users may addmultiple thrusters at other locations to reflect otherpossible propulsion system designs. For example, anadditional bow or lateral thruster is often added foradditional control authority; alternately, a four-thrusterconfiguration with angled thrusters at the bow and sternof each hull can be implemented when maneuverabilityis prioritized over speed and efficiency.

The characteristics of an individual thruster are speci-fied by a user-defined relationship between commandedeffort and the resulting thrust force. Two static mappings

7

Page 8: Toward Maritime Robotic Simulation in Gazebo

Fig. 2. Illustration of propulsion forces for two-thruster configuration.Two independent forces are applied to the virtual body as indicated bythe red arrows. The angle of the each thruster relative the mountingpoint can also be controlled to allow for vectored thrust, as indicatedby the green arcs.

are included, with functionality for custom mappings formore specific cases. The first mapping is a linear map-ping where the command values (-1.0 to 1.0) are scaledlinearly to the user supplied parameters for maximumforward and reverse thrust values.

The second, non-linear static mapping uses general-ized logistic functions (GLFs) to approximate the re-lationship between command and force often providedas the result of static bollard-pull tests. The GLF isparameterized as

T = A+K −A

(C + exp(−B(x−M)))1/ν

(26)

where T is the thrust in Newtons; x is the commandedeffort; and A, K, C, B, M , and ν are user-defined con-stants used to specify the GLF. To capture the asymmetryassociated with forward and reverse, two independentGLFs are used, one for positive commands (0 to 1.0)and a second for negative commands (-1 to 0). The user-specified functional parameters allow the thrust modelused to approximate a wide variety of thruster designsbased on empirical data.

To illustrate this process we specify the GLF thrustmapping to approximate the steady-state bollard-pullexperiments presented in [25]. To identify the GLFparameters, a Nelder-Mean simplex optimization wasperformed to minimize the squared error between themodel and the GLF expressions (26) as a function ofthe GLF parameters. The results are shown in Fig. 3.

This approach to simulating propulsion force approx-imates the steady-state non-linearities to exercise themotion controllers under test. However, it does notaddress effects such as transient thruster dynamics for

Fig. 3. Generalized logistic function fit of empirical bollard-pull thrustperformance data from [25].

slow-speed control [27], varying advance ratios due toforward vessel speed for high-speed operation or changesin thrust during turning due to the changing inflow anglethat can generate meaningful side force. Such additionsto the propulsion model can be readily implemented, butrely upon the availability of more detailed propulsioncharacterization.

IV. VRX REFERENCE IMPLEMENTATION

Launched in 2012 with support from the Office ofNaval Research, the Maritime RobotX Challenge ishosted biannually by RoboNation to promote researchand advancement in autonomous surface vehicles, aswell as to encourage student interest and foster rela-tionships within the robotics community. Participatingteams compete to design and implement systems capableof accomplishing a variety of tasks ranging from basicnavigation and control to more complex operations in-volving obstacle avoidance, perception and underwaterobject retrieval.

The purpose of the VRX challenge is to providecompetitors with the opportunity to prototype and testsoftware solutions in advance of physical on-water de-ployments. A major goal of the project is to facilitateimproved performance in the physical competition. Assuch, it implements a suite of models and plugins thatclosely mirrors the location, course elements, and typesof tasks encountered by participants in RobotX 2018.Fig. 4 shows a visual comparison of an example vehicleand elements from RobotX alongside a similar scenerendered in the VRX environment with Gazebo.

8

Page 9: Toward Maritime Robotic Simulation in Gazebo

Fig. 4. A visual comparison of a physical WAM-V and course elementsfrom RobotX 2018 (left) with a similar scene rendered in the VRXenvironment using Gazebo (right).

The first VRX Competition will be held in November2019. Similar to RobotX, it will be organized around aseries of tasks that evaluate autonomous navigation andperception capabilities of participants’ solutions. Thesetasks include station-keeping, waypoint guidance, objectlocalization and characterization, navigation and rules ofthe road, and docking. The VRX environment also servesas a proof of concept for the theory of operations hereindescribed. Tasks require teams to develop solutions thatcorrectly compensate for the influence of waves andwind when controlling the motion of the vehicle. Thestation-keeping and path planning tasks, in particular,bring this requirement into relief. In order for these tasksto provide useful evaluations of participant solutions, theVRX environment must succeed in simulating the impactof wind and wave forces with sufficient fidelity andspeed. The object localization and characterization taskisolates environmental effects on perception, and there-fore relies heavily on the availability of synchronizedvisual and physical models. Finally, the more complexnavigation and docking tasks test the ability of the VRXenvironment to render a real-time simulation that givesa sufficiently faithful approximation of environmentalinfluence on both motion control and perception effectsat the same time2.

Fig. 5 and Fig. 6 demonstrate the combined effect ofour environment and vehicle models within the VRXsimulation environment. Fig. 5 depicts the base SandIsland world on which the competition is built, includ-ing course elements and the WAM-V. The inset graphincluded in the display shows the wind speed varyingover time in accordance with user specified parametersand the model given in Section II-B. Fig. 6 was createdfrom the Dock task plugin using a peak period of 5seconds and a gain ratio of 0.7. The scene illustratesthe effect of the wave field on vehicle motion as well asthe disturbances to the perception system produced by

2A complete description of the VRX 2019 challenge tasks isavailable at https://bitbucket.org/osrf/vrx/wiki/documentation

the resulting pitch, roll and heave of the vehicle.

Fig. 5. The VRX Sand Island world rendered in Gazebo with a plotof wind speed over time.

Fig. 6. The VRX Competition Dock task with a non-trivial waveenvironment (K = 0.7, Tp = 5). Note the WAM-V is slightly rolledand pitched due to wave forcing, and the effect of this disturbance isreflected in the camera view.

V. CONCLUSION

In this paper we describe a simulation approach forrobotic surface vessels operating in marine environmentsdesigned to support rapid development, testing and eval-uation of new autonomy solutions. The contributions ofthis research are a wave model for visual and physicaleffects based on Gerstner waves and the two-parameterPierson Moskowitz spectrum, a wind model to representmean and variable (gust) components based on theHarris spectrum, a parameterized propulsion model, a sixdegree-of-freedom vessel model to capture environmen-tal and control influence on vessel motion and sensorperception, and a demonstrative reference implementa-tion: the new 2019 VRX challenge robot competition.

The VRX simulation is implemented as a set ofGazebo plugins, object models (visual, collision andrigid body representations), and environmental scenar-ios (world scenes) released as an open-source project.The simulation is highly parameterized, allowing usersto specify the details of the environmental (wave andwind spectra constants), the vessel (hydrodynamic andwind coefficients), the propulsion (thruster location andauthority) and the sensors (type and location). Thisparameterization generalizes the simulation so that it

9

Page 10: Toward Maritime Robotic Simulation in Gazebo

is adaptable to a variety of surface marine autonomyapplications.

ACKNOWLEDGMENT

The VRX simulator is an open-source project thatwelcomes community contributions. We thank all thecontributors for their time and energy. A current listof contributors is maintained at https://bitbucket.org/osrf/vrx/wiki/Contributors.

REFERENCES

[1] N. Koenig and A. Howard, “Design and use paradigms forGazebo, an open-source multi-robot simulator,” in IEEE/RSJInternational Conference on Intelligent Robots and Systems,Sendai, Japan, Sep 2004, pp. 2149–2154.

[2] C. E. Aguero, N. Koenig, I. Chen, H. Boyer, S. Peters, J. Hsu,B. Gerkey, S. Paepcke, J. L. Rivero, J. Manzo, E. Krotkov, andG. Pratt, “Inside the virtual robotics challenge: Simulating real-time robotic disaster response,” IEEE Transactions on Automa-tion Science and Engineering, vol. 12, no. 2, pp. 494–506, April2015.

[3] K. A. Hambuchen, M. C. Roman, A. Sivak, A. Herblet,N. Koenig, D. Newmyer, and R. Ambrose, “NASA’s spacerobotics challenge: Advancing robotics for future explorationmissions,” in AIAA SPACE and Astronautics Forum and Exposi-tion, 2017.

[4] M. Allan, U. Wong, P. M. Furlong, A. Rogg, S. McMichael,T. Welsh, I. Chen, S. Peters, B. Gerkey, M. Quigley, M. Shirley,M. Deans, H. Cannon, and T. Fong, “Planetary rover simulationfor lunar exploration missions,” in 2019 IEEE Aerospace Con-ference, March 2019, pp. 1–19.

[5] T. Tosik, J. Schwinghammer, M. J. Feldvob, J. P. Jonte, A. Brech,and E. Maehle, “MARS: A simulation environment for marineswarm robotics and environmental monitoring,” in OCEANS 2016- Shanghai, April 2016, pp. 1–6.

[6] E. H. Henriksen, I. Schjolberg, and T. B. Gjersvik, “UW MORSE:The underwater modular open robot simulation engine,” in 2016IEEE/OES Autonomous Underwater Vehicles (AUV), Nov 2016,pp. 261–267.

[7] T. Watanabe, G. Neves, R. Cerqueira, T. Trocoli, M. Reis,S. Joyeux, and J. Albiez, “The Rock-Gazebo integration anda real-time AUV simulation,” in 2015 12th Latin AmericanRobotics Symposium and 2015 3rd Brazilian Symposium onRobotics (LARS-SBR), Oct 2015, pp. 132–138.

[8] K. J. DeMarco, M. E. West, and A. M. Howard, “Acomputationally-efficient 2D imaging sonar model for underwaterrobotics simulations in Gazebo,” in OCEANS 2015 - MTS/IEEEWashington, Oct 2015, pp. 1–7.

[9] M. M. M. Manhaes, S. A. Scherer, M. Voss, L. R. Douat, andT. Rauschenbach, “UUV simulator: A Gazebo-based package forunderwater intervention and multi-robot simulation,” in OCEANS2016 MTS/IEEE Monterey, Sept 2016, pp. 1–8.

[10] D. Cook, A. Vardy, and R. Lewis, “A survey of AUV androbot simulators for multi-vehicle operations,” in 2014 IEEE/OESAutonomous Underwater Vehicles (AUV), 2014.

[11] S.-K. Ueng, D. Lin, and C.-H. Liu, “A ship motion simulationsystem,” Virtual Reality, vol. 12, no. 1, pp. 65–76, 2008.

[12] D. Sandaruwan, N. Kodikara, C. Keppitiyagama, R. Rosa,M. Jayawardena, and P. Samarasinghe, “User perception ofthe physical behavioral realism of a maritime virtual realityenvironment,” in 2012 UKSim 14th International Conference onComputer Modelling and Simulation, March 2012, pp. 172–178.

[13] D. J. Yeo, M. Cha, and D. Mun, “Simulating ship and buoymotions arising from ocean waves in a ship handling simulator,”SIMULATION, vol. 88, no. 12, pp. 1407–1418, 2012.

[14] S. Thon, J. . Dischler, and D. Ghazanfarpour, “Ocean wavessynthesis using a spectrum-based turbulence function,” in Pro-ceedings Computer Graphics International 2000, June 2000, pp.65–72.

[15] J. Tessendorf, C. C, and J. Tessendorf, “Simulating ocean water,”1999.

[16] D. Hinsinger, F. Neyret, and M.-P. Cani, “Interactive anima-tion of ocean waves,” in Proceedings of the 2002 ACM SIG-GRAPH/Eurographics Symposium on Computer Animation, ser.SCA ’02. New York, NY, USA: ACM, 2002, pp. 161–166.

[17] G. A. Mastin, P. A. Watterberg, and J. F. Mareda, “Fourier synthe-sis of ocean scenes,” IEEE Computer Graphics and Applications,vol. 7, no. 3, pp. 16–23, March 1987.

[18] J. Frechot, “Realistic simulation of ocean surface using wavespectra,” in GRAPP 2006 - Proceedings of the 1st InternationalConference on Computer Graphics Theory and Applications, 012006.

[19] T. S. C. on Waves, “Final report and recommendation to the 23rdITTC,” in Proceedings of the 23rd ITTC, vol. II. InternationalTowing Tank Conference, 2002.

[20] H. Mitsuyasu, F. Tasai, T. Suhara, S. Mizuno, M. Ohkusu,T. Honda, and K. Rikiishi, “Observations of the directionalspectrum of ocean wavesusing a cloverleaf buoy,” Journal ofPhysical Oceanography, vol. 5, no. 4, pp. 750–760, 1975.

[21] R. I. Harris, “The nature of the wind, the modern design ofwind-sensitive structures,” in Construction Industry Research andInformation Association, 1971, pp. 29–55.

[22] T. I. Fossen, Guidance and Control of Ocean Vehicles. Wiley,1994.

[23] ——, Handbook of Marine Craft Hydrodynamics and MotionControl. Wiley, 2011.

[24] P. Krishnamurthy, F. Khorrami, and S. Fujikawa, “A modelingframework for six degree-of-freedom control of unmanned seasurface vehicles,” Dec. 2005, pp. 2676–2681.

[25] E. I. Sarda, H. Qu, I. R. Bertaska, and K. D. von Ellenrieder,“Station-keeping control of an unmanned surface vehicle exposedto current and wind disturbances,” Ocean Engineering, vol. 127,pp. 305 – 324, 2016.

[26] J. F. Malia, “Modeling of a dynamic wave environment forunmanned surface vessel control,” Master’s thesis, Naval Post-graduate School, 2018.

[27] L. L. Whitcomb and D. R. Yoerger, “Development, comparison,and preliminary experimental validation of nonlinear dynamicthruster models,” IEEE Journal of Oceanic Engineering, vol. 24,no. 4, pp. 481–494, Oct 1999.

10