Main characteristics of UWSim
The 3D scene can be easily configured with third-party modeling software as Blender, 3D Studio Max, etc. The basic scene can be freely modeled, including materials and textures. The resulting scene will have the possibility to be loaded in the simulator as long as it is exported to any of the formats that OSG can read (.ive, .3ds, .wrl, etc.).
In addition to the basic 3D structure, additional elements can be dynamically added, modified and removed from the main program. OSG represents the virtual scenario with a scene graph, where the nodes can be easily accessed and managed. This includes not only geometry nodes, but also cameras, light sources, etc.
To the geometry that the user defines, new configurable nodes are automatically added that create the underwater visualization effects. These are the ocean surface, underwater visibility, water color, silt particles, god rays, etc.
Multiple robots support
The software design includes abstract classes that can be specialized for adding support for different vehicles and underwater manipulators. The default vehicle object is composed of a 3D model (modeled by the user in third party modeling software) that can be positioned in the scene on 6 degrees of freedom (DOF). Support for kinematic chains (needed for manipulators) is also included. As an example, two different underwater manipulators of 4 and 7 DOF are included by default. Different robots can be loaded and managed simultaneously in the scene.
Three different sensors are simulated in the current version. By default, any vehicle object includes localization sensors that provide its 4 DOF pose (x, y, z, yaw) in the scene. The underwater manipulators also include simulated position sensors in the joints that provide the joint angles. Finally, virtual cameras can be also added to the scene, thus providing virtual images of the environment that can be used for developing vision algorithms. Other sensors such as different types of sonars are expected to be added in the future.
Physics simulation is also supported, although in a simple manner at this moment (i.e. without water dynamics). This is done by integrating the physics engine Bullet with OSG through osgBullet. This allows simulating contacts and forces and automatically updating the scene accordingly. The different bodies collision shapes can be automatically generated from the 3D models. In addition, it is possible to set the position and attitude of collision shapes automatically from the scene graph, which is necessary, for instance, for updating the collision shapes transforms of kinematic chains like manipulators.
All the different robots sensors and actuators can be interfaced with external software through the network. For this, we have integrated the simulator into the Robot Operating System (ROS) that provides many facilities for communications and distributed computation. Through the network interfaces, it is possible to access/update any vehicle position or velocity, to move arm joints, and to access the images generated by virtual cameras. However, the core software is independent of any middleware, so it is possible to interface the simulator with other middlewares, just take ROSInterface.h as an example.
Support for customizable widgets is also included. Widgets are small windows that can be placed inside the main display in order to show specific data to the user. An abstract interface for the creation of custom widgets is included. It allows to create specialized classes for displaying useful data depending on the specific application. For instance, the virtual camera view is displayed on a widget, which position and size can be modified during execution by the user. Another widget just connects to an external camera and displays the image on top of the simulation. This allows, for instance, to supervise an underwater vision, where live video is available and the environment has been previously modeled.