4#include <eigen3/Eigen/Core>
5#include <eigen3/Eigen/Dense>
6#include <eigen3/Eigen/Sparse>
8#include "state_representation/geometry/Shape.hpp"
9#include "state_representation/space/cartesian/CartesianPose.hpp"
17 std::vector<double> axis_lengths_;
18 double rotation_angle_;
30 explicit Ellipsoid(
const std::string& name,
const std::string& reference_frame =
"world");
97 const std::string& name,
const std::vector<double>& coefficients,
const std::string& reference_frame =
"world"
107 const std::string& name,
const std::list<CartesianPose>& points,
const std::string& reference_frame =
"world",
108 double noise_level = 0.01
121 virtual void set_data(
const Eigen::VectorXd& data)
override;
127 virtual void set_data(
const std::vector<double>& data)
override;
146 return this->axis_lengths_;
150 return this->axis_lengths_[index];
154 this->axis_lengths_ = axis_lengths;
159 this->axis_lengths_[index] = axis_length;
164 return this->rotation_angle_;
168 this->rotation_angle_ = rotation_angle;
176 std::vector<double> representation(6);
186 return representation;
193 Eigen::Quaterniond rotation(Eigen::AngleAxisd(this->rotation_angle_, Eigen::Vector3d::UnitZ()));
194 return CartesianPose(
Class to define CartesianPose in cartesian space as 3D position and quaternion based orientation.
virtual void set_data(const Eigen::VectorXd &data) override
Set the ellipsoid data from an Eigen vector.
Ellipsoid & operator=(const Ellipsoid &state)
Copy assignment operator that have to be defined to the custom assignment operator.
void set_rotation_angle(double rotation_angle)
Setter of the rotation angle.
double get_axis_length(unsigned int index) const
Getter of the axis length in one direction.
static const Ellipsoid from_algebraic_equation(const std::string &name, const std::vector< double > &coefficients, const std::string &reference_frame="world")
Compute an ellipsoid from its algebraic equation ax2 + bxy + cy2 + cx + ey + f.
const std::list< CartesianPose > sample_from_parameterization(unsigned int nb_samples) const
Function to sample an obstacle from its parameterization.
void set_axis_lengths(const std::vector< double > &axis_lengths)
Setter of the axis lengths.
double get_rotation_angle() const
Getter of the rotation angle.
const std::vector< double > to_std_vector() const
Convert the ellipse to an std vector representation of its parameter.
Ellipsoid()
Empty constructor.
const std::vector< double > & get_axis_lengths() const
Getter of the axis lengths.
friend std::ostream & operator<<(std::ostream &os, const Ellipsoid &ellipsoid)
Overload the ostream operator for printing.
static const Ellipsoid fit(const std::string &name, const std::list< CartesianPose > &points, const std::string &reference_frame="world", double noise_level=0.01)
Fit an ellipsoid on a set of points This method uses direct least square fitting from Fitzgibbon,...
Shape & operator=(const Shape &state)
Copy assignment operator that have to be defined to the custom assignment operator.
const Eigen::Vector3d get_center_position() const
Getter of the position from the state.
const CartesianState & get_center_state() const
Getter of the state.
const CartesianPose & get_center_pose() const
Getter of the pose from the state.
const std::string & get_name() const
Getter of the name as const reference.
void set_filled()
Setter of the empty attribute to false and also reset the timestamp.
bool is_empty() const
Getter of the empty attribute.
Core state variables and objects.