Customize

To handle each robots' specificities, Webots use a set of devices which is fully supported by URBI for Webots. Those devices are created in a special file which is called like your robot in its data directory. With the previous example, it would have been the data/foo/foo.ini file. This file should be like the following piece of code:

system.name = "/gostai/webots/kiki";
system.type = "webots";


wheelL = new DifferentialWheels("kiki", true);
alias wheelL.val wheelL.speed;
wheelR = new DifferentialWheels("kiki", false);
group wheels {wheelL, wheelR};

alias wheelR.val wheelR.speed;
eyeL = new DistanceSensor("ir0");
eyeR = new DistanceSensor("ir1");

// Standard groups
group software {};
group hardware {wheelL, wheelR, eyeL, eyeR};
group objects {software, hardware};

// Standard aliases
// etc.
   

The first line is your robot's name, you may edit this to any value. The second line must keep its value.

After this, you need to create your robot's devices. It's very easy: you just have to follow the rule: devicename = new devicetype("name of the device's node in the world file");

The node name can be retrieved easily from the Webots world tree editor.

One exception is the DifferentialWheel device. There is always two lines. The first has its second argument set to true and will create the left wheel. The second with its second argument set to false create the right wheel.

The last step is editing the groups to add your new devices. The hardware group should contain all the devices your robot uses. You may also create subgroup to ease robot's programming.