Franky 0.12.0
A High-Level Motion API for Franka
Loading...
Searching...
No Matches
cartesian_waypoint_motion.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <atomic>
4#include <optional>
5#include <ruckig/ruckig.hpp>
6
7#include <franka/robot_state.h>
8
10#include "franky/robot.hpp"
12#include "franky/util.hpp"
15
16namespace franky {
17
23class CartesianWaypointMotion : public PositionWaypointMotion<franka::CartesianPose, CartesianState> {
24 public:
37 const std::vector<PositionWaypoint<CartesianState>> &waypoints,
38 const RelativeDynamicsFactor &relative_dynamics_factor = 1.0,
39 bool return_when_finished = true,
40 Affine ee_frame = Affine::Identity());
41
42 protected:
44 const RobotState &robot_state,
45 const std::optional<franka::CartesianPose> &previous_command,
46 ruckig::InputParameter<7> &input_parameter) override;
47
48 void setNewWaypoint(
49 const RobotState &robot_state,
50 const std::optional<franka::CartesianPose> &previous_command,
51 const PositionWaypoint<CartesianState> &new_waypoint,
52 ruckig::InputParameter<7> &input_parameter) override;
53
54 [[nodiscard]] std::tuple<Vector7d, Vector7d, Vector7d> getAbsoluteInputLimits() const override;
55
56 [[nodiscard]] franka::CartesianPose getControlSignal(
57 const RobotState &robot_state,
58 const franka::Duration &time_step,
59 const std::optional<franka::CartesianPose> &previous_command,
60 const ruckig::InputParameter<7> &input_parameter) override;
61
62 [[nodiscard]] virtual std::tuple<Vector7d, Vector7d, Vector7d> getStateEstimate(
63 const RobotState &robot_state) const override;
64
65 private:
66 CartesianState target_state_;
67 Affine ref_frame_;
68 Affine ee_frame_;
69
70 static inline Vector7d vec_cart_rot_elbow(double cart, double rot, double elbow) {
71 return {cart, cart, cart, rot, rot, rot, elbow};
72 }
73};
74
75} // namespace franky
Definition cartesian_state.hpp:17
Cartesian waypoint motion.
Definition cartesian_waypoint_motion.hpp:23
virtual std::tuple< Vector7d, Vector7d, Vector7d > getStateEstimate(const RobotState &robot_state) const override
Definition cartesian_waypoint_motion.cpp:136
std::tuple< Vector7d, Vector7d, Vector7d > getAbsoluteInputLimits() const override
Definition cartesian_waypoint_motion.cpp:124
franka::CartesianPose getControlSignal(const RobotState &robot_state, const franka::Duration &time_step, const std::optional< franka::CartesianPose > &previous_command, const ruckig::InputParameter< 7 > &input_parameter) override
Definition cartesian_waypoint_motion.cpp:41
void initWaypointMotion(const RobotState &robot_state, const std::optional< franka::CartesianPose > &previous_command, ruckig::InputParameter< 7 > &input_parameter) override
Definition cartesian_waypoint_motion.cpp:18
void setNewWaypoint(const RobotState &robot_state, const std::optional< franka::CartesianPose > &previous_command, const PositionWaypoint< CartesianState > &new_waypoint, ruckig::InputParameter< 7 > &input_parameter) override
Definition cartesian_waypoint_motion.cpp:53
A motion following multiple positional waypoints in a time-optimal way. Works with arbitrary initial ...
Definition position_waypoint_motion.hpp:32
Relative dynamics factors.
Definition relative_dynamics_factor.hpp:13
Definition dynamics_limit.cpp:8
Eigen::Vector< double, 7 > Vector7d
Definition types.hpp:12
Eigen::Affine3d Affine
Definition types.hpp:16
A position waypoint with a target and optional parameters.
Definition position_waypoint_motion.hpp:20
Full state of the robot.
Definition robot_state.hpp:20