libfranka 0.15.0
FCI C++ API
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
franka::VacuumGripper Class Reference

Maintains a network connection to the vacuum gripper, provides the current vacuum gripper state, and allows the execution of commands. More...

#include <vacuum_gripper.h>

Public Types

enum class  ProductionSetupProfile { kP0 , kP1 , kP2 , kP3 }
 Vacuum production setup profile.
 
using ServerVersion = uint16_t
 Version of the vacuum gripper server.
 

Public Member Functions

 VacuumGripper (const std::string &franka_address)
 Establishes a connection with a vacuum gripper connected to a robot.
 
 VacuumGripper (VacuumGripper &&vacuum_gripper) noexcept
 Move-constructs a new VacuumGripper instance.
 
VacuumGripperoperator= (VacuumGripper &&vacuum_gripper) noexcept
 Move-assigns this VacuumGripper from another VacuumGripper instance.
 
 ~VacuumGripper () noexcept
 Closes the connection.
 
bool vacuum (uint8_t vacuum, std::chrono::milliseconds timeout, ProductionSetupProfile profile=ProductionSetupProfile::kP0) const
 Vacuums an object.
 
bool dropOff (std::chrono::milliseconds timeout) const
 Drops the grasped object off.
 
bool stop () const
 Stops a currently running vacuum gripper vacuum or drop off operation.
 
VacuumGripperState readOnce () const
 Waits for a vacuum gripper state update and returns it.
 
ServerVersion serverVersion () const noexcept
 Returns the software version reported by the connected server.
 

Detailed Description

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.
Examples
vacuum_object.cpp.

Constructor & Destructor Documentation

◆ VacuumGripper() [1/2]

franka::VacuumGripper::VacuumGripper ( const std::string &  franka_address)
explicit

Establishes a connection with a vacuum gripper connected to a robot.

Parameters
[in]franka_addressIP/hostname of the robot the vacuum gripper is connected to.
Exceptions
NetworkExceptionif the connection is unsuccessful.
IncompatibleVersionExceptionif this version of libfranka is not supported.

◆ VacuumGripper() [2/2]

franka::VacuumGripper::VacuumGripper ( VacuumGripper &&  vacuum_gripper)
noexcept

Move-constructs a new VacuumGripper instance.

Parameters
[in]vacuum_gripperOther VacuumGripper instance.

Member Function Documentation

◆ dropOff()

bool franka::VacuumGripper::dropOff ( std::chrono::milliseconds  timeout) const

Drops the grasped object off.

Parameters
[in]timeoutDropoff timeout. Unit: \([ms]\).
Returns
True if command was successful, false otherwise.
Exceptions
CommandExceptionif an error occurred.
NetworkExceptionif the connection is lost, e.g. after a timeout.
Examples
vacuum_object.cpp.

◆ operator=()

VacuumGripper & franka::VacuumGripper::operator= ( VacuumGripper &&  vacuum_gripper)
noexcept

Move-assigns this VacuumGripper from another VacuumGripper instance.

Parameters
[in]vacuum_gripperOther VacuumGripper instance.
Returns
Model instance.

◆ readOnce()

VacuumGripperState franka::VacuumGripper::readOnce ( ) const

Waits for a vacuum gripper state update and returns it.

Returns
Current vacuum gripper state.
Exceptions
NetworkExceptionif the connection is lost, e.g. after a timeout.
InvalidOperationExceptionif another readOnce is already running.
Examples
vacuum_object.cpp.

◆ serverVersion()

ServerVersion franka::VacuumGripper::serverVersion ( ) const
noexcept

Returns the software version reported by the connected server.

Returns
Software version of the connected server.

◆ stop()

bool franka::VacuumGripper::stop ( ) const

Stops a currently running vacuum gripper vacuum or drop off operation.

Returns
True if command was successful, false otherwise.
Exceptions
CommandExceptionif an error occurred.
NetworkExceptionif the connection is lost, e.g. after a timeout.
Examples
vacuum_object.cpp.

◆ vacuum()

bool franka::VacuumGripper::vacuum ( uint8_t  vacuum,
std::chrono::milliseconds  timeout,
ProductionSetupProfile  profile = ProductionSetupProfile::kP0 
) const

Vacuums an object.

Parameters
[in]vacuumSetpoint for control mode. Unit: \([10*mbar]\).
[in]timeoutVacuum timeout. Unit: \([ms]\).
[in]profileProduction setup profile P0 to P3. Default: P0.
Returns
True if the vacuum has been established, false otherwise.
Exceptions
CommandExceptionif an error occurred.
NetworkExceptionif the connection is lost, e.g. after a timeout.
Examples
vacuum_object.cpp.

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