AGV Simulator

C++, OpenGL, ODE Physics, WinForms, .net

Design and simulate the communication system between AGV (Automated Guided Vehicles) to interact with each others in an automated production plant.

The goal of this project was to design and implement a software to manage remote automated guided vehicles (AGV). There are two different modules in this project:

  • 3D Simulator: It will simulate virtual AGV into a 3D world.
  • Control Server: It can control every AGV: reading their sensors values, sending command to its devices or complete tasks like move from one point to another to pick up something. The simulator is used to emulate the real AGV sensors and devices.

Simulator

The simulator features a custom OpenGL 3D engine and it uses ODE physics engine and it uses sockets with a custom protocol over TCP to communicate with the server. The 3D models are exported from 3D Studio MAX using a custom plugin.

The AGV is designed as a UPnP and it's defined as a compound of devices. Each device provides an interface to read data from it (For example ultrasonic distance or light intensity on sensors) and to perform actions like steering and accelerating wheels.

The following example shows a four-wheels vehicle with an ultrasonic sensor:

<omni_simulator version="1"> <vehicle name="OmniAGV" model="OAGV1" serial_number="439485920" behaivour="">
<chasis model_file="chasis.k3d" position="0 0 0" scale="1 1 1" mass="1000" friction="150" />
<devices num_devices="1">
<device id="0" name="Wheel Front Left" file="omnirotar.xml" relative_pos="4 -6 -4" scale="1 1 1" rotation="0 0 0"/>
<device id="1" name="Wheel Front Right" file="omnirotal.xml" relative_pos="4 6 -4" scale="1 1 1" rotation="0 0 180"/>
<device id="2" name="Wheel Back Left" file="omnirotar.xml" relative_pos="-7 -6 -4" scale="1 1 1" rotation="0 0 0"/>
<device id="3" name="Wheel Back Right" file="omnirotal.xml" relative_pos="-7 6 -4" scale="1 1 1" rotation="0 0 180"/>
<device id="5" name="Driving Control" file="driving_device.xml"/>
<device id="6" name="Ultrasonic" file="ultrasonic.xml" relative_pos="6.5 4 -1.5" scale="1 1 1" rotation="0 0 180"/>
</devices>
</vehicle>
</omni_simulator>

The ultrasonic sensor interface is also defined as an XML:

<omni_simulator version="1" type="device">
<device model="Ultrasonic" group="sensors" type="ultrasonic" serial_number="12345343">
<model file="sensor.k3d"/>
<outputs>
<output id="0" name="distance" type="0" min_value="0" max_value="255" />
</outputs>
<params num_params="1">
<param id="0" name="refresh" type="0" min_value="0" max_value="255" default_value="128" />
</params>
<properties num_properties="2">
<property id="0" name="max_distance" type="0" min_value="0" max_value="255" default_value="0" />
<property id="1" name="amplitude" type="0" min_value="0" max_value="255" default_value="0" />
</properties>
</device>
</omni_simulator>

Control server

The control server creates a socket thread for each AGV connected. It read the method exposed by the devices once the AGV is connected, and generates a views so the user can interact with them. It allow to include a dynamic library (DLL) to perform tasks based on the sensors values.

See it in action

Screenshots

Simulator in action Remote server Devices in robot