RobWorkProject
24.12.4-
|
The deformable object is an object that contain a deformable mesh. Deformations are part of the state object and they are modeled/controlled through control nodes. each control node correspond to a vertice in the mesh. All vertices are described relative to the base frame of the object. More...
#include <DeformableObject.hpp>
Inherits Object.
Classes | |
class | DeformableObjectCache |
Public Types | |
typedef rw::core::Ptr< DeformableObject > | Ptr |
smart pointer type | |
Public Types inherited from Object | |
typedef rw::core::Ptr< Object > | Ptr |
smart pointer | |
typedef rw::core::Ptr< const Object > | CPtr |
const smart pointer | |
Public Types inherited from Stateless | |
typedef rw::core::Ptr< Stateless > | Ptr |
Smart pointer type for Stateless. | |
Public Member Functions | |
DeformableObject (rw::core::Ptr< rw::kinematics::Frame > baseframe, int nr_of_nodes) | |
constructor - constructs a deformable mesh with a specific number of control nodes and without any faces. Both geometry and model are created based on nodes. More... | |
DeformableObject (rw::core::Ptr< rw::kinematics::Frame > baseframe, rw::core::Ptr< rw::geometry::Model3D > model) | |
constructor - control nodes are taken as vertices in the Model3D. Vertices that are equal are merged into the same control node. All faces of the model are used to define faces of the deformable object. More... | |
DeformableObject (rw::core::Ptr< rw::kinematics::Frame > baseframe, rw::core::Ptr< rw::geometry::Geometry > geom) | |
constructor - control nodes are taken from a triangle mesh generated from triangulating the geometry. Vertices that are equal are merged into the same control node. All faces of the geometry are used to define faces of the deformable object. More... | |
virtual | ~DeformableObject () |
destructor | |
rw::math::Vector3D< float > & | getNode (int id, rw::kinematics::State &state) const |
get a specific node from the state More... | |
const rw::math::Vector3D< float > & | getNode (int id, const rw::kinematics::State &state) const |
get a specific node from the state More... | |
void | setNode (int id, const rw::math::Vector3D< float > &v, rw::kinematics::State &state) |
set the value of a specific node in the state. More... | |
size_t | getNrNodes (const rw::kinematics::State &state) const |
get the number of controlling nodes of this deformable object. More... | |
size_t | getNrNodes () const |
get the number of controlling nodes of this deformable object. More... | |
const std::vector< rw::geometry::IndexedTriangle<> > & | getFaces () const |
get all faces of this soft body More... | |
void | addFace (unsigned int node1, unsigned int node2, unsigned int node3) |
add a face to three existing nodes More... | |
rw::geometry::IndexedTriMesh< float >::Ptr | getMesh (rw::kinematics::State &cstate) |
return a triangle mesh representing the softbody in the current state cstate More... | |
double | getMass (const rw::kinematics::State &state) const |
get mass in Kg of this object More... | |
rw::math::Vector3D< double > | getCOM (const rw::kinematics::State &state) const |
get center of mass of this object More... | |
rw::math::InertiaMatrix | getInertia (const rw::kinematics::State &state) const |
returns the inertia matrix of this body calculated around COM with the orientation of the base frame. More... | |
void | update (rw::core::Ptr< rw::geometry::Model3D > model, const rw::kinematics::State &state) |
updates the model with the current state of the deformable model More... | |
Public Member Functions inherited from Object | |
virtual | ~Object () |
destructor | |
const std::string & | getName () |
get name of this object. Name is always the same as the name of the base frame. More... | |
rw::kinematics::Frame * | getBase () |
get base frame of this object More... | |
const rw::kinematics::Frame * | getBase () const |
get base frame of this object More... | |
const std::vector< rw::kinematics::Frame * > & | getFrames () |
get all associated frames of this object More... | |
void | addFrame (rw::core::Ptr< rw::kinematics::Frame > frame) |
associate a frame to this Object. More... | |
const std::vector< rw::geometry::Geometry::Ptr > & | getGeometry () const |
get default geometries More... | |
const std::vector< rw::geometry::Model3D::Ptr > & | getModels () const |
get the default models More... | |
const std::vector< rw::geometry::Geometry::Ptr > & | getGeometry (const rw::kinematics::State &state) const |
get geometry of this object More... | |
const std::vector< rw::geometry::Model3D::Ptr > & | getModels (const rw::kinematics::State &state) const |
get visualization models of this object More... | |
Public Member Functions inherited from Stateless | |
virtual | ~Stateless () |
destructor | |
virtual void | registerIn (State &state) |
initialize this stateless data to a specific state More... | |
virtual void | registerIn (StateStructure::Ptr state) |
register this stateless object in a statestructure. | |
virtual void | unregister () |
unregisters all state data of this stateless object | |
StateStructure::Ptr | getStateStructure () |
Get the state structure. More... | |
const StateStructure::Ptr | getStateStructure () const |
Get the state structure. More... | |
bool | isRegistered () |
Check if object has registered its state. More... | |
Protected Member Functions | |
const std::vector< rw::core::Ptr< rw::geometry::Geometry > > & | doGetGeometry (const rw::kinematics::State &state) const |
get geometry of this object More... | |
const std::vector< rw::core::Ptr< rw::geometry::Model3D > > & | doGetModels (const rw::kinematics::State &state) const |
get visualization models of this object More... | |
Protected Member Functions inherited from Object | |
Object (rw::core::Ptr< rw::kinematics::Frame > baseframe) | |
constructor | |
Object (std::vector< rw::kinematics::Frame * > frames) | |
constructor - first frame is base | |
Protected Member Functions inherited from Stateless | |
Stateless () | |
constructor | |
template<class T > | |
void | add (StatelessData< T > &data) |
implementations of sensor should add all their stateless data on initialization | |
void | add (StateData *data) |
Add data. More... | |
void | add (rw::core::Ptr< StateData > data) |
implementations of sensor should add all their state data on initialization | |
Friends | |
class | WorkCell |
Additional Inherited Members | |
Protected Attributes inherited from Stateless | |
bool | _registered |
True if object has registered its state. | |
std::vector< rw::core::Ptr< StateData > > | _datas |
Data. | |
StateStructure::Ptr | _stateStruct |
The state structure. | |
The deformable object is an object that contain a deformable mesh. Deformations are part of the state object and they are modeled/controlled through control nodes. each control node correspond to a vertice in the mesh. All vertices are described relative to the base frame of the object.
DeformableObject | ( | rw::core::Ptr< rw::kinematics::Frame > | baseframe, |
int | nr_of_nodes | ||
) |
constructor - constructs a deformable mesh with a specific number of control nodes and without any faces. Both geometry and model are created based on nodes.
baseframe | [in] base frame of object |
nr_of_nodes | [in] the number of controlling nodes in the deformable object |
DeformableObject | ( | rw::core::Ptr< rw::kinematics::Frame > | baseframe, |
rw::core::Ptr< rw::geometry::Model3D > | model | ||
) |
constructor - control nodes are taken as vertices in the Model3D. Vertices that are equal are merged into the same control node. All faces of the model are used to define faces of the deformable object.
geometry will be created based on model information
baseframe | [in] base frame of object |
model | [in] |
DeformableObject | ( | rw::core::Ptr< rw::kinematics::Frame > | baseframe, |
rw::core::Ptr< rw::geometry::Geometry > | geom | ||
) |
constructor - control nodes are taken from a triangle mesh generated from triangulating the geometry. Vertices that are equal are merged into the same control node. All faces of the geometry are used to define faces of the deformable object.
model will be created based on geometry information
baseframe | [in] base frame of object |
geom | [in] geometry to define the faces and nodes |
void addFace | ( | unsigned int | node1, |
unsigned int | node2, | ||
unsigned int | node3 | ||
) |
add a face to three existing nodes
node1 | [in] idx of node 1 |
node2 | [in] idx of node 2 |
node3 | [in] idx of node 3 |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
get center of mass of this object
state | [in] the state in which to get center of mass |
Implements Object.
const std::vector<rw::geometry::IndexedTriangle<> >& getFaces | ( | ) | const |
get all faces of this soft body
|
virtual |
returns the inertia matrix of this body calculated around COM with the orientation of the base frame.
state | [in] the state to get the inertia in |
Implements Object.
|
virtual |
get mass in Kg of this object
state | [in] the state |
Implements Object.
rw::geometry::IndexedTriMesh<float>::Ptr getMesh | ( | rw::kinematics::State & | cstate | ) |
return a triangle mesh representing the softbody in the current state cstate
cstate |
const rw::math::Vector3D<float>& getNode | ( | int | id, |
const rw::kinematics::State & | state | ||
) | const |
get a specific node from the state
id | [in] id of the node to fetch |
state | [in] current state |
rw::math::Vector3D<float>& getNode | ( | int | id, |
rw::kinematics::State & | state | ||
) | const |
get a specific node from the state
id | [in] id of the node to fetch |
state | [in] current state |
size_t getNrNodes | ( | ) | const |
get the number of controlling nodes of this deformable object.
size_t getNrNodes | ( | const rw::kinematics::State & | state | ) | const |
get the number of controlling nodes of this deformable object.
state | [in] |
void setNode | ( | int | id, |
const rw::math::Vector3D< float > & | v, | ||
rw::kinematics::State & | state | ||
) |
set the value of a specific node in the state.
id | [in] id of the node |
v | [in] value to set. |
state | [in] state in which to set the value. |
void update | ( | rw::core::Ptr< rw::geometry::Model3D > | model, |
const rw::kinematics::State & | state | ||
) |
updates the model with the current state of the deformable model
model | [in/out] model to be updated |
state |