Webots Reference Manual

previous page go up next page

Thanks

1.Introduction

2.Controller API

3.Webots File Format

     

2.8 Gripper

gripper_set_position
gripper_enable_position, gripper_enable_resistivity, gripper_disable_position, gripper_disable_resistivity
gripper_get_position, gripper_get_resistivity

gripper_set_position

NAME

   gripper_set_position -- open or close the gripper

SYNOPSIS

  #include <device/gripper.h>

   void gripper_set_position (DeviceTag gripper, gfloat position);

DESCRIPTION

The gripper_set_position function allows the user to close or open the gripper depending on the specified position value which represents the aperture of the gripper device, expressed in meters. Hence a value of 0 will close the gripper and a value of 0.04 will open the gripper 4 cm wide.

gripper_enable_position

NAME

   gripper_enable_position, gripper_enable_resistivity, gripper_disable_position, gripper_disable_resistivity -- enable or disable the position and resistivity sensors on a gripper

SYNOPSIS

  #include <device/gripper.h>

   void gripper_enable_position (DeviceTag gripper, guint16 ms);
   void gripper_enable_resistivity (DeviceTag gripper, guint16 ms);
   void gripper_disable_position (DeviceTag gripper);
   void gripper_disable_resistivity (DeviceTag gripper);

DESCRIPTION

These functions enable each ms milliseconds or disable the gripper position and resistivity measurement.

gripper_get_position

NAME

   gripper_get_position, gripper_get_resistivity -- return the position and resistivity values measured on the gripper

SYNOPSIS

  #include <device/gripper.h>

   gfloat gripper_get_position (DeviceTag gripper);
   gfloat gripper_get_resistivity (DeviceTag gripper);

DESCRIPTION

The gripper_get_position function returns the position measurement performed on the speficied gripper device. The position is expressed in meters and corresponds to the aperture of the gripper as with the gripper_set_position function. However, it returns the current position of the gripper and not the target position specified with gripper_set_position (which may be the same value when the target position is reached). This function may be useful to measure the size of a gripped object.

The gripper_get_resistivity function returns the resistivity measurement performed on the specified gripper device. This value is expressed in ohm. In this first version, we assume that any object has a resistivity of one ohm. It will return Inf when no object is gripped and 1.0 when an object is gripped.

previous page go up next page
^ page top ^

  E-mail to webmaster Last updated: Copyright © 2002 Cyberbotics Ltd.