

#WEBOTS SIMULATION SPEAKER CODE#
IMPORTANT! This explain to execute the code in a Linux environment with python 3.7 More info can be found in the Running Extern Robot Controller section in the Webots documentation.

In order to execute the SimController from a terminal, must ensure to have configured the WEBOTS_HOME and LD_LIBRARY_PATH environment variables, and add the Webots lib controller to the PYTHONPATH, in order to import the Webots python library. The image is processed to remove the Alpha channel an keep the BGR channels to be presented during the execution of the sim_controller.py file. The drone's is equipped with a Camera Node (can be modified in the Webots scene) for an 400x240 pixels BGRA channel image over a 3-axis gimbal to smooth the image movement. IMPORTANT! the controllers PID values were tunned for a 8ms simulation timestep, with a configured defaultDamping WorldInfo's field using a Damping node with 0.5 value for the angular and linear field. The controller were tunned using the Ziegler-Nichols PID tunning technique. The velocity of each propeller motor is calculated using four PID controlles, one for the roll, pitch and yaw angles, and another for the altitude.

Motors controlĪll the sensors and actuators of the drone are managed by the FlightControl class, which instantiate the GPS, IMU, Gyro, Camera, and the LED nodes.Īdditionally, control the drone's gimbal and propeller motors. This setup is intended to simulated a Radio Control (by the SimController) of the drone which send the variation for the angles and thrust values to manipulate the drone's position.Īt counter part, the drone send back the image captured by its camera.
#WEBOTS SIMULATION SPEAKER PRO#
The Mavic 2 Pro control is achieved by the DroneController class which have a two-way communication with the SimController using an Emitter and Receiver node at each side. With this environment a reward can be computed considering the distance of the drone to the boundary the save zone, it start with a under zero value and is increasing while the drone is getting close of the fire location. To achieve this, the fire location is used as base where is added the radius size and 4 times the fire's height, if the drone exceed this point the '_end' var of SimController class is set True.Īdditionally, some code improvements has been made to run as OpenAI Gym environment called Gym Webots Fire Scene.
#WEBOTS SIMULATION SPEAKER UPDATE#
