Flexiv RDK APIs  1.5
Public Member Functions | List of all members
flexiv::rdk::Tool Class Reference

Interface to online update and interact with the robot tools. All updates will take effect immediately without a power cycle. However, the robot must be in IDLE mode when applying changes. More...

#include <tool.hpp>

Public Member Functions

 Tool (const Robot &robot)
 [Non-blocking] Create an instance and initialize the interface. More...
 
const std::vector< std::string > list () const
 [Blocking] Get a name list of all configured tools. More...
 
const std::string name () const
 [Blocking] Get name of the tool that the robot is currently using. More...
 
bool exist (const std::string &name) const
 [Blocking] Whether the specified tool already exists. More...
 
const ToolParams params () const
 [Blocking] Get parameters of the tool that the robot is currently using. More...
 
const ToolParams params (const std::string &name) const
 [Blocking] Get parameters of an existing tool. More...
 
void Add (const std::string &name, const ToolParams &params)
 [Blocking] Add a new tool with user-specified parameters. More...
 
void Switch (const std::string &name)
 [Blocking] Switch to an existing tool. All following robot operations will default to use this tool. More...
 
void Update (const std::string &name, const ToolParams &params)
 [Blocking] Update the parameters of an existing tool. More...
 
void Remove (const std::string &name)
 [Blocking] Remove an existing tool. More...
 

Detailed Description

Interface to online update and interact with the robot tools. All updates will take effect immediately without a power cycle. However, the robot must be in IDLE mode when applying changes.

Definition at line 19 of file tool.hpp.

Constructor & Destructor Documentation

◆ Tool()

flexiv::rdk::Tool::Tool ( const Robot robot)

[Non-blocking] Create an instance and initialize the interface.

Parameters
[in]robotReference to the instance of flexiv::rdk::Robot.
Exceptions
std::runtime_errorif the initialization sequence failed.

Member Function Documentation

◆ Add()

void flexiv::rdk::Tool::Add ( const std::string &  name,
const ToolParams params 
)

[Blocking] Add a new tool with user-specified parameters.

Parameters
[in]nameName of the new tool, must be unique.
[in]paramsParameters of the new tool.
Exceptions
std::logic_errorif robot is not in the correct control mode or the specified tool already exists.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: IDLE.
This function blocks until the request is successfully delivered.

◆ exist()

bool flexiv::rdk::Tool::exist ( const std::string &  name) const

[Blocking] Whether the specified tool already exists.

Parameters
[in]nameName of the tool to check.
Returns
True if the specified tool exists.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ list()

const std::vector<std::string> flexiv::rdk::Tool::list ( ) const

[Blocking] Get a name list of all configured tools.

Returns
Tool names as a string list.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ name()

const std::string flexiv::rdk::Tool::name ( ) const

[Blocking] Get name of the tool that the robot is currently using.

Returns
Name of the current tool. Return "Flange" if there's no active tool.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ params() [1/2]

const ToolParams flexiv::rdk::Tool::params ( ) const

[Blocking] Get parameters of the tool that the robot is currently using.

Returns
Parameters result.
Exceptions
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ params() [2/2]

const ToolParams flexiv::rdk::Tool::params ( const std::string &  name) const

[Blocking] Get parameters of an existing tool.

Parameters
[in]nameName of the tool to get parameters for, must be an existing one.
Returns
Parameters result.
Exceptions
std::logic_errorif the specified tool does not exist.
std::runtime_errorif failed to get a reply from the connected robot.
Note
This function blocks until a reply is received.

◆ Remove()

void flexiv::rdk::Tool::Remove ( const std::string &  name)

[Blocking] Remove an existing tool.

Parameters
[in]nameName of the tool to remove, must be an existing one but cannot be "Flange".
Exceptions
std::logic_errorif robot is not in the correct control mode or the specified tool does not exist or trying to remove "Flange".
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: IDLE.
This function blocks until the request is successfully delivered.

◆ Switch()

void flexiv::rdk::Tool::Switch ( const std::string &  name)

[Blocking] Switch to an existing tool. All following robot operations will default to use this tool.

Parameters
[in]nameName of the tool to switch to, must be an existing one.
Exceptions
std::logic_errorif robot is not in the correct control mode or the specified tool does not exist.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: IDLE.
This function blocks until the request is successfully delivered.

◆ Update()

void flexiv::rdk::Tool::Update ( const std::string &  name,
const ToolParams params 
)

[Blocking] Update the parameters of an existing tool.

Parameters
[in]nameName of the tool to update, must be an existing one.
[in]paramsNew parameters for the specified tool.
Exceptions
std::logic_errorif robot is not in the correct control mode or the specified tool does not exist.
std::runtime_errorif failed to deliver the request to the connected robot.
Note
Applicable control modes: IDLE.
This function blocks until the request is successfully delivered.

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