Control Libraries 7.4.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
state_representation::Shape Class Reference
Inheritance diagram for state_representation::Shape:
state_representation::State state_representation::Ellipsoid

Public Member Functions

 Shape ()
 Empty constructor.
 
 Shape (const std::string &name, const std::string &reference_frame="world")
 Constructor with name and reference frame.
 
 Shape (const Shape &shape)
 Copy constructor from another Shape.
 
Shapeoperator= (const Shape &state)
 Copy assignment operator that has to be defined to the custom assignment operator.
 
const CartesianStateget_center_state () const
 Getter of the state.
 
const CartesianPoseget_center_pose () const
 Getter of the pose from the state.
 
const Eigen::Vector3d get_center_position () const
 Getter of the position from the state.
 
const Eigen::Quaterniond get_center_orientation () const
 Getter of the orientation from the state.
 
const CartesianTwistget_center_twist () const
 Getter of the twist from the state.
 
void set_center_state (const CartesianState &state)
 Setter of the state.
 
void set_center_pose (const CartesianPose &pose)
 Setter of the pose.
 
void set_center_position (const Eigen::Vector3d &position)
 Setter of the position.
 
void set_center_orientation (const Eigen::Quaterniond &orientation)
 Setter of the pose.
 
- Public Member Functions inherited from state_representation::State
 State ()
 Empty constructor.
 
 State (const std::string &name)
 Constructor with name specification.
 
 State (const State &state)
 Copy constructor from another state.
 
virtual ~State ()=default
 Virtual destructor.
 
Stateoperator= (const State &state)
 Copy assignment operator that has to be defined to the custom assignment operator.
 
const StateTypeget_type () const
 Getter of the type attribute.
 
const std::string & get_name () const
 Getter of the name attribute.
 
bool is_empty () const
 Getter of the empty attribute.
 
const std::chrono::time_point< std::chrono::steady_clock > & get_timestamp () const
 Getter of the timestamp attribute.
 
virtual void set_name (const std::string &name)
 Setter of the name attribute.
 
void reset_timestamp ()
 Reset the timestamp attribute to now.
 
virtual void set_data (const Eigen::VectorXd &data)
 Set the data of the state from an Eigen vector.
 
virtual void set_data (const std::vector< double > &data)
 Set the data of the state from a std vector.
 
virtual void set_data (const Eigen::MatrixXd &data)
 Set the data of the state from an Eigen matrix.
 
double get_age () const
 Get the age of the state, i.e. the time since the last modification.
 
virtual bool is_incompatible (const State &state) const
 Check if the state is incompatible for operations with the state given as argument.
 
bool is_deprecated (double time_delay) const
 Check if the state is deprecated given a certain time delay.
 
template<typename DurationT >
bool is_deprecated (const std::chrono::duration< int64_t, DurationT > &time_delay) const
 Check if the state is deprecated given a certain time delay.
 
virtual void reset ()
 Reset the object to a post-construction state.
 
 operator bool () const noexcept
 Boolean operator for the truthiness of a state.
 

Static Public Member Functions

static Shape Unit (const std::string &name, const std::string &reference_frame="world")
 Constructor for a Shape with identity state.
 

Protected Member Functions

std::string to_string () const override
 Convert the state to its string representation.
 
- Protected Member Functions inherited from state_representation::State
void set_type (const StateType &type)
 Setter of the state type attribute.
 
void set_empty (bool empty=true)
 Setter of the empty attribute.
 
void assert_not_empty () const
 Throw an exception if the state is empty.
 

Friends

void swap (Shape &state1, Shape &state2)
 Swap the values of the two Shapes.
 
std::ostream & operator<< (std::ostream &os, const Shape &shape)
 Overload the ostream operator for printing.
 

Detailed Description

Definition at line 12 of file Shape.hpp.

Constructor & Destructor Documentation

◆ Shape() [1/3]

state_representation::Shape::Shape ( )

Empty constructor.

Definition at line 8 of file Shape.cpp.

◆ Shape() [2/3]

state_representation::Shape::Shape ( const std::string &  name,
const std::string &  reference_frame = "world" 
)
explicit

Constructor with name and reference frame.

Parameters
nameName of the Shape and its state
reference_frameThe reference frame in which the state is expressed (default is "world")

Definition at line 12 of file Shape.cpp.

◆ Shape() [3/3]

state_representation::Shape::Shape ( const Shape shape)

Copy constructor from another Shape.

Parameters
shapeThe Shape to copy from

Definition at line 17 of file Shape.cpp.

Member Function Documentation

◆ get_center_orientation()

const Eigen::Quaterniond state_representation::Shape::get_center_orientation ( ) const

Getter of the orientation from the state.

Returns
The orientation of the Shape

Definition at line 50 of file Shape.cpp.

◆ get_center_pose()

const CartesianPose & state_representation::Shape::get_center_pose ( ) const

Getter of the pose from the state.

Returns
The pose of the Shape

Definition at line 40 of file Shape.cpp.

◆ get_center_position()

const Eigen::Vector3d state_representation::Shape::get_center_position ( ) const

Getter of the position from the state.

Returns
The position of the Shape

Definition at line 45 of file Shape.cpp.

◆ get_center_state()

const CartesianState & state_representation::Shape::get_center_state ( ) const

Getter of the state.

Returns
The state of the Shape

Definition at line 35 of file Shape.cpp.

◆ get_center_twist()

const CartesianTwist & state_representation::Shape::get_center_twist ( ) const

Getter of the twist from the state.

Returns
The twist of the Shape

Definition at line 55 of file Shape.cpp.

◆ operator=()

Shape & state_representation::Shape::operator= ( const Shape state)

Copy assignment operator that has to be defined to the custom assignment operator.

Parameters
stateThe Shape with value to assign
Returns
Reference to the current Shape with new values

Definition at line 29 of file Shape.cpp.

◆ set_center_orientation()

void state_representation::Shape::set_center_orientation ( const Eigen::Quaterniond &  orientation)

Setter of the pose.

Parameters
poseThe new pose

Definition at line 82 of file Shape.cpp.

◆ set_center_pose()

void state_representation::Shape::set_center_pose ( const CartesianPose pose)

Setter of the pose.

Parameters
poseThe new pose

Definition at line 68 of file Shape.cpp.

◆ set_center_position()

void state_representation::Shape::set_center_position ( const Eigen::Vector3d &  position)

Setter of the position.

Parameters
positionThe new position

Definition at line 77 of file Shape.cpp.

◆ set_center_state()

void state_representation::Shape::set_center_state ( const CartesianState state)

Setter of the state.

Parameters
stateThe new state

Definition at line 60 of file Shape.cpp.

◆ to_string()

std::string state_representation::Shape::to_string ( ) const
overrideprotectedvirtual

Convert the state to its string representation.

Reimplemented from state_representation::State.

Definition at line 87 of file Shape.cpp.

◆ Unit()

Shape state_representation::Shape::Unit ( const std::string &  name,
const std::string &  reference_frame = "world" 
)
static

Constructor for a Shape with identity state.

Parameters
nameName of the Shape and its state
reference_frameThe reference frame in which the state is expressed (default is "world")

Definition at line 23 of file Shape.cpp.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Shape shape 
)
friend

Overload the ostream operator for printing.

Parameters
osThe ostream to append the string representing the state
stateThe state to print
Returns
The appended ostream

Definition at line 98 of file Shape.cpp.

◆ swap

void swap ( Shape state1,
Shape state2 
)
friend

Swap the values of the two Shapes.

Parameters
state1Shape to be swapped with 2
state2Shape to be swapped with 1

Definition at line 125 of file Shape.hpp.


The documentation for this class was generated from the following files: