Class VacuumGripper
Defined in File vacuum_gripper.h
Class Documentation
-
class VacuumGripper
Maintains a network connection to the vacuum gripper, provides the current vacuum gripper state, and allows the execution of commands.
Note
The members of this class are threadsafe.
Public Types
-
enum class ProductionSetupProfile
Vacuum production setup profile.
Values:
-
enumerator kP0
-
enumerator kP1
-
enumerator kP2
-
enumerator kP3
-
enumerator kP0
-
using ServerVersion = uint16_t
Version of the vacuum gripper server.
Public Functions
-
explicit VacuumGripper(const std::string &franka_address)
Establishes a connection with a vacuum gripper connected to a robot.
- Parameters:
franka_address – [in] IP/hostname of the robot the vacuum gripper is connected to.
- Throws:
NetworkException – if the connection is unsuccessful.
IncompatibleVersionException – if this version of
libfranka
is not supported.
-
VacuumGripper(VacuumGripper &&vacuum_gripper) noexcept
Move-constructs a new VacuumGripper instance.
- Parameters:
vacuum_gripper – [in] Other VacuumGripper instance.
-
VacuumGripper &operator=(VacuumGripper &&vacuum_gripper) noexcept
Move-assigns this VacuumGripper from another VacuumGripper instance.
- Parameters:
vacuum_gripper – [in] Other VacuumGripper instance.
- Returns:
Model instance.
-
~VacuumGripper() noexcept
Closes the connection.
-
bool vacuum(uint8_t vacuum, std::chrono::milliseconds timeout, ProductionSetupProfile profile = ProductionSetupProfile::kP0) const
Vacuums an object.
- Parameters:
vacuum – [in] Setpoint for control mode. Unit:
.timeout – [in] Vacuum timeout. Unit:
.profile – [in] Production setup profile P0 to P3. Default: P0.
- Throws:
CommandException – if an error occurred.
NetworkException – if the connection is lost, e.g. after a timeout.
- Returns:
True if the vacuum has been established, false otherwise.
-
bool dropOff(std::chrono::milliseconds timeout) const
Drops the grasped object off.
- Parameters:
timeout – [in] Dropoff timeout. Unit:
.- Throws:
CommandException – if an error occurred.
NetworkException – if the connection is lost, e.g. after a timeout.
- Returns:
True if command was successful, false otherwise.
-
bool stop() const
Stops a currently running vacuum gripper vacuum or drop off operation.
- Throws:
CommandException – if an error occurred.
NetworkException – if the connection is lost, e.g. after a timeout.
- Returns:
True if command was successful, false otherwise.
-
VacuumGripperState readOnce() const
Waits for a vacuum gripper state update and returns it.
- Throws:
NetworkException – if the connection is lost, e.g. after a timeout.
InvalidOperationException – if another readOnce is already running.
- Returns:
Current vacuum gripper state.
-
ServerVersion serverVersion() const noexcept
Returns the software version reported by the connected server.
- Returns:
Software version of the connected server.
-
enum class ProductionSetupProfile