|
3.21 GripperDerived from Solid.
3.21.1 DescriptionThe Gripper node models a simple gripper system with two fingers capable of grasping small objects (typically vertical cylinders), moving them around and releasing them. This device should only be used in simple kinematic-based simulations (without Physics nodes). It provides a very fast simulation of a simple gripper device as opposed to the equivalent physics-based simulation. For more complex gripper usages, you should implement a physics-based simulation (i.e., with Physics nodes) including two Servo devices, each one being a finger of the gripper. The khepera_gripper.wbt file provides an example of a robot using such a simple gripper system in a kinematic-based simulation (located in the projects/robots/khepera/worlds directory of Webots). To be operational, a Gripper node must contain two Solid nodes as children. These Solid nodes should be named "left grip" and "right grip" (name field). They correspond to the fingers of the gripper. Each of these Solid nodes should have a properly defined boundingObject field. As shown in the khepera_gripper.wbt example, the Gripper node can be mounted on the top of a Servo node acting like an arm. Moreover, distance sensors or other sensor types can be mounted on the fingers of the gripper. 3.21.2 Field Summary
3.21.3 Gripper FunctionsNAMEwb_gripper_set_position - open or close the gripperC SYNOPSIS#include <webots/gripper.h>void wb_gripper_set_position(WbDeviceTag gripper, double position); C++ SYNOPSIS#include <webots/Gripper.hpp>void Gripper::setPosition(double position); JAVA SYNOPSISimport com.cyberbotics.webots.controller.Gripper;void Gripper.setPosition(double position); PYTHON SYNOPSISfrom controller import Grippernone Gripper.setPosition(float position) DESCRIPTIONThe wb_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. NAMEwb_gripper_enable_position, wb_gripper_disable_position, wb_gripper_get_position - enable, disable and return the current state of the position sensor on a gripperC SYNOPSIS#include <webots/gripper.h>void wb_gripper_enable_position(WbDeviceTag gripper, int ms); void wb_gripper_disable_position(WbDeviceTag gripper); double wb_gripper_get_position(WbDeviceTag gripper); C++ SYNOPSIS#include <webots/Gripper.hpp>void Gripper::enablePosition(int ms); void Gripper::disablePosition(); double Gripper::getPosition(); JAVA SYNOPSISimport com.cyberbotics.webots.controller.Gripper;void Gripper.enablePosition(int ms); void Gripper.disablePosition(); double Gripper.getPosition(); PYTHON SYNOPSISfrom controller import Grippernone Gripper.enablePosition(int ms) none Gripper.disablePosition() float Gripper.getPosition() DESCRIPTIONThe wb_gripper_enable_position() function starts gripper position measurements each ms milliseconds. The wb_gripper_disable_position() function stops the gripper position measurements. The wb_gripper_get_position() function returns the position measurement of the specified gripper device. The position is expressed in meters, and corresponds to the aperture of the gripper (as with the wb_gripper_set_position() function). However, it returns the current position of the gripper, and not the target position specified with wb_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. NAMEwb_gripper_enable_resistivity, wb_gripper_disable_resistivity, wb_gripper_get_resistivity - perform resistivity measurements on a gripperC SYNOPSIS#include <webots/gripper.h>void wb_gripper_enable_resistivity(WbDeviceTag gripper, int ms); void wb_gripper_disable_resistivity(WbDeviceTag gripper); double wb_gripper_get_resistivity(WbDeviceTag gripper); C++ SYNOPSIS#include <webots/Gripper.hpp>void Gripper::enableResistivity(int ms); void Gripper::disableResistivity(); double Gripper::getResistivity(); JAVA SYNOPSISimport com.cyberbotics.webots.controller.Gripper;void Gripper.enableResistivity(int ms); void Gripper.disableResistivity(); double Gripper.getResistivity(); PYTHON SYNOPSISfrom controller import Grippernone Gripper.enableResistivity(int ms) none Gripper.disableResistivity() float Gripper.getResistivity() DESCRIPTIONThe wb_gripper_enable_resistivity() function enables gripper resistivity measurements each ms milliseconds. The wb_gripper_disable_resistivity() function stops the gripper resistivity measurements. The wb_gripper_get_resistivity() function returns the resistivity measurement performed on the specified gripper device. This value is expressed in Ohms. The current version of Webots assumes 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. ![]() ^ page top ^ |
| E-mail to webmaster | Last updated: | Copyright © 2008 Cyberbotics Ltd. |