![]() |
6.5 Transfering to the real robot6.5.1 Remote controlThe remote control mode consists in redirecting the inputs and outputs of your controller to a real Khepera robot using the Khepera serial protocol. Hence your controller is still running on your computer, but instead of communicating with the simulated model of the robot, it communicates with the real device via connected to the serial port. To switch to the remote control mode, your robot needs to be connected to your computer as described in section 6.1. In the robot controller window, select the COM popup menu corresponding to the serial port to which your robot is connected. Then, just click on the simulation popup menu in the controller window and select remote control instead. After a few seconds, you should see your Khepera moving around, executing the commands sent by your controller. The controller window now displays the sensor and motor values of the real Khepera. You may press the stop / go button to prevent or allow you robot to move. To return to the simulation mode, just use the popup menu previously used to start the remote control mode. You may remark that it is possible to change the baud rate for communicating with the robot. The default value is 57600 baud, but you may choose another value from the popup menu. Important: If you change the baud rate with the popup menu, don't change the mode on the Khepera robot, since the baud rate is changed by software. The mode on the Khepera robot should always remain set to 1 (i.e., serial protocole at 9600 bauds). 6.5.2 Cross-compilation and uploadWe assume in this subsection, that you have installed the webots-kros package provided with Webots. Cross-compiling a controller program creates a executable file for the Khepera micro-controller from your C source file. In order to produce such an executable, you can use the Makefile.kros provided within the khepera controller directory. From Linux, just type: make -f Makefile.kros From Windows, launch the Webots-kros application and follow the instructions. In both cases you see the following messages telling you that the compilation is progressing successfully:
It may be necessary to remove any previous khepera.o which may conflict with the one generated by the cross-compiler. In order to do so, you can type: make -f Makefile.kros clean Finally, to upload the resulting khepera.s37 executable file onto the Khepera robot, click on the upload button in the controller window. The green LED of your Khepera should switch on while uploading the program. It lasts for a few seconds or minutes before completing the upload. Once complete, the robot automatically executes the new program. ![]() ![]() ![]() ^ page top ^ |
E-mail to webmaster | Last updated: | Copyright © 2002 Cyberbotics Ltd. |