Franky
0.9.1
A High-Level Motion API for Franka
|
Helper class for handling motions and reactions. More...
#include <motion_generator.hpp>
Public Member Functions | |
MotionGenerator (Robot *robot, std::shared_ptr< Motion< ControlSignalType >> initial_motion) | |
ControlSignalType | operator() (const franka::RobotState &robot_state, franka::Duration period) |
Update the motion generator and get the next control signal. More... | |
void | registerUpdateCallback (const std::function< void(const franka::RobotState &, franka::Duration, double)> &callback) |
Register a callback that is called in every step of the motion. More... | |
void | updateMotion (std::shared_ptr< Motion< ControlSignalType >> new_motion) |
Update the current motion. More... | |
bool | has_new_motion () |
Whether a new motion is available. More... | |
void | resetTimeUnsafe () |
Reset the time of the motion generator without locking the mutex. More... | |
Static Public Attributes | |
static constexpr size_t | REACTION_RECURSION_LIMIT = 8 |
Maximum recursion limit for reactions. After more than this number of reactions are fired in a single step, the motion generator will throw a ReactionRecursionException. More... | |
Helper class for handling motions and reactions.
|
explicit |
robot | The robot instance. |
initial_motion | The initial motion. |
bool franky::MotionGenerator< ControlSignalType >::has_new_motion |
Whether a new motion is available.
ControlSignalType franky::MotionGenerator< ControlSignalType >::operator() | ( | const franka::RobotState & | robot_state, |
franka::Duration | period | ||
) |
Update the motion generator and get the next control signal.
robot_state | The current robot state. |
period | The time step. |
|
inline |
Register a callback that is called in every step of the motion.
callback | The callback to register. Callbacks are called with the robot state, the time step [s], the relative time [s] and the control signal computed in this step. |
void franky::MotionGenerator< ControlSignalType >::resetTimeUnsafe |
Reset the time of the motion generator without locking the mutex.
void franky::MotionGenerator< ControlSignalType >::updateMotion | ( | std::shared_ptr< Motion< ControlSignalType >> | new_motion | ) |
Update the current motion.
new_motion | The new motion. |
|
staticconstexpr |
Maximum recursion limit for reactions. After more than this number of reactions are fired in a single step, the motion generator will throw a ReactionRecursionException.