8.3 Control interface8.3.1 Control windowWhen opening a world containing an e-puck robot, Webots displays the e-puck control window (which also appears when you double-click on the e-puck robot). This window is depicted in figure 8.3 and figure 8.5. It allows visualizing the devices of the robot. The distance measurements are displayed in blue, outside the body of the robot. The light measurements are displayed in grey, inside the body. The 10 LEDs are displayed in grey when off and red (or green) when on. The motor speeds are displayed in red, and the motor position is displayed in grey just below the speed of each motor. The floor sensor values (if present) are displayed at the top of the body. The accelerometer values are displayed at the center of the body in term of norm and inclination. The camera image (if present) is displayed in the simulation window. ![]() Figure 8.5: The e-puck control window for remote control This e-puck control window appears because the model of the DifferentialWheel node in the world file was set to "e-puck". Changing this model to an empty string will disable this control window. 8.3.2 BotStudioBotStudio is a user interface for programming graphically the e-puck thanks to a finite state automaton. Behaviors such as wall follower, collision avoider or line follower can be implemented quickly thanks to this interface. BotStudio is typically destinated for the education field. Particularly for beginners in robotics. An automaton state of BotStudio corresponds to a state of the e-puck actuators while a transition corresponds to a condition over its sensor values. A transition is fired when all of its conditions are fulfilled (logical AND). A logical OR can be performed by several transitions between two states. The actuators available in BotStudio are the LEDs and the motors. Each automaton state have two sliders for setting the motor speed value. Note that these values can be unset by clicking on the cursor of the slider. Each state have also 10 square buttons for setting the LEDs states. A red button means the LED is turned on, a black one means it is turned off and a grey one means there is no modification. The sensor available in BotStudio are the distance sensors and the camera. Moreover a timer can be used for temporize the conditions by dragging the corresponding slider. Conditions over the IR sensors can be set by dragging the 8 red sliders. Note that the direction of the condition can be modified by clicking on the grey part of the slider. Finally, the camera is used for giving a clue on the front environment of the e-puck. An algorithm is applied on the last line of the camera and returns a integer between -10 and 10 indicating if a black line is perceived respectively at the left and at the right of the e-puck field of view. A condition can be set on this value for getting a line follower behavior. BotStudio is depicted in the figure figure 8.6. An example of BotStudio can be found by opening the projects / robots / e-puck / worlds / e-puck_botstudio.wbt world file. The BotStudio windows appears when the e-puck's controller points on a .bsg file. ![]() Figure 8.6: BotStudio 8.3.3 Bluetooth remote controlE-puck has a Bluetooth interface, allowing it to communicate with Webots. This Bluetooth interface must be set up according to your operating system, following the instructions of the e-puck robot. It has been tested successfully under Windows, Linux and Mac OS X. Once properly set up, your Bluetooth connection to your e-puck should appear in the second popup menu of the control window after you restart Webots. If it doesn't appear here, it means that your computer was not properly configured to interface with your e-puck robot through Bluetooth. Please refer to the instructions in the e-puck documentation. When selecting a specific Bluetooth connection from the popup menu of the control window, Webots will try to establish a connection with your e-puck robot. Once connected, it will display the version of the e-puck serial communication software in the status bar of the control window (as displayed in figure 8.5), and will switch the control to the real robot. That is, it will send motor commands to the real robot and display sensor information (proximity, light, camera image, etc.) coming from the real robot. This makes the transfer from the simulation to the real robot trivially simple. Note that in the same popup menu, the Refresh COM port menu item can be used for updating the COM ports. The remote control has two requirements; the Bluetooth must be correctly set up (computer side) and the e-puck must be programmed with the Webots last firmware. For setting up Bluetooth, please refer to the official e-puck website. For uploading the last firmware on your robot, switch on your robot, select the Tools / Upload to e-puck robot... menu item of the Webots main window, select the COM port which corresponds to your robot and finally select the transfer / e-puck / firmware / firmware-x.x.x.hex file located in your Webots directory (x.x.x has to be replaced by the current firmware's version). 8.3.4 Cross-compilationAn alternative to the remote-control session for running the real e-puck is to cross-compile your code and to upload it on the e-puck. For using this feature, your code has to be written in C and to use the C Webots API. Moreover, you need to define a specific Makefile called Makefile.e-puck in the controller directory. This Makefile must include the following file:
An example of cross-compilation can be found in the projects / robots / e-puck / controllers / e-puck_crosscompilation subdirectory of your Webots directory. ![]() ^ page top ^ |
| E-mail to webmaster | Last updated: | Copyright © 2010 Cyberbotics Ltd. |