QbSoftHand

class QbSoftHand(self)

Bases: QbDevice

Interface for qbSoftHand device .

See https://qbrobotics.com/ for more details.

Note

Before using this class under Linux (Ubuntu, Debian, Fedora…) it is mandatory to add user to the dialout group. To do so, you must execute:

$ sudo adduser user_name dialout

otherwise you will get an error:

vpQbDevice fails while opening [/dev/ttyUSB0] and sets errno [Permission denied].

The following example shows how to close and open the SoftHand with a given speed factor and stiffness used to stop the command applied to the motors when the measured current is larger than the stiffness multiplied by the maximum allowed current that can be applied to the motors.

#include <visp3/robot/vpQbSoftHand.h>

int main()
{
  vpQbSoftHand qbsofthand;

  vpColVector q(1);

  double speed_factor = 0.5; // half speed
  double stiffness = 0.7;    // 70% of the max allowed current supported by the motors
  std::cout << "** Close the hand with blocking positioning function" << std::endl;
  q[0] = 1;
  qbsofthand.setPosition(q, speed_factor, stiffness);

  std::cout << "** Open the hand with blocking positioning function" << std::endl;
  q[0] = 0;
  qbsofthand.setPosition(q, speed_factor, stiffness);
}

Default constructor that does nothing. To connect to a device call init() .

Methods

__init__

Default constructor that does nothing.

getCurrent

Retrieve the motor currents of the given device.

getPosition

Retrieve the motor position of the given device.

setPosition

Overloaded function.

Inherited Methods

setMaxRepeats

Set the maximum number of consecutive repetitions to mark retrieved data as corrupted.

getCurrentMax

Return the maximum current supported by the device.

getPositionLimits

return:

Position limits as a 2-dim vector with min and max values.

Operators

__doc__

__init__

Default constructor that does nothing.

__module__

Attributes

__annotations__

__init__(self)

Default constructor that does nothing. To connect to a device call init() .

getCurrent(self, current: visp._visp.core.ColVector, id: int = 1) None

Retrieve the motor currents of the given device.

Parameters:
current: visp._visp.core.ColVector

The one-element device motor current vector, expressed in mA .

id: int = 1

The ID of the device of interest, in range [ 1 , 128 ].

getCurrentMax(self) float

Return the maximum current supported by the device.

getPosition(self, position: visp._visp.core.ColVector, id: int = 1) None

Retrieve the motor position of the given device.

Note

See getMeasurements()

Parameters:
position: visp._visp.core.ColVector

The device one-element position vector, expressed in range [ 0 , 1 ] with 0 corresponding to an opened hand and 1 a closed hand.

id: int = 1

The ID of the device of interest, in range [ 1 , 128 ].

getPositionLimits(self) list[int]
Returns:

Position limits as a 2-dim vector with min and max values.

setMaxRepeats(self, max_repeats: int) None

Set the maximum number of consecutive repetitions to mark retrieved data as corrupted. This value is set by default to 1.

setPosition(*args, **kwargs)

Overloaded function.

  1. setPosition(self: visp._visp.robot.QbSoftHand, position: visp._visp.core.ColVector, id: int = 1) -> None

Send the reference command to the motors of the device with given id in a non-blocking fashion.

Parameters:
position

The one-element position vector in range [ 0 , 1 ] with 0 corresponding to an opened hand and 1 a closed hand.

id

The ID of the device of interest, in range [ 1 , 128 ].

  1. setPosition(self: visp._visp.robot.QbSoftHand, position: visp._visp.core.ColVector, speed_factor: float, stiffness: float, id: int = 1) -> None

Send the reference command to the motors of the device with given id in a blocking fashion.

Parameters:
position

The one-element position vector in range [ 0 , 1 ] with 0 corresponding to an opened hand and 1 a closed hand.

speed_factor

The speed factor in range [ 0.01 , 1 ] with 1 corresponding to the fastest mouvement.

stiffness

Stiffness parameter in range [ 0 , 1 ] is the scale factor applied to the maximum allowed current in order to limit the current into the motors. When set at zero, you can send any position command to the motors, but he will not move. When set to 1, it means that the maximum current returned by getCurrentMax() could be reached during positioning.

id

The ID of the device of interest, in range [ 1 , 128 ].