1#include "state_representation/space/cartesian/CartesianPose.hpp"
2#include "state_representation/exceptions/EmptyStateException.hpp"
3#include "state_representation/exceptions/IncompatibleSizeException.hpp"
5using namespace state_representation::exceptions;
10 this->
set_type(StateType::CARTESIAN_POSE);
14 this->
set_type(StateType::CARTESIAN_POSE);
19 this->
set_type(StateType::CARTESIAN_POSE);
24 const std::string& name,
double x,
double y,
double z,
const std::string& reference
26 this->
set_type(StateType::CARTESIAN_POSE);
31 const std::string& name,
const Eigen::Quaterniond& orientation,
const std::string& reference
33 this->
set_type(StateType::CARTESIAN_POSE);
38 const std::string& name,
const Eigen::Vector3d& position,
const Eigen::Quaterniond& orientation,
39 const std::string& reference
41 this->
set_type(StateType::CARTESIAN_POSE);
47 this->
set_type(StateType::CARTESIAN_POSE);
63 return CartesianPose(name, Eigen::Vector3d::Random(), Eigen::Quaterniond::UnitRandom(), reference);
71 if (
data.size() != 7) {
73 "Input is of incorrect size: expected 7, given " + std::to_string(
data.size()));
139 return pose * lambda;
155 double period = dt.count();
Class to define acceleration in Cartesian space as 3D linear and angular acceleration vectors.
Class to define Cartesian pose in Cartesian space as 3D position and quaternion based orientation.
void set_data(const Eigen::VectorXd &data) override
Set the pose data from an Eigen vector.
CartesianPose operator-() const
Negate a Cartesian pose.
std::vector< double > norms(const CartesianStateVariable &state_variable_type=CartesianStateVariable::POSE) const override
Compute the norms of the state variable specified by the input type (default is full pose)
CartesianPose()
Empty constructor.
CartesianPose & operator/=(double lambda)
Scale inplace by a scalar.
static CartesianPose Identity(const std::string &name, const std::string &reference="world")
Constructor for the identity pose.
Eigen::VectorXd data() const override
Returns the pose data as an Eigen vector.
CartesianPose normalized(const CartesianStateVariable &state_variable_type=CartesianStateVariable::POSE) const
Compute the normalized pose at the state variable given in argument (default is full pose)
CartesianPose operator/(double lambda) const
Scale a Cartesian pose by a scalar.
CartesianPose copy() const
Return a copy of the Cartesian pose.
friend CartesianPose operator*(double lambda, const CartesianPose &pose)
Scale a Cartesian pose by a scalar.
CartesianPose inverse() const
Compute the inverse of the current Cartesian pose.
static CartesianPose Random(const std::string &name, const std::string &reference="world")
Constructor for a random pose.
Class to represent a state in Cartesian space.
void set_zero()
Set the State to a zero value.
CartesianState inverse() const
Compute the inverse of the current Cartesian state.
void set_orientation(const Eigen::Quaterniond &orientation)
Setter of the orientation.
const Eigen::Vector3d & get_position() const
Getter of the position attribute.
virtual std::vector< double > norms(const CartesianStateVariable &state_variable_type=CartesianStateVariable::ALL) const
Compute the norms of the state variable specified by the input type. Default is full state.
CartesianState normalized(const CartesianStateVariable &state_variable_type=CartesianStateVariable::ALL) const
Compute the normalized state at the state variable given in argument. Default is full state.
static CartesianState Identity(const std::string &name, const std::string &reference="world")
Constructor for the identity Cartesian state (identity pose and 0 for the rest)
CartesianState & operator/=(double lambda)
Scale inplace by a scalar.
Eigen::Matrix< double, 7, 1 > get_pose() const
Getter of the pose from position and orientation attributes.
void set_position(const Eigen::Vector3d &position)
Setter of the position.
std::string to_string() const override
Convert the state to its string representation.
const Eigen::Quaterniond & get_orientation() const
Getter of the orientation attribute.
CartesianState & operator+=(const CartesianState &state)
Add inplace another Cartesian state.
CartesianState operator-() const
Negate a Cartesian state.
void set_pose(const Eigen::Vector3d &position, const Eigen::Quaterniond &orientation)
Setter of the pose from both position and orientation.
CartesianState & operator-=(const CartesianState &state)
Compute inplace the difference with another Cartesian state.
CartesianState & operator*=(const CartesianState &state)
Transform inplace a Cartesian state into the current reference frame.
CartesianState operator/(double lambda) const
Scale a Cartesian state by 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)
Scale a Cartesian state by a scalar.
CartesianState operator+(const CartesianState &state) const
Add another Cartesian state.
Class to define twist in Cartesian space as 3D linear and angular velocity vectors.
Class to define wrench in Cartesian space as 3D force and torque 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 attribute.
void set_type(const StateType &type)
Setter of the state type attribute.
Core state variables and objects.
std::ostream & operator<<(std::ostream &os, const AnalogIOState &state)
CartesianAcceleration operator*(double lambda, const CartesianAcceleration &acceleration)