raisim::GripperDefinition
struct · #include <raisim/object/ArticulatedSystem/Gripper.hpp>
A suction cup or an electromagnet on a link of an articulated system. It is defined by a URDF <gripper> element or ArticulatedSystem::setGrippers().
The pad sits at position and faces along axis. It should lie on the surface of a collision body of the link, which is what an object touches when it is held. While the gripper is active (ArticulatedSystem::setGripperActive()), every step it finds the first surface in front of the pad, along axis, and if that surface is within range, pulls it toward the pad with a force and pulls the link toward it with the opposite force:
- SUCTION: the cup pulls on a surface whose normal is within sealAngle of the direction toward the pad. A positive cupRadius enables rim sampling and reduces the pull when the rim leaks. With cupRadius equal to zero, a valid center hit gets the full maxForce.
- MAGNETIC: the magnet pulls only bodies whose collision material is magnetic (World::setMagneticMaterial()), with maxForce * (1 - gap / range)^2, where gap is the distance between the pad and the surface. By default the pad is a point. A pad grid (padSamples, padSize, padXAxis) makes it a rectangle sampled at the centers of padSamples[0] x padSamples[1] equal cells: each sample finds its own surface along axis and pulls it with its share of maxForce, maxForce / (padSamples[0] * padSamples[1]) * (1 - gap / range)^2, at the point its ray hit, and pulls the link at the sample. The pull then grows with the part of the pad that faces magnetic material, and it acts where that part is: a pad that hangs over an edge pulls less, and off its center.
Where the pad touches the object, the contacts push back, so the pull also presses the object onto the pad: the gripper holds the object against a load of up to the pull, friction holds it against a sideways load of up to the friction coefficient times the pull, and the pad's rim holds it against tilting. A static object (the ground, a wall) cannot move; the link is pulled toward it instead, so the gripper anchors the robot.
<gripper name="cup" link="tool" type="suction" max_force="60" range="0.005" seal_angle="0.35">
<origin xyz="0 0 0.1"/>
<axis xyz="0 0 1"/>
</gripper>The axis is given in the frame of <origin>, like a joint axis. A magnetic pad grid:
<gripper name="magnet" link="tool" type="magnetic" max_force="200" range="0.01">
<origin xyz="0 0 0.1"/>
<axis xyz="0 0 1"/>
<pad size="0.06 0.04" samples="6 4" x_axis="1 0 0"/>
</gripper>x_axis is also given in the frame of <origin> (default 1 0 0).
Public types
Type
enum class Type : intHow the gripper holds an object.
| Enumerator | Value | Description |
|---|---|---|
SUCTION | 0 | A suction cup: holds any surface it seals on. |
MAGNETIC | 1 | An electromagnet: holds magnetic materials. |
Public attributes
kMaxPadSamples
static constexpr int kMaxPadSamplesThe most samples a pad grid can have, padSamples[0] * padSamples[1].
name
std::string nameName, unique among the grippers of the system.
link
std::string linkName of the URDF link the gripper is fixed to.
type
Type typeHow the gripper holds an object.
position
Vec<3> positionCenter of the pad in the link frame [m].
axis
Vec<3> axisDirection the pad faces, in the link frame. It is normalized when the gripper is set.
maxForce
double maxForceSUCTION: the pull of a sealed cup [N]. MAGNETIC: the pull on a magnetic body that touches the pad [N].
range
double rangeSUCTION: the largest gap at which the cup seals [m]. MAGNETIC: the gap at which the pull vanishes [m].
sealAngle
double sealAngleSUCTION only: the largest angle between the facing surface normal and the reversed axis [rad].
cupRadius
double cupRadiusSUCTION only: the radius of the sampled rim [m]. Zero uses the center hit alone.
leakCoefficient
double leakCoefficientSUCTION only: dimensionless sensitivity to leakage. The pull is maxForce * (1 - opening) / (1 + leakCoefficient * opening), where opening is the mean rim gap divided by range. Missing samples count as fully open.
padSamples
std::array<int, 2> padSamplesMAGNETIC only: the number of samples along the pad's x side and along its y side, at least 1 each and at most kMaxPadSamples in all. Sample j * padSamples[0] + i sits at the center of cell (i, j) of the grid over the pad. {1, 1} samples the pad center alone, the point magnet.
padSize
Vec<2> padSizeMAGNETIC only: the lengths of the pad's x and y sides [m]. A side with more than one sample needs a positive length.
padXAxis
Vec<3> padXAxisThe direction of the x side of a magnetic pad grid, in the link frame; the y side is along axis x padXAxis. Every gripper needs a finite, non-zero padXAxis, but only a grid of more than one sample uses it: it must then not be parallel to axis (give it for a pad that faces along x), and it is projected onto the plane of the pad and normalized when the gripper is set.