Table of Contents
Construct a new Accelerometer object. The "NodeName" attribute is the value of the name field, in the Accelerometer node in Webots. The "ComponentName" is the name of the Accelerometer component this object represent. Because you need 3 Accelerometer UObject to represent the Webots Accelerometer device. Each Accelerometer UObject represent one of the component of the Webots Accelerometer device. "ComponentName" can take 3 values: "x", "y" or "z".
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the Accelerometer device. By default it is set to 1, which means that the Accelerometer is enabled. If you set it to 0 it will disable it. NB: If you enable or disable one of the Accelerometer UObject component, then all the associated Accelerometer UObject components will also be enabled or disabled (ex: if you disable the y Accelerometer component, then the x and z Accelerometer components will also be disabled).
To enable and disable the device we use the following Webots functions:
void accelerometer_enable (DeviceTag sensor, unsigned short ms); void accelerometer_disable (DeviceTag sensor);
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable.
Type: float.
Description: The value of the component this UObject represent. So it is one of the 3 component of the Webots Accelerometer device. Either x, y or z.
Retrieved with the following Webots functions:
const float *accelerometer_get_values (DeviceTag sensor); float accelerometer_value_x (float *array); float accelerometer_value_y (float *array); float accelerometer_value_z (float *array);
The camera UObject lets you control a Webots camera device. When your robot possess a camera, and it use URBI as a controller, you won't see the camera image displayed on your computer screen unless you create this camera UObject. You can create only one camera Urbi Object by Webots camera device. Once you have created the camera, the camera image will be displayed in the place defined by the .wbt world.
Construct a new camera object. The "NodeName" attribute is the value of the name field, in the camera node in Webots.
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the camera device. By default it is set to 1, which means that the camera is enabled. If you set it to 0 it will disable it. To enable and disable the device we use the following Webots functions:
void camera_enable (DeviceTag camera, unsigned short ms); void camera_disable (DeviceTag camera);
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable.
Type: binary.
Description:The current image acquired by the camera. The format of the image can be RGB, JPEG or YCbCr, and is determined by the "format" attribute. To retrieve the camera image we use the following Webots function:
unsigned char *camera_get_image (DeviceTag camera);
Permissions: readable, writable.
Type: float.
Range: {0,1,2}
Description: The format of the camera image for the "val" attribute. Set format to:
Permissions: readable.
Type: binary.
Description: The current image acquired by the camera with format RGB.
Permissions: readable.
Type: binary.
Description: The current image acquired by the camera with format JPEG.
Permissions: readable.
Type: binary.
Description: The current image acquired by the camera with format YCbCr.
Permissions: readable, writeable.
Type: float.
Range: [0;100]
Description: Compression factor in JPEG mode.
Permissions: readable.
Type: float.
Description: Image width. Retrieved with the following Webots function:
unsigned short camera_get_width (DeviceTag camera);
Permissions: readable.
Type: float.
Description: Image height. Retrieved with the following Webots function:
unsigned short camera_get_height (DeviceTag camera);
Permissions: readable, writeable.
Type: float.
Description: Image horizontal focal view. Retrieved and set with the following Webots function:
float camera_get_fov (DeviceTag camera); void camera_set_fov (DeviceTag camera, float fov);
Permissions: readable, writeable.
Type: float.
Description: Image vertical focal view. Calculated from the value of the horizontal focal view with the formula: yfov = xfov * height / width.
Permissions: readable.
Type: float.
Description: Distance of the camera to the near OpenGL clipping plane. Retrieved with the following Webots function:
float camera_get_near (DeviceTag camera);
Permissions: readable.
Type: float.
Description: Distance of the camera to the far OpenGL clipping plane. Retrieved with the following Webots function:
float camera_get_far (DeviceTag camera);
Construct a new differential wheels object. You have to set true or false in the isLeft field to set whether the wheel you are constructing is the left or right wheel. NB: DifferentialWheels goes by pair, so you must create the two DifferentialWheels objects for them to behave correctly.
Example:
wheelL = new DifferentialWheels("e-puck", true);
wheelR = new DifferentialWheels("e-puck", false);
Permissions: readable, writeable.
Type: float.
Definition: Encoders are counters incremented each time a wheel turns. The amount added to the encoder is computed from the angle the wheel have been rotated and from the "encoderResolution" parameter of the DifferentialWheels node. For convenience we also provide an "encoderFactor" which allows you to change easily the unit of the encoder on the Urbi side. Hence, if the "encoderResolution" is 100, the "encoderFactor" is -1 and the wheel made a whole revolution, the corresponding encoder will have its value incremented by about 100 * -1 * 6.28 = -628. Setting encoders value will not make the wheels rotate to reach the specified value, instead, it will simply reset the encoders with the specified value. Retrieved and set with the following Webots functions:
int differential_wheels_get_left_encoder (void); int differential_wheels_get_right_encoder (void); void differential_wheels_set_encoders (int left, int right);
Permissions: readable, writeable.
Type: float.
Definition: Current speed of the wheels. The speed unit is defined by the "speedUnit" field of the Webots DifferentialWheels node. The default value is 0.1 radian per seconds. For convenience we also provide an "speedFactor" which allows you to change easily the unit of the speed on the Urbi side. With a "speedFactor" of 10, a speed value of 20 will make the wheel rotate at a speed of 10 * 20 * 0.1 = 20 radian per seconds. Set with the following Webots function:
void differential_wheels_set_speed(short left, short right);
Permissions: readable, writeable.
Type: float.
Definition: Convenient variable to set the speed unit. See "speed" attribute.
Permissions: readable, writeable.
Type: float.
Definition: Convenient variable to set the encoder unit. See "encoder" attribute
Construct a new Distance Sensor object, corresponding to the DistanceSensor node in Webots. The "NodeName" attribute is the value of the name field, in the DistanceSensor node in Webots
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the DistanceSensor device. By default it is set to 1, which means that the DistanceSensor is enabled. If you set it to 0 it will disable it.
To enable and disable the device we use the following Webots functions:
void distance_sensor_enable (DeviceTag sensor, unsigned short ms); void distance_sensor_disable (DeviceTag sensor);
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable, writeable.
Type: float.
Description: Distance returned by the sensor. If you want to change the unit of the distance sensor you can use the "factor" attribute, because the "val" attribute is multiplied by the "factor" attribute before being returned: "val" = "val" * "factor".
Retrieved with the following Webots function:
unsigned short distance_sensor_get_value (DeviceTag sensor);
Permissions: readable, writeable.
Type: float.
Description: Factor used to compute the distance sensor's value.
Construct a new Emitter component. The "NodeName" attribute is the value of the name field, in the Emitter node in Webots.
Adds to the emitters's queue a packet corresponding to the data of the UrbiVariable, plus some informations on the type of the variable. Then the enqueued data packets will be sent to potential receivers (and removed from the emitter's queue) at the rate specified by the baudRate field of the Emitter node. On success this function returns 0. If the queue is currently full, 1 is returned and the packet will not be enqueued. The queue is considered to be full when the sum of bytes of all the enqueued packets exceeds the buffer size specified by the bufferSize field. NB: You can send every type of URBI variables with the send function EXCEPT UObjects variables.
Example:
var1 = "hello world";
emitter.send (var1);
// will send 13 bytes:
// '"','h','e','l','l','o',' ','w','o','r','l','d','"'
// note that the enclosing quotes ("") are also send, in order for the
// receiver to be able to recognize that the received data is a string
var2=BIN 11;hello world
emitter.send (var2),
// will send 20 bytes: 5 bytes for the BIN header, 2 bytes for the
// size, 1 byte for the ';', and 11 bytes for the actual data (hello
// world) (the BIN header size can augment if you set some information
// in the BIN header variable, like in images variables for example).
Note that if you set the "rawMode" attribute to true, then the comportment of the send () function will change. When "rawMode" is true, you can only send BIN variables with the send () function, and only the data in the BIN variable is send.
var2=BIN 11;hello world emitter.rawMode = true; emitter.send (var2); /// Will send 11 bytes: // 'h','e','l','l','o',' ','w','o','r','l','d' // ie only the bytes that are in the data of the BIN variable.
Please note that since no type information is included in the send data, an URBI receiver won't be able to parse the data received and won't be able to recreate the corresponding URBI variable.
This function use the following Webots functions:
int emitter_send_packet (DeviceTag emitter, const void *data, int size);
Permissions: readable, writeable.
Type: float.
Description: Size (in bytes) of the emission buffer. This corresponds to the value specified by the bufferSize field of the Emitter node. The buffer size indicates the maximal amount of data bytes that the emitter's queue can hold in total.
Retrieved with the following Webots function:
int emitter_get_buffer_size (DeviceTag emitter);
Permissions: readable, writeable.
Type: float.
Description: Emission channel. Change it to modifies the channel field of the corresponding Emitter node. Normally, an emitter can send data only to receivers that use the same channel. However, the value -1 can be used for broadcasting to all channels. By switching the channel number an emitter can selectively send data to different receivers.
Retrieved and set with the following Webots functions:
void emitter_set_channel (DeviceTag emitter, int channel); int emitter_get_channel (DeviceTag emitter);
Permissions: readable, writeable.
Type: float.
Description: Emission range. Change it to modifies the range field of the corresponding Emitter node. If the range is larger than the maxRange field of the Emitter node then the current range will be set to maxRange.
Retrieved with the following Webots function:
void emitter_set_range (DeviceTag emitter, float range); float emitter_get_range (DeviceTag emitter);
Permissions: readable, writeable.
Type: float.
Description: Set this attribute to true to enable sending BIN variables in raw mode (ie only the data in BIN variables is send). Please see "receive ()" function for more information.
Construct a new Gps object. The "NodeName" attribute is the value of the name field, in the Gps node in Webots. The "ComponentName" is the name of the Gps component this object represent. Because you need 3 Gps UObject to represent the Webots Gps device. Each Gps UObject represent one of the component of the Webots Gps device. "ComponentName" can take 3 values: "x", "y" or "z".
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the Gps device. By default it is set to 1, which means that the Gps is enabled. If you set it to 0 it will disable it. NB: If you enable or disable one of the Gps UObject component, then all the associated Gps UObject components will also be enabled or disabled (ex: if you disable the y Gps component, then the x and z Gps components will also be disabled).
To enable and disable the device we use the following Webots functions:
void gps_enable (DeviceTag sensor, unsigned short ms); void gps_disable (DeviceTag sensor);
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable.
Type: float.
Description: The value of the component this UObject represent. So it is one of the 3 component of the Webots Gps device. Either x, y or z.
Retrieved with the following Webots functions:
const float *gps_get_matrix (DeviceTag sensor); float gps_position_x (float *matrix); float gps_position_y (float *matrix); float gps_position_z (float *matrix);
Permissions: readable.
Type: float.
Description: Euler angles associated to the UObject component. If the component of this UObject is x or z, then the Euler angle can be interpreted as inclinometer angle value along either the local X or the local Z axis. If the component is y, then Euler angle can be interpreted as a compass angle value. NB: the angles are given in degrees !
Retrieved with the following Webots functions:
void gps_euler (const float *matrix, float *euler); const float *gps_get_matrix (DeviceTag sensor);
Construct a new Gripper component. The "NodeName" attribute is the value of the name field, in the Gripper node in Webots.
Permissions: readable, writeable.
Type: float.
Description: Position of the Gripper device.
Retrieved and set with the following Webots functions:
float gripper_get_position (DeviceTag gripper); void gripper_set_position (DeviceTag gripper, float position);
Permissions: readable.
Type: float.
Description: the resistivity of the Gripper device.
Retrieved with the following Webots function:
float gripper_get_resistivity (DeviceTag gripper);
Construct a new Keyboard object. This object is used to retrieve the key codes corresponding to keys pressed on the keyboard.
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the Keyboard device. By default it is set to 1, which means that the Keyboard is enabled. If you set it to 0 it will disable it.
To enable and disable the device we use the following Webots functions:
void robot_keyboard_enable(unsigned short ms); void robot_keyboard_disable();
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable.
Type: float.
Description: Key code corresponding to the key currently pressed on the keyboard. If no key is currently pressed, "val" equal 0.
Retrieved with the following Webots function:
int robot_keyboard_get_key();
Construct a new Led object. The "NodeName" attribute is the value of the name field, in the Led node in Webots
Permissions: readable, writeable.
Type: float.
Description: Value of the led. Usually leds have two possible values, 0 for Off and 1 for On, but it is also possible to use other values depending on the Webots model.
Set with the following Webots function:
void led_set (DeviceTag device, unsigned char value);
Construct a new Light Sensor object. The "NodeName" attribute is the value of the name field, in the LightSensor node in Webots.
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the LightSensor device. By default it is set to 1, which means that the LightSensor is enabled. If you set it to 0 it will disable it.
To enable and disable the device we use the following Webots functions:
void light_sensor_enable (DeviceTag sensor, unsigned short ms); void light_sensor_disable (DeviceTag sensor);
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable.
Type: float.
Description: Light value measured by the sensor. The values measured are computed from the lookup table defined in the corresponding Webots node.
Retrieved with the following Webots function:
unsigned short light_sensor_get_value (DeviceTag sensor);
Construct a new Plunger object. The "NodeName" attribute is the value of the name field, in the Servo node in Webots. In Webots plunger objects do not exist. They are emulated by Servo with on and off modes represented by the min and max values of the Servo (we remind the reader that a plunger is a device with two states: On / Off). In Urbi Plungers usually varies from 0 to 1. So the offValue and onValue you have to pass to the constructor are the values corresponding to On and Off in Webots. NB: all values must be given in degree (while in Webots they are in radian) !
Permissions: readable, writeable.
Type: float.
Description: The value of the plunger. When you set this value, the value that will be given to Webots is computed as follow: val * ((onValue - offValue) + offValue). NB: all values must be given in degree (while in Webots they are in radian) !
Retrieved and set with the following Webots function:
float servo_get_position (DeviceTag servo); void servo_set_position (DeviceTag servo, float position);
Construct a new Receiver component. The "NodeName" attribute is the value of the name field, in the Receiver node in Webots.
Returns an URBI variable corresponding to the data of the packet at the head of the reception queue. An URBI receiver can only receive data from an URBI emitter, because the URBI emitter send the data corresponding to URBI variables given to its emit () function, plus some informations on the type of the variable. The receiver then parse the received data to recreate the URBI variable. If the URBI emitter is in rawMode, the Receiver won't be able to parse the received values. So you have to set the receiver rawMode also. In raw mode, the receiver returns BIN variables containing the data received. Please refers to Webots documentation for more information on the Receiver device.
This function use the following Webots functions:
const void *receiver_get_data (DeviceTag receiver);
Deletes the head packet. The next packet in the queue, if any, becomes the new head packet.
This function use the following Webots functions:
void receiver_next_packet (DeviceTag receiver);
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the Receiver device. By default it is set to 1, which means that the Receiver is enabled. If you set it to 0 it will disable it.
To enable and disable the device we use the following Webots functions:
void receiver_enable (DeviceTag receiver, unsigned short ms); void receiver_disable (DeviceTag receiver);
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable, writeable.
Type: float.
Description: Reception channel. Normally, receiver can only receive data packets from emitters that use the same channel, however, the value -1 can be used to listen simultaneously to all channels.
Retrieved and set with the following Webots functions:
void receiver_set_channel (DeviceTag receiver, int channel); int receiver_get_channel (DeviceTag receiver);
Permissions: readable.
Type: float.
Description: Number of data bytes present in the head packet of the reception queue. Since it is URBI variables that are sent, the receiver need informations on the type of the variable to be able to retrieve it correctly. So dataSize is usually greater than the actual data size.
Retrieved with the following Webots function:
int receiver_get_data_size (DeviceTag receiver);
Permissions: readable.
Type: list of 3 float values.
Description: Normalized vector that indicates the direction of the emitter with respect to the receiver's coordinate system. The three vector components indicate respectively the x, y, and z-direction of the emitter.
Retrieved with the following Webots function:
const float *receiver_get_emitter_direction (DeviceTag receiver);
Permissions: readable.
Type: float.
Description: Number of data packets currently present in the receiver's queue.
Retrieved with the following Webots function:
int receiver_get_queue_length (DeviceTag receiver);
Permissions: readable, writeable.
Type: float.
Description: Set this attribute to true to enable receiving data in raw mode. In raw mode the "receive ()" function will return BIN variables containing the data received. Use this mode when you the emitter emit non Urbi data.
Permissions: readable.
Type: float.
Description: Simulated signal strength at the time the last packet was transmitted. This signal strength is equal to the inverse of the squared distance between the emitter and the receiver. In other words: s = 1 / r^2, where s is the signal strength and r is the distance between emitter and receiver.
Retrieved with the following Webots function:
float receiver_get_signal_strength (DeviceTag receiver);
Construct a new RobotName object. This object is used to retrieve the name of the robot associated to the URBI controller.
Construct a new Servo object. The "NodeName" attribute is the value of the name field, in the Servo node in Webots. The "ForceFeedback" attribute is a boolean that enable, when set to true, the measurement of the force applied to the joint. The value measured is available in the "force" attribute. NB: all values must be given in degree (while in Webots they are in radian) !
Permissions: readable, writeable.
Type: float.
Description: Value of the servo. NB: all values must be given in degree (while in Webots they are in radian) !
Retrieved and set with the following Webots functions:
float servo_get_position (DeviceTag servo); void servo_set_position (DeviceTag servo, float position);
Permissions: writable.
Type: float.
Description: changes the value of the P parameter of the P-controller. P is a parameter used to compute the current servo velocity Vc from the current position Pc and target position Pt, such that Vc = P * (Pt - Pc). With a small P a long time is needed to reach the target position while a too large P can make the system unstable. The default value of P is specified by controlP field of the corresponding Webots Servo node.
Set with the following Webots function:
void servo_set_control_p (DeviceTag servo, float p);
Permissions: readable.
Type: float.
Description: Motor force measurement. "force" is equal to the amount of motor force that is currently being deployed by the servo in order to achieve the desired motion or hold the current position. The measurement of this force is only available if you set the forceFeedback parameter to true in the constructor of Servo.
Retrieved with the following Webots function:
float servo_get_motor_force_feedback (DeviceTag servo);
Construct a new TouchSensor object. The "NodeName" attribute is the value of the name field, in the Touchsensor node in Webots
Permissions: readable, writeable.
Type: float.
Range: {0,1}
Description: This attribute let you enable or disable the TouchSensor device. By default it is set to 1, which means that the TouchSensor is enabled. If you set it to 0 it will disable it.
To enable and disable the device we use the following Webots functions:
void touch_sensor_enable (DeviceTag sensor, unsigned short ms); void touch_sensor_disable (DeviceTag sensor);
The frequency given to the enable function is the frequency of the URBI controller (given in the "controllerArgs" field in the .wbt file).
Permissions: readable, writable.
Type: float.
Description: Value returned by the sensor, computed according to the lookup table in the TouchSensor node.
Retrieved with the following Webots function:
unsigned short touch_sensor_get_value (DeviceTag sensor);