Skip to main content

Robotiq::Gripper Class

The Robotiq gripper Class.

Construction opens the link, reads the gripper — failing like a dead serial link when it does not answer — and starts the exchange cycle; destruction stops it. Control is instant: setCommand() and getStatus() access an internal process image and never touch the bus. The control image seeds from the gripper's own status echoes, so connecting never disturbs a gripper that is already running.

Concurrency model: accessors are thread-safe; the intended use is one control thread writing commands while a background exchange thread reads/writes the wire. Reads are whole snapshots and writes are whole commands — no per-field accessors, deliberately: every transmitted frame is a command the application composed, and two fields never come from different exchange cycles.

Included Headers

#include <gripper.hpp>

Members

Public Constructors
Gripper (const ConnectionConfig &config, std::shared_ptr< Logger > logger=nullptr)

The common-case constructor: create a gripper object and start communication over the built-in serial transport and the default platform. More...

Gripper (std::unique_ptr< Serial > serial, uint8_t slaveAddress, std::chrono::microseconds exchangePeriod, std::shared_ptr< Platform > platform, std::shared_ptr< Logger > logger=nullptr)

A general-purpose constructor for cases where the common-case constructor does not apply. Start communication over a caller-supplied transport and platform. More...

Gripper (const Gripper &)=delete
Public Destructor
~Gripper ()

Stops the exchange cycle and closes the link. More...

Public Operators
Gripper &operator= (const Gripper &)=delete
Public Member Functions
voidsetCommand (const GripperCommand &command)

Send a new command block on the next exchange cycle. More...

GripperCommandgetCommand () const
GripperStatusgetStatus () const
ConnectionStateconnectionState () const
Platform &platform () const noexcept

Return the runtime Platform used by this gripper. More...

Public Constructors

Gripper()

Robotiq::Gripper::Gripper(const ConnectionConfig &config,
std::shared_ptr< Logger >logger = nullptr
)
explicit

The common-case constructor: create a gripper object and start communication over the built-in serial transport and the default platform.

Parameters
config

see ConnectionConfig.

logger

Log sink; pass null to use the default stderr logger.

Exceptions
<a href="/docs/drivers/2F hande/SDK/C++/API/classes/robotiq/serialioexception">SerialIOException</a>

when the port cannot be opened/configured.

<a href="/docs/drivers/2F hande/SDK/C++/API/classes/robotiq/driverexception">DriverException</a>

when no gripper answers the initial read, or when config.connectionFrequency is invalid.

Gripper()

Robotiq::Gripper::Gripper(std::unique_ptr< Serial >serial,
uint8_tslaveAddress,
std::chrono::microsecondsexchangePeriod,
std::shared_ptr< Platform >platform,
std::shared_ptr< Logger >logger = nullptr
)

A general-purpose constructor for cases where the common-case constructor does not apply. Start communication over a caller-supplied transport and platform.

Parameters
serial

The transport to exchange over; must not be null.

slaveAddress

The gripper's Modbus slave address.

exchangePeriod

Period of the background exchange cycle.

platform

Runtime services (thread, lock, sleep) for the exchange to run on; must not be null.

logger

Log sink; pass null to use the build's default logger.

Exceptions
<a href="/docs/drivers/2F hande/SDK/C++/API/classes/robotiq/serialioexception">SerialIOException</a>

when the port cannot be opened/configured.

<a href="/docs/drivers/2F hande/SDK/C++/API/classes/robotiq/driverexception">DriverException</a>

when no gripper answers the initial read, when exchangePeriod is invalid, or when platform is null.

Gripper()

Robotiq::Gripper::Gripper(const Gripper &
)
delete

Public Destructor

~Gripper()

Robotiq::Gripper::~Gripper ()

Stops the exchange cycle and closes the link.

Public Operators

operator=()

Gripper & Robotiq::Gripper::operator=(const Gripper &
)
delete

Public Member Functions

connectionState()

ConnectionState Robotiq::Gripper::connectionState ()
Returns

The current state of the background exchange; see ConnectionState.

getCommand()

GripperCommand Robotiq::Gripper::getCommand ()
Returns

The last command block passed to setCommand() — or the gripper's own echoed state, before the first call.

getStatus()

GripperStatus Robotiq::Gripper::getStatus ()
Returns

A snapshot of the gripper's last received status block.

platform()

Platform & Robotiq::Gripper::platform ()
noexcept

Return the runtime Platform used by this gripper.

For most applications the function below should never be used. In some cases, such as embedded applications, it is needed for platform-specific versions of free functions such as waitFor and waitUntil.

setCommand()

void Robotiq::Gripper::setCommand(const GripperCommand &command
)

Send a new command block on the next exchange cycle.

Parameters
command

The whole command block to transmit; see GripperCommand.


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

  • gripper.hpp

Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.