Franky  0.9.1
A High-Level Motion API for Franka
Public Types | Public Member Functions | List of all members
franky::Condition Class Reference

A condition on the robot state. More...

#include <condition.hpp>

Public Types

using CheckFunc = std::function< bool(const franka::RobotState &, double, double)>
 

Public Member Functions

 Condition (CheckFunc check_func, std::string repr="NULL")
 
 Condition (bool constant_value)
 Implicit constructor for constant conditions. More...
 
bool operator() (const franka::RobotState &robot_state, double rel_time, double abs_time) const
 Check if the condition is met. More...
 
std::string repr () const
 The string representation of the condition. More...
 

Detailed Description

A condition on the robot state.

This class defines a condition on the robot state, which can be used to define a condition for a reaction in a motion. Conditions support logical operations (&&, ||, ==, !=, !) and can be combined to form more complex conditions.

Member Typedef Documentation

◆ CheckFunc

using franky::Condition::CheckFunc = std::function<bool(const franka::RobotState &, double, double)>

Constructor & Destructor Documentation

◆ Condition() [1/2]

franky::Condition::Condition ( Condition::CheckFunc  check_func,
std::string  repr = "NULL" 
)
explicit
Parameters
check_funcA function that returns true if the condition is met.
reprA string representation of the condition.

◆ Condition() [2/2]

franky::Condition::Condition ( bool  constant_value)

Implicit constructor for constant conditions.

Parameters
constant_valueThe constant value of the condition.

Member Function Documentation

◆ operator()()

bool franky::Condition::operator() ( const franka::RobotState &  robot_state,
double  rel_time,
double  abs_time 
) const
inline

Check if the condition is met.

Parameters
robot_stateThe current robot state.
rel_timeThe time since the start of the current motion.
abs_timeThe time since the start of the current chain of motions. This value measures the time since the robot started moving, and is only reset if a motion expires without being replaced by a new motion.
Returns
True if the condition is met.

◆ repr()

std::string franky::Condition::repr ( ) const
inline

The string representation of the condition.


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