franky 1.1.4
A High-Level Motion API for Franka
Loading...
Searching...
No Matches
twist_acceleration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4
5#include "franky/twist.hpp"
6#include "franky/types.hpp"
7#include "franky/util.hpp"
8
9namespace franky {
10
15 public:
21 Eigen::Vector3d linear_acceleration = Eigen::Vector3d::Zero(),
22 Eigen::Vector3d angular_acceleration = Eigen::Vector3d::Zero())
23 : linear_acceleration_(std::move(linear_acceleration)), angular_acceleration_(std::move(angular_acceleration)) {}
24
29 return TwistAcceleration{vector_repr.head<3>(), vector_repr.tail<3>()};
30 }
31
40 result << linear_acceleration_, angular_acceleration_;
41 return result;
42 }
43
54
62 template <typename RotationMatrixType>
64 return TwistAcceleration{rotation * linear_acceleration_, rotation * angular_acceleration_};
65 }
66
81 const Eigen::Vector3d &link_translation, const Eigen::Vector3d &base_angular_velocity) const {
82 Eigen::Vector3d propagated_linear_acceleration =
83 linear_acceleration_ + angular_acceleration_.cross(link_translation) +
85
86 return TwistAcceleration{propagated_linear_acceleration, angular_acceleration_};
87 }
88
94 [[nodiscard]] Eigen::Vector3d linear_acceleration() const { return linear_acceleration_; }
95
101 [[nodiscard]] Eigen::Vector3d angular_acceleration() const { return angular_acceleration_; }
102
103 friend std::ostream &operator<<(std::ostream &os, const TwistAcceleration &twist_acceleration);
104
105 private:
106 Eigen::Vector3d linear_acceleration_;
107 Eigen::Vector3d angular_acceleration_;
108};
109
113
114template <typename RotationMatrixType>
118
119inline std::ostream &operator<<(std::ostream &os, const TwistAcceleration &twist_acceleration) {
120 os << "TwistAcceleration(lin=" << twist_acceleration.linear_acceleration_
121 << ", ang=" << twist_acceleration.angular_acceleration_ << ")";
122 return os;
123}
124
125} // namespace franky
CartesianState transformWith(const Affine &transform) const
Transform the frame of the state by applying the given affine transform.
Definition cartesian_state.hpp:42
TwistAcceleration acceleration of a frame (2nd derivative of a pose).
Definition twist_acceleration.hpp:14
TwistAcceleration transformWith(const Affine &transformation) const
Transform the frame of the twist acceleration by applying the given affine transform.
Definition twist_acceleration.hpp:51
TwistAcceleration propagateThroughLink(const Eigen::Vector3d &link_translation, const Eigen::Vector3d &base_angular_velocity) const
Propagate the twist acceleration through a link with the given translation. Hence,...
Definition twist_acceleration.hpp:80
TwistAcceleration(Eigen::Vector3d linear_acceleration=Eigen::Vector3d::Zero(), Eigen::Vector3d angular_acceleration=Eigen::Vector3d::Zero())
Definition twist_acceleration.hpp:20
static TwistAcceleration fromVectorRepr(const Vector6d &vector_repr)
Definition twist_acceleration.hpp:28
Eigen::Vector3d angular_acceleration() const
Get the angular acceleration.
Definition twist_acceleration.hpp:101
friend std::ostream & operator<<(std::ostream &os, const TwistAcceleration &twist_acceleration)
Definition twist_acceleration.hpp:119
Eigen::Vector3d linear_acceleration() const
Get the linear acceleration.
Definition twist_acceleration.hpp:94
Vector6d vector_repr() const
Get the vector representation of the twist acceleration. It consists of the linear and angular veloci...
Definition twist_acceleration.hpp:38
TwistAcceleration transformWith(const RotationMatrixType &rotation) const
Transform the frame of the twist acceleration by applying the given rotation.
Definition twist_acceleration.hpp:63
Definition dynamics_limit.cpp:8
std::ostream & operator<<(std::ostream &os, const DynamicsLimit< Vector7d > &limit)
Definition dynamics_limit.cpp:47
std::array< double, dims > toStdD(const Eigen::Matrix< double, dims, 1 > &vector)
Definition util.hpp:18
CartesianState operator*(const Affine &transform, const CartesianState &cartesian_state)
Definition cartesian_state.hpp:76
Eigen::Vector< double, 6 > Vector6d
Definition types.hpp:10
Eigen::Affine3d Affine
Definition types.hpp:16