Franky 0.12.0
A High-Level Motion API for Franka
Loading...
Searching...
No Matches
condition.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
5
6namespace franky {
7
15class Condition {
16 public:
17 using CheckFunc = std::function<bool(
18 const RobotState &, franka::Duration, franka::Duration)>;
19
24 explicit Condition(CheckFunc check_func, std::string repr = "NULL");
25
30 Condition(bool constant_value);
31
41 inline bool operator()(
42 const RobotState &robot_state,
43 franka::Duration rel_time,
44 franka::Duration abs_time) const {
45 return check_func_(robot_state, rel_time, abs_time);
46 }
47
51 [[nodiscard]] inline std::string repr() const {
52 return repr_;
53 }
54
55 private:
56 CheckFunc check_func_;
57 std::string repr_;
58};
59
60Condition operator&&(const Condition &c1, const Condition &c2);
61
62Condition operator||(const Condition &c1, const Condition &c2);
63
64Condition operator==(const Condition &c1, const Condition &c2);
65
66Condition operator!=(const Condition &c1, const Condition &c2);
67
68Condition operator!(const Condition &c);
69
70} // namespace franky
A condition on the robot state.
Definition condition.hpp:15
std::function< bool(const RobotState &, franka::Duration, franka::Duration)> CheckFunc
Definition condition.hpp:18
bool operator()(const RobotState &robot_state, franka::Duration rel_time, franka::Duration abs_time) const
Check if the condition is met.
Definition condition.hpp:41
std::string repr() const
The string representation of the condition.
Definition condition.hpp:51
Definition dynamics_limit.cpp:8
Condition operator==(const Condition &c1, const Condition &c2)
Definition condition.cpp:34
Condition operator!=(const Condition &c1, const Condition &c2)
Definition condition.cpp:42
Condition operator&&(const Condition &c1, const Condition &c2)
Definition condition.cpp:18
Condition operator||(const Condition &c1, const Condition &c2)
Definition condition.cpp:26
Condition operator!(const Condition &c)
Definition condition.cpp:50
Full state of the robot.
Definition robot_state.hpp:20