Frankx  0.2.0
A High-Level Motion API for Franka
reaction.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cmath>
4 #include <iostream>
5 #include <functional>
6 #include <memory>
7 #include <optional>
8 
10 
11 
12 namespace movex {
13 
14 class WaypointMotion;
15 
16 struct Reaction {
17  using WaypointAction = std::function<WaypointMotion(const RobotState<7>&, double)>;
18  std::optional<WaypointAction> waypoint_action;
19  std::optional<std::shared_ptr<WaypointMotion>> waypoint_motion;
20 
22  bool has_fired {false};
23 
24  explicit Reaction(Condition::CallbackType callback): condition(callback) { }
25  explicit Reaction(Condition::CallbackType callback, std::optional<std::shared_ptr<WaypointMotion>> waypoint_motion): condition(callback), waypoint_motion(waypoint_motion) { }
26  explicit Reaction(Condition::CallbackType callback, std::optional<WaypointAction> waypoint_action): condition(callback), waypoint_action(waypoint_action) { }
27 
29  explicit Reaction(Condition condition, std::optional<std::shared_ptr<WaypointMotion>> waypoint_motion): condition(condition), waypoint_motion(waypoint_motion) { }
31 };
32 
33 } // namespace movex
movex::Reaction::Reaction
Reaction(Condition::CallbackType callback, std::optional< std::shared_ptr< WaypointMotion >> waypoint_motion)
Definition: reaction.hpp:25
movex::Condition::CallbackType
std::function< bool(const RobotState_ &, double)> CallbackType
Definition: measure.hpp:13
movex::Condition
Definition: measure.hpp:10
movex::Reaction
Definition: reaction.hpp:16
movex::Reaction::Reaction
Reaction(Condition::CallbackType callback, std::optional< WaypointAction > waypoint_action)
Definition: reaction.hpp:26
movex::Reaction::Reaction
Reaction(Condition::CallbackType callback)
Definition: reaction.hpp:24
movex::Reaction::WaypointAction
std::function< WaypointMotion(const RobotState< 7 > &, double)> WaypointAction
Definition: reaction.hpp:17
movex::Reaction::waypoint_action
std::optional< WaypointAction > waypoint_action
Definition: reaction.hpp:18
movex::RobotState
The overall state of the robot.
Definition: robot_state.hpp:8
movex::WaypointMotion
Definition: motion_waypoint.hpp:16
movex::Reaction::Reaction
Reaction(Condition condition, std::optional< WaypointAction > waypoint_action)
Definition: reaction.hpp:30
movex::Reaction::waypoint_motion
std::optional< std::shared_ptr< WaypointMotion > > waypoint_motion
Definition: reaction.hpp:19
movex::Reaction::has_fired
bool has_fired
Definition: reaction.hpp:22
movex::Reaction::Reaction
Reaction(Condition condition, std::optional< std::shared_ptr< WaypointMotion >> waypoint_motion)
Definition: reaction.hpp:29
movex::Reaction::Reaction
Reaction(Condition condition)
Definition: reaction.hpp:28
movex
Definition: motion_impedance.hpp:13
measure.hpp
movex::Reaction::condition
Condition condition
Definition: reaction.hpp:21