Robotics Library  0.7.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
rl::hal::WeissWsg50 Class Reference

Weiss Robotics Universal Gripper WSG 50. More...

#include <WeissWsg50.h>

Inheritance diagram for rl::hal::WeissWsg50:
Inheritance graph
[legend]

Public Types

enum  GraspingState {
  GRASPING_STATE_IDLE = 0, GRASPING_STATE_GRIPPING = 1, GRASPING_STATE_NO_PART_FOUND = 2, GRASPING_STATE_PART_LOST = 3,
  GRASPING_STATE_HOLDING = 4, GRASPING_STATE_RELEASING = 5, GRASPING_STATE_POSITIONING = 6, GRASPING_STATE_ERROR = 7
}
 
enum  SystemState {
  SYSTEM_STATE_SCRIPT_FAILURE = 1048576, SYSTEM_STATE_SCRIPT_RUNNING = 524288, SYSTEM_STATE_COMMAND_FAILURE = 262144, SYSTEM_STATE_FINGER_FAULT = 131072,
  SYSTEM_STATE_CURRENT_FAULT = 65536, SYSTEM_STATE_POWER_FAULT = 32768, SYSTEM_STATE_TEMPERATURE_FAULT = 16384, SYSTEM_STATE_TEMPERATURE_WARNING = 8192,
  SYSTEM_STATE_FAST_STOP = 4096, SYSTEM_STATE_FORCE_CONTROL_MODE = 512, SYSTEM_STATE_OVERDRIVE_MODE = 256, SYSTEM_STATE_TARGET_POSITION_REACHED = 128,
  SYSTEM_STATE_AXIS_STOPPED = 64, SYSTEM_STATE_SOFT_LIMIT_PLUS = 32, SYSTEM_STATE_SOFT_LIMIT_MINUS = 16, SYSTEM_STATE_AXIS_BLOCKED_PLUS = 8,
  SYSTEM_STATE_AXIS_BLOCKED_MINUS = 4, SYSTEM_STATE_MOVING = 2, SYSTEM_STATE_REFERENCED = 1
}
 

Public Member Functions

 WeissWsg50 (const ::std::string &address="192.168.1.20", const unsigned short int &port=1000, const float &acceleration=3.0f, const float &forceLimit=40.0f, const unsigned int &period=10)
 
virtual ~WeissWsg50 ()
 
void acknowledgeFaults ()
 
void close ()
 
void doAcknowledgeFaults ()
 
void doFastStop ()
 
void doGetAcceleration ()
 
void doClearSoftLimits ()
 
void doGetForce (const bool &doAutomaticUpdate, const bool &doUpdateOnChange, const unsigned int &period=0)
 
void doGetForceLimit ()
 
void doGetGraspingState (const bool &doAutomaticUpdate, const bool &doUpdateOnChange, const unsigned int &period=0)
 
void doGetGraspingStatistics (const bool &doReset, int &numberGraspsTotal, int &numberGraspsNoPart, int &numberGraspsLostPart)
 
void doGetOpeningWidth (const bool &doAutomaticUpdate, const bool &doUpdateOnChange, const unsigned int &period=0)
 
void doGetSoftLimits ()
 
void doGetSpeed (const bool &doAutomaticUpdate, const bool &doUpdateOnChange, const unsigned int &period=0)
 
void doGetSystemInformation (bool &isWsg50, int &hardwareRevision, int &firmwareRevision, int &serialNumber)
 
void doGetSystemLimits ()
 
void doGetSystemState (const bool &doAutomaticUpdate, const bool &doUpdateOnChange, const unsigned int &period=0)
 
float doGetTemperature ()
 
void doGraspPart (const float &width, const float &speed)
 
void doHomingMotion (const unsigned int &direction=0)
 Perform necessary homing motion for calibration. More...
 
void doOverdriveMode (const bool &doOverdriveMode)
 
void doPrePositionFingers (const float &width, const float &speed, const bool &doRelativeMovement=false, const bool &doStopOnBlock=false)
 
void doReleasePart (const float &width, const float &speed)
 
void doSetAcceleration (const float &acceleration)
 
void doSetForceLimit (const float &force)
 
void doSetSoftLimits (const float &limitMinus, const float &limitPlus)
 
void doStop ()
 
void doTareForceSensor ()
 
float getAcceleration () const
 
float getForce () const
 
float getForceLimit () const
 
GraspingState getGraspingState () const
 
float getOpeningWidth () const
 
float getSpeed () const
 
SystemState getSystemState () const
 
void halt ()
 
void open ()
 
void release ()
 
void shut ()
 
void start ()
 
void step ()
 
void stop ()
 
- Public Member Functions inherited from rl::hal::CyclicDevice
 CyclicDevice (const ::std::chrono::nanoseconds &updateRate)
 
virtual ~CyclicDevice ()
 
virtual ::std::chrono::nanoseconds getUpdateRate () const
 
- Public Member Functions inherited from rl::hal::Device
 Device ()
 
virtual ~Device ()
 
bool isConnected () const
 
bool isRunning () const
 
- Public Member Functions inherited from rl::hal::Gripper
 Gripper ()
 
virtual ~Gripper ()
 

Private Member Functions

::std::uint16_t crc (const ::std::uint8_t *buf, const ::std::size_t &len) const
 
void doDisconnectAnnouncement ()
 
::std::size_t recv (::std::uint8_t *buf)
 
::std::size_t recv (::std::uint8_t *buf, const ::std::size_t &len, const ::std::uint8_t &command)
 
void send (::std::uint8_t *buf, const ::std::size_t &len)
 

Private Attributes

float acceleration
 
float accelerationMaximum
 
float accelerationMinimum
 
float force
 
float forceLimit
 
float forceMinimum
 
float forceNominal
 
float forceOverdrive
 
GraspingState graspingState
 
float limitMinus
 
float limitPlus
 
float openingWidth
 
unsigned int period
 
Socket socket
 
float speed
 
float speedMaximum
 
float speedMinimum
 
float stroke
 
SystemState systemState
 

Static Private Attributes

static const ::std::size_t HEADER_SIZE = 6
 

Additional Inherited Members

- Protected Member Functions inherited from rl::hal::Device
void setConnected (const bool &connected)
 
void setRunning (const bool &running)
 

Detailed Description

Weiss Robotics Universal Gripper WSG 50.

See "WSG Series of Intelligent Servo-Electric Grippers: Command Set Reference Manual": http://www.weiss-robotics.de/en/download.html?cid=1&fid=37&id=314

Important: Before use, you usually need to set "Part Width Tolerance" and "Default Clamping Travel" to maximum in the web interface. Otherwise, the gripper will not grasp if object width is different from the given value.

Member Enumeration Documentation

◆ GraspingState

Enumerator
GRASPING_STATE_IDLE 
GRASPING_STATE_GRIPPING 
GRASPING_STATE_NO_PART_FOUND 
GRASPING_STATE_PART_LOST 
GRASPING_STATE_HOLDING 
GRASPING_STATE_RELEASING 
GRASPING_STATE_POSITIONING 
GRASPING_STATE_ERROR 

◆ SystemState

Enumerator
SYSTEM_STATE_SCRIPT_FAILURE 
SYSTEM_STATE_SCRIPT_RUNNING 
SYSTEM_STATE_COMMAND_FAILURE 
SYSTEM_STATE_FINGER_FAULT 
SYSTEM_STATE_CURRENT_FAULT 
SYSTEM_STATE_POWER_FAULT 
SYSTEM_STATE_TEMPERATURE_FAULT 
SYSTEM_STATE_TEMPERATURE_WARNING 
SYSTEM_STATE_FAST_STOP 
SYSTEM_STATE_FORCE_CONTROL_MODE 
SYSTEM_STATE_OVERDRIVE_MODE 
SYSTEM_STATE_TARGET_POSITION_REACHED 
SYSTEM_STATE_AXIS_STOPPED 
SYSTEM_STATE_SOFT_LIMIT_PLUS 
SYSTEM_STATE_SOFT_LIMIT_MINUS 
SYSTEM_STATE_AXIS_BLOCKED_PLUS 
SYSTEM_STATE_AXIS_BLOCKED_MINUS 
SYSTEM_STATE_MOVING 
SYSTEM_STATE_REFERENCED 

Constructor & Destructor Documentation

◆ WeissWsg50()

rl::hal::WeissWsg50::WeissWsg50 ( const ::std::string &  address = "192.168.1.20",
const unsigned short int &  port = 1000,
const float &  acceleration = 3.0f,
const float &  forceLimit = 40.0f,
const unsigned int &  period = 10 
)
Parameters
[in]addressTCP hostname
[in]portTCP port
[in]acceleration[0.1,..,5] [m/s^2]
[in]forceLimit[5,..,80] [N]
[in]periodDefault automatic update period [ms]

◆ ~WeissWsg50()

rl::hal::WeissWsg50::~WeissWsg50 ( )
virtual

Member Function Documentation

◆ acknowledgeFaults()

void rl::hal::WeissWsg50::acknowledgeFaults ( )

◆ close()

void rl::hal::WeissWsg50::close ( )
virtual
Precondition
stop()

Implements rl::hal::Device.

◆ crc()

std::uint16_t rl::hal::WeissWsg50::crc ( const ::std::uint8_t *  buf,
const ::std::size_t &  len 
) const
private

◆ doAcknowledgeFaults()

void rl::hal::WeissWsg50::doAcknowledgeFaults ( )

◆ doClearSoftLimits()

void rl::hal::WeissWsg50::doClearSoftLimits ( )

◆ doDisconnectAnnouncement()

void rl::hal::WeissWsg50::doDisconnectAnnouncement ( )
private

◆ doFastStop()

void rl::hal::WeissWsg50::doFastStop ( )

◆ doGetAcceleration()

void rl::hal::WeissWsg50::doGetAcceleration ( )

◆ doGetForce()

void rl::hal::WeissWsg50::doGetForce ( const bool &  doAutomaticUpdate,
const bool &  doUpdateOnChange,
const unsigned int &  period = 0 
)

◆ doGetForceLimit()

void rl::hal::WeissWsg50::doGetForceLimit ( )

◆ doGetGraspingState()

void rl::hal::WeissWsg50::doGetGraspingState ( const bool &  doAutomaticUpdate,
const bool &  doUpdateOnChange,
const unsigned int &  period = 0 
)

◆ doGetGraspingStatistics()

void rl::hal::WeissWsg50::doGetGraspingStatistics ( const bool &  doReset,
int &  numberGraspsTotal,
int &  numberGraspsNoPart,
int &  numberGraspsLostPart 
)

◆ doGetOpeningWidth()

void rl::hal::WeissWsg50::doGetOpeningWidth ( const bool &  doAutomaticUpdate,
const bool &  doUpdateOnChange,
const unsigned int &  period = 0 
)

◆ doGetSoftLimits()

void rl::hal::WeissWsg50::doGetSoftLimits ( )

◆ doGetSpeed()

void rl::hal::WeissWsg50::doGetSpeed ( const bool &  doAutomaticUpdate,
const bool &  doUpdateOnChange,
const unsigned int &  period = 0 
)

◆ doGetSystemInformation()

void rl::hal::WeissWsg50::doGetSystemInformation ( bool &  isWsg50,
int &  hardwareRevision,
int &  firmwareRevision,
int &  serialNumber 
)

◆ doGetSystemLimits()

void rl::hal::WeissWsg50::doGetSystemLimits ( )

◆ doGetSystemState()

void rl::hal::WeissWsg50::doGetSystemState ( const bool &  doAutomaticUpdate,
const bool &  doUpdateOnChange,
const unsigned int &  period = 0 
)

◆ doGetTemperature()

float rl::hal::WeissWsg50::doGetTemperature ( )
Returns
[ °C ]

◆ doGraspPart()

void rl::hal::WeissWsg50::doGraspPart ( const float &  width,
const float &  speed 
)
Parameters
[in]width[in][0,..,0.11] [m]
[in]speed[in][0,..,0.4] [m/s]

◆ doHomingMotion()

void rl::hal::WeissWsg50::doHomingMotion ( const unsigned int &  direction = 0)

Perform necessary homing motion for calibration.

This function call is blocking until the calibration is complete.

Parameters
[in]direction0 = default from system configuration, 1 = positive movement, 2 = negative movement

◆ doOverdriveMode()

void rl::hal::WeissWsg50::doOverdriveMode ( const bool &  doOverdriveMode)

◆ doPrePositionFingers()

void rl::hal::WeissWsg50::doPrePositionFingers ( const float &  width,
const float &  speed,
const bool &  doRelativeMovement = false,
const bool &  doStopOnBlock = false 
)
Parameters
[in]width[0,..,0.11] [m]
[in]speed[0,..,0.4] [m/s]

◆ doReleasePart()

void rl::hal::WeissWsg50::doReleasePart ( const float &  width,
const float &  speed 
)
Parameters
[in]width[0,..,0.11] [m]
[in]speed[0.005,..,0.4] [m/s]

◆ doSetAcceleration()

void rl::hal::WeissWsg50::doSetAcceleration ( const float &  acceleration)
Parameters
[in]acceleration[0.1,..,5] [m/s^2]

◆ doSetForceLimit()

void rl::hal::WeissWsg50::doSetForceLimit ( const float &  force)
Parameters
[in]force[5,..,80] [N]

◆ doSetSoftLimits()

void rl::hal::WeissWsg50::doSetSoftLimits ( const float &  limitMinus,
const float &  limitPlus 
)
Parameters
[in]limitMinus[m]
[in]limitPlus[m]

◆ doStop()

void rl::hal::WeissWsg50::doStop ( )

◆ doTareForceSensor()

void rl::hal::WeissWsg50::doTareForceSensor ( )

◆ getAcceleration()

float rl::hal::WeissWsg50::getAcceleration ( ) const
Returns
[m/s^2]

◆ getForce()

float rl::hal::WeissWsg50::getForce ( ) const
Returns
[N]

◆ getForceLimit()

float rl::hal::WeissWsg50::getForceLimit ( ) const
Returns
[N]

◆ getGraspingState()

WeissWsg50::GraspingState rl::hal::WeissWsg50::getGraspingState ( ) const

◆ getOpeningWidth()

float rl::hal::WeissWsg50::getOpeningWidth ( ) const
Returns
[m]

◆ getSpeed()

float rl::hal::WeissWsg50::getSpeed ( ) const
Returns
[m/s]

◆ getSystemState()

WeissWsg50::SystemState rl::hal::WeissWsg50::getSystemState ( ) const

◆ halt()

void rl::hal::WeissWsg50::halt ( )
virtual

Implements rl::hal::Gripper.

◆ open()

void rl::hal::WeissWsg50::open ( )
virtual

Implements rl::hal::Device.

◆ recv() [1/2]

std::size_t rl::hal::WeissWsg50::recv ( ::std::uint8_t *  buf)
private

◆ recv() [2/2]

std::size_t rl::hal::WeissWsg50::recv ( ::std::uint8_t *  buf,
const ::std::size_t &  len,
const ::std::uint8_t &  command 
)
private

◆ release()

void rl::hal::WeissWsg50::release ( )
virtual

Implements rl::hal::Gripper.

◆ send()

void rl::hal::WeissWsg50::send ( ::std::uint8_t *  buf,
const ::std::size_t &  len 
)
private

◆ shut()

void rl::hal::WeissWsg50::shut ( )
virtual

Implements rl::hal::Gripper.

◆ start()

void rl::hal::WeissWsg50::start ( )
virtual
Precondition
open()

Implements rl::hal::Device.

◆ step()

void rl::hal::WeissWsg50::step ( )
virtual
Precondition
start()

Implements rl::hal::CyclicDevice.

◆ stop()

void rl::hal::WeissWsg50::stop ( )
virtual
Precondition
open()

Implements rl::hal::Device.

Member Data Documentation

◆ acceleration

float rl::hal::WeissWsg50::acceleration
private

◆ accelerationMaximum

float rl::hal::WeissWsg50::accelerationMaximum
private

◆ accelerationMinimum

float rl::hal::WeissWsg50::accelerationMinimum
private

◆ force

float rl::hal::WeissWsg50::force
private

◆ forceLimit

float rl::hal::WeissWsg50::forceLimit
private

◆ forceMinimum

float rl::hal::WeissWsg50::forceMinimum
private

◆ forceNominal

float rl::hal::WeissWsg50::forceNominal
private

◆ forceOverdrive

float rl::hal::WeissWsg50::forceOverdrive
private

◆ graspingState

GraspingState rl::hal::WeissWsg50::graspingState
private

◆ HEADER_SIZE

const ::std::size_t rl::hal::WeissWsg50::HEADER_SIZE = 6
staticprivate

◆ limitMinus

float rl::hal::WeissWsg50::limitMinus
private

◆ limitPlus

float rl::hal::WeissWsg50::limitPlus
private

◆ openingWidth

float rl::hal::WeissWsg50::openingWidth
private

◆ period

unsigned int rl::hal::WeissWsg50::period
private

◆ socket

Socket rl::hal::WeissWsg50::socket
private

◆ speed

float rl::hal::WeissWsg50::speed
private

◆ speedMaximum

float rl::hal::WeissWsg50::speedMaximum
private

◆ speedMinimum

float rl::hal::WeissWsg50::speedMinimum
private

◆ stroke

float rl::hal::WeissWsg50::stroke
private

◆ systemState

SystemState rl::hal::WeissWsg50::systemState
private

The documentation for this class was generated from the following files: