3#include <franka/duration.h> 
    4#include <franka/robot_state.h> 
   11#include "ruckig/ruckig.hpp" 
   19  using std::runtime_error::runtime_error;
 
 
   24template <
typename ControlSignalType>
 
   30template <
typename ControlSignalType>
 
   61      const std::function<
void(
const RobotState &, franka::Duration, franka::Duration)> &callback) {
 
   62    update_callbacks_.push_back(callback);
 
 
   82  std::shared_ptr<Motion<ControlSignalType>> initial_motion_;
 
   83  std::shared_ptr<Motion<ControlSignalType>> current_motion_;
 
   84  std::shared_ptr<Motion<ControlSignalType>> new_motion_;
 
   85  std::vector<std::function<void(
const RobotState &, franka::Duration, franka::Duration)>> update_callbacks_;
 
   86  std::mutex new_motion_mutex_;
 
   87  std::optional<ControlSignalType> previous_command_;
 
   89  franka::Duration abs_time_{0};
 
   90  franka::Duration rel_time_offset_{0};
 
 
Helper class for handling motions and reactions.
Definition motion_generator.hpp:31
 
static constexpr size_t REACTION_RECURSION_LIMIT
Maximum recursion limit for reactions. After more than this number of reactions are fired in a single...
Definition motion_generator.hpp:38
 
ControlSignalType operator()(const RobotState &robot_state, franka::Duration period)
Update the motion generator and get the next control signal.
Definition motion_generator.cpp:27
 
void registerUpdateCallback(const std::function< void(const RobotState &, franka::Duration, franka::Duration)> &callback)
Register a callback that is called in every step of the motion.
Definition motion_generator.hpp:60
 
void resetTimeUnsafe()
Reset the time of the motion generator without locking the mutex.
Definition motion_generator.cpp:90
 
bool has_new_motion()
Whether a new motion is available.
Definition motion_generator.cpp:85
 
void updateMotion(std::shared_ptr< Motion< ControlSignalType > > new_motion)
Update the current motion.
Definition motion_generator.cpp:79
 
Base class for motions.
Definition motion.hpp:24
 
A class representing a Franka robot.
Definition robot.hpp:47
 
Definition dynamics_limit.cpp:8
 
ControlSignalType
Type of control signal.
Definition control_signal_type.hpp:8
 
Exception thrown when the reaction recursion limit (8) is reached.
Definition motion_generator.hpp:18
 
Full state of the robot.
Definition robot_state.hpp:23