1#include "state_representation/space/cartesian/CartesianAcceleration.hpp"
2#include "state_representation/exceptions/EmptyStateException.hpp"
4using namespace state_representation::exceptions;
8 this->
set_type(StateType::CARTESIAN_ACCELERATION);
13 this->
set_type(StateType::CARTESIAN_ACCELERATION);
17 const std::string& name,
const Eigen::Vector3d& linear_acceleration,
const std::string& reference
19 this->
set_type(StateType::CARTESIAN_ACCELERATION);
24 const std::string& name,
const Eigen::Vector3d& linear_acceleration,
const Eigen::Vector3d& angular_acceleration,
25 const std::string& reference
27 this->
set_type(StateType::CARTESIAN_ACCELERATION);
33 const std::string& name,
const Eigen::Matrix<double, 6, 1>& acceleration,
const std::string& reference
35 this->
set_type(StateType::CARTESIAN_ACCELERATION);
41 this->
set_type(StateType::CARTESIAN_ACCELERATION);
58 Eigen::Matrix<double, 6, 1> random = Eigen::Matrix<double, 6, 1>::Random();
117 double period = dt.count();
126 double max_linear,
double max_angular,
double linear_noise_ratio,
double angular_noise_ratio
129 this->clamp_state_variable(max_linear, CartesianStateVariable::LINEAR_ACCELERATION, linear_noise_ratio);
131 this->clamp_state_variable(max_angular, CartesianStateVariable::ANGULAR_ACCELERATION, angular_noise_ratio);
135 double max_linear,
double max_angular,
double linear_noise_ratio,
double angular_noise_ratio
138 result.
clamp(max_linear, max_angular, linear_noise_ratio, angular_noise_ratio);
152 if (
data.size() != 6) {
154 "Input is of incorrect size: expected 6, given " + std::to_string(
data.size()));
169 os <<
"Empty CartesianAcceleration";
184 return state.operator*(acceleration);
188 return acceleration * lambda;
198 return acceleration * dt;
Class to define acceleration in cartesian space as 3D linear and angular acceleration vectors.
void clamp(double max_linear, double max_angular, double linear_noise_ratio=0, double angular_noise_ratio=0)
Clamp inplace the magnitude of the acceleration to the values in argument.
CartesianAcceleration operator-(const CartesianAcceleration &acceleration) const
Overload the - operator with an acceleration.
CartesianAcceleration & operator+=(const CartesianAcceleration &acceleration)
Overload the += operator.
CartesianAcceleration copy() const
Return a copy of the CartesianAcceleration.
CartesianAcceleration & operator/=(double lambda)
Overload the /= operator with a scalar.
friend CartesianAcceleration operator*(const CartesianState &state, const CartesianAcceleration &acceleration)
Overload the * operator with a CartesianState.
CartesianAcceleration clamped(double max_linear, double max_angular, double noise_ratio=0, double angular_noise_ratio=0) const
Return the clamped twist.
Eigen::VectorXd data() const override
Returns the acceleration data as an Eigen vector.
CartesianAcceleration & operator-=(const CartesianAcceleration &acceleration)
Overload the -= operator.
CartesianAcceleration operator+(const CartesianAcceleration &acceleration) const
Overload the + operator with an acceleration.
CartesianAcceleration()
Empty constructor.
static CartesianAcceleration Zero(const std::string &name, const std::string &reference="world")
Constructor for the zero acceleration.
static CartesianAcceleration Random(const std::string &name, const std::string &reference="world")
Constructor for a random acceleration.
CartesianAcceleration operator/(double lambda) const
Overload the / operator with a scalar.
CartesianAcceleration inverse() const
Compute the inverse of the current CartesianAcceleration.
void set_data(const Eigen::VectorXd &data) override
Set the acceleration data from an Eigen vector.
Class to represent a state in Cartesian space.
void set_zero()
Set the State to a zero value.
void set_acceleration(const Eigen::Matrix< double, 6, 1 > &acceleration)
Setter of the linear and angular acceleration from a 6d acceleration vector.
CartesianState inverse() const
Compute the inverse of the current CartesianState.
void set_angular_acceleration(const Eigen::Vector3d &angular_acceleration)
Setter of the angular velocity attribute.
CartesianState operator-(const CartesianState &state) const
Overload the - operator.
static CartesianState Identity(const std::string &name, const std::string &reference="world")
Constructor for the identity CartesianState (identity pose and 0 for the rest)
CartesianState & operator/=(double lambda)
Overload the /= operator with a scalar.
const Eigen::Vector3d & get_linear_acceleration() const
Getter of the linear acceleration attribute.
void set_linear_acceleration(const Eigen::Vector3d &linear_acceleration)
Setter of the linear acceleration attribute.
CartesianState & operator+=(const CartesianState &state)
Overload the += operator.
CartesianState & operator-=(const CartesianState &state)
Overload the -= operator.
CartesianState & operator*=(const CartesianState &state)
Overload the *= operator with another state by deriving the equations of motions.
const Eigen::Vector3d & get_angular_acceleration() const
Getter of the angular acceleration attribute.
CartesianState operator/(double lambda) const
Overload the / operator with a scalar.
void set_linear_velocity(const Eigen::Vector3d &linear_velocity)
Setter of the linear velocity attribute.
void set_angular_velocity(const Eigen::Vector3d &angular_velocity)
Setter of the angular velocity attribute.
friend CartesianState operator*(double lambda, const CartesianState &state)
Overload the * operator with a scalar.
Eigen::Matrix< double, 6, 1 > get_acceleration() const
Getter of the 6d acceleration from linear and angular acceleration attributes.
CartesianState operator+(const CartesianState &state) const
Overload the + operator.
Class to define twist in cartesian space as 3D linear and angular velocity vectors.
const std::string & get_reference_frame() const
Getter of the reference frame as const reference.
const std::string & get_name() const
Getter of the name as const reference.
void set_type(const StateType &type)
Override the state type.
bool is_empty() const
Getter of the empty attribute.
void set_empty(bool empty=true)
Setter of the empty attribute.
Core state variables and objects.
CartesianAcceleration operator*(const CartesianState &state, const CartesianAcceleration &acceleration)
std::ostream & operator<<(std::ostream &os, const Ellipsoid &ellipsoid)