Introduction to Webots
Outlines Introduction Introduction World Description World Description Controller Programming Controller Programming A Kiki Example A Kiki Example
Introduction Installation Installation –Download Webots Software nload.html nload.html –Double click on the webots _setup.exe –Follow the installation instructions
Introduction Installation Installation –Create user directory that contains three subdirectories where Webots will look for files. World World Controller Controller Objects Objects
Introduction Descriptions of Webots Descriptions of Webots –Features Webots is a mobile robot simulation software Webots is a mobile robot simulation software Webots allows users to create 3D virtual worlds with physical properties. Webots allows users to create 3D virtual worlds with physical properties. A number of sensor and actuator devices can be equipped to different robots. A number of sensor and actuator devices can be equipped to different robots. The user can program each robot individually to exhibit a desired behavior. The user can program each robot individually to exhibit a desired behavior.
Introduction Descriptions of Webots Descriptions of Webots –Applications Mobile Robot Prototyping Mobile Robot Prototyping Multi-agent Research Multi-agent Research Adaptive Behavior Research Adaptive Behavior Research Mobile Robotics Teaching Mobile Robotics Teaching
Introduction
Introduction
Introduction
Introduction Components of Webots Components of Webots –World A world is a 3D virtual environment where you can create objects and robots. A world is a 3D virtual environment where you can create objects and robots. A world is a hierarchical structure A world is a hierarchical structure –Controller Controller is a program to control the robot Controller is a program to control the robot Controller may be executable (.exe) or Java binary files (.class). Controller may be executable (.exe) or Java binary files (.class).
World Description World Coordinate World Coordinate
World Description World Structure World Structure –A world is composed of a list of nodes, each containing fields. –Fields can contain values or nodes.
World Description Construction Tools Construction Tools –Scene Tree Window
Controller Programming Program Framework Program Framework –int main(void){ robot_live(reset); robot_run(run) } /* End of main-body */ void reset(void){ ….. } int run(int ms){ …..; return 64; }
Controller Programming Programming Tools Programming Tools –Dev C++ –Visual C++ –Java Development Kit (JDK) Library Library – \controller.dll
Kiki Example
World Construction World Construction –PointLight Insertion –Wall Building –Robot Modeling
Kiki Example World Construction World Construction –PointLight Insertion
Kiki Example World Construction World Construction –Wall Building
Kiki Example World Construction World Construction –Wall Building
Kiki Example World Construction World Construction –Robot Modeling
Kiki Example World Construction World Construction –Robot Modeling
Kiki Example World Construction World Construction –Robot Modeling (Body)
Kiki Example World Construction World Construction –Robot Modeling (Wheel)
Kiki Example World Construction World Construction –Robot Modeling (Sensor)
Kiki Example Controller Programming Controller Programming –static DeviceTag ir0, ir1; –void reset (void){ ir0 = robot_get_device( “ ir0 ” ); ir1 = robot_get_device( “ ir1 ” ); distance_sensor_enable(ir0, 64); distance_sensor_enable(ir1, 64); }/* End of reset */
Kiki Example Controller Programming Controller Programming – int run (int ms){ short leftspeed, rightspeed; int value0, value1; value0 = distance_sensor_get_value(ir0); value1 = distance_sensor_get_value(ir1); leftspeed = …….; Rightspeed = …..; differential_wheels_set_speed(leftspeed, rightspeed); return 64; }/* End of run */
Kiki Example Control Setting Control Setting –Compile the program –Save the kiki.exe to control directory –Set controller to “ kiki ”
Reference Webots User Guide Webots User Guide Webots Reference Manual Webots Reference Manual