Skip to content

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.

xml
<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:

xml
<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 ​

cpp
enum class Type : int

How the gripper holds an object.

EnumeratorValueDescription
SUCTION0A suction cup: holds any surface it seals on.
MAGNETIC1An electromagnet: holds magnetic materials.

Public attributes ​

kMaxPadSamples ​

cpp
static constexpr int kMaxPadSamples

The most samples a pad grid can have, padSamples[0] * padSamples[1].

name ​

cpp
std::string name

Name, unique among the grippers of the system.

cpp
std::string link

Name of the URDF link the gripper is fixed to.

type ​

cpp
Type type

How the gripper holds an object.

position ​

cpp
Vec<3> position

Center of the pad in the link frame [m].

axis ​

cpp
Vec<3> axis

Direction the pad faces, in the link frame. It is normalized when the gripper is set.

maxForce ​

cpp
double maxForce

SUCTION: the pull of a sealed cup [N]. MAGNETIC: the pull on a magnetic body that touches the pad [N].

range ​

cpp
double range

SUCTION: the largest gap at which the cup seals [m]. MAGNETIC: the gap at which the pull vanishes [m].

sealAngle ​

cpp
double sealAngle

SUCTION only: the largest angle between the facing surface normal and the reversed axis [rad].

cupRadius ​

cpp
double cupRadius

SUCTION only: the radius of the sampled rim [m]. Zero uses the center hit alone.

leakCoefficient ​

cpp
double leakCoefficient

SUCTION 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 ​

cpp
std::array<int, 2> padSamples

MAGNETIC 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 ​

cpp
Vec<2> padSize

MAGNETIC only: the lengths of the pad's x and y sides [m]. A side with more than one sample needs a positive length.

padXAxis ​

cpp
Vec<3> padXAxis

The 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.

RaiSim — physics for robotics and AI.