RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TactileArraySensor Class Reference

the TactileMatrixSensor class combines a TactileMatrix data type with the actual shape of a tactile sensor. The shape is described with a matrix of 3d vertices. Such that tactil (0,0) maps to the quad defined by the four vertices {(0,0),(0,1),(1,1),(1,0)}. Notice that the normal is defined by sequence of the vertices and that the normal defines the direction of tactile sensing. More...

#include <TactileArraySensor.hpp>

Inherits SimulatedTactileSensor.

Classes

class  ClassState
 class for keeping statefull information More...
 
struct  DistPoint
 

Public Types

typedef rw::core::Ptr< TactileArraySensorPtr
 Smart pointer type for TactileArraySensor.
 
typedef rw::sensor::TactileArrayModel::ValueMatrix ValueMatrix
 
typedef rw::sensor::TactileArrayModel::VertexMatrix VertexMatrix
 
- Public Types inherited from SimulatedSensor
typedef rw::core::Ptr< SimulatedSensorPtr
 smart pointer type of this class
 
- Public Types inherited from Stateless
typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 TactileArraySensor (const std::string &name, rw::core::Ptr< rwsim::dynamics::Body > obj, const rw::math::Transform3D<> &fThmap, const ValueMatrix &heightMap, const rw::math::Vector2D< double > &texelSize)
 Creates a TactileSensor with a geometry specified by a height map and equally sized Texels in an matrix of a given dimension. The transform describe the location of the lower left corner of the texel (0,0). More...
 
virtual ~TactileArraySensor ()
 destructor
 
rw::sensor::TactileArrayModel::ValueMatrixgetTexelData (rw::kinematics::State &state) const
 get last sampled texel pressure values More...
 
const rw::sensor::TactileArrayModel::ValueMatrixgetTexelData (const rw::kinematics::State &state) const
 get last sampled texel pressure values More...
 
void reset (const rw::kinematics::State &state)
 Resets the state of the SimulatedSensor to that of state. More...
 
void addForceW (const rw::math::Vector3D<> &point, const rw::math::Vector3D<> &force, const rw::math::Vector3D<> &snormal, rw::kinematics::State &state, rw::core::Ptr< rwsim::dynamics::Body > body=NULL)
 add a force to a point on the sensor geometry. The force is described relative to the world frame. More...
 
void addForce (const rw::math::Vector3D<> &point, const rw::math::Vector3D<> &force, const rw::math::Vector3D<> &snormal, rw::kinematics::State &state, rw::core::Ptr< rwsim::dynamics::Body > body=NULL)
 add a force to a point on the sensor geometry. The force is described relative to the sensor frame. More...
 
void addWrenchToCOM (const rw::math::Vector3D<> &force, const rw::math::Vector3D<> &torque, rw::kinematics::State &state, rw::core::Ptr< rwsim::dynamics::Body > body=NULL)
 add a wrench to the center of mass of this object More...
 
void addWrenchWToCOM (const rw::math::Vector3D<> &force, const rw::math::Vector3D<> &torque, rw::kinematics::State &state, rw::core::Ptr< rwsim::dynamics::Body > body=NULL)
 add a wrench described in World frame to the center of mass of this object More...
 
void update (const rwlibs::simulation::Simulator::UpdateInfo &info, rw::kinematics::State &state)
 steps the the SimulatedSensor with time dt and saves any state changes in state. More...
 
const std::vector< rw::sensor::Contact3D > & getActualContacts (const rw::kinematics::State &state)
 all contacts that was accumulated into pressure
 
rw::math::Vector2D getTexelSize (int x, int y) const
 gets the size of an individual tactile cell with coordinates (x,y) More...
 
int getWidth () const
 get width of tactile array More...
 
int getHeight () const
 get height of tactile array More...
 
std::pair< double, double > getPressureLimit () const
 get the minimum and maximum pressure capability of any tactile cell in the TactileArray More...
 
const VertexMatrix & getVertexGrid () const
 gets the 3d geometry of this tactilearray. The vertexes are expressed realtive to the transform. More...
 
const VertexMatrix & getCenters () const
 a matrix with position of each tactile cell center. The coordinates are described relative to the TactileArray transform (see getTransform()) More...
 
const VertexMatrix & getNormals () const
 a matrix with position of each tactile cell center. The coordinates are described relative to the TactileArray transform (see getTransform()) More...
 
const rw::math::Transform3DgetTransform () const
 a transformation from the sensor frame to the geometric data of the tactile array. More...
 
rw::kinematics::FramegetSensorFrame ()
 The frame to which the sensor is attached. More...
 
rw::sensor::TactileArrayModel::Ptr getTactileArrayModel ()
 
rw::sensor::Sensor::Ptr getSensor (rwlibs::simulation::Simulator::Ptr sim)
 get sensor with specific name More...
 
rw::sensor::TactileArray::Ptr getTactileArraySensor (rwlibs::simulation::Simulator::Ptr sim)
 get a handle to the statefull instance of the simulated sensor More...
 
void setDeformationMask (const ValueMatrix &dmask, double width, double height)
 sets the deformation mask used for determining the deformation of the sensor surface when a point force is applied to it. More...
 
void setMaxPenetration (double penetration)
 set max penetration in meters. The penetration is really max deformation at any point on the elastic surface of the tactile sensor
 
const rw::geometry::PlainTriMeshDgetMesh ()
 get triangle mesh representing the tactile array More...
 
- Public Member Functions inherited from SimulatedTactileSensor
virtual ~SimulatedTactileSensor ()
 destructor
 
- Public Member Functions inherited from SimulatedSensor
virtual ~SimulatedSensor ()
 destructor
 
const std::string & getName () const
 get name of this simulated sensor
 
rw::kinematics::FramegetFrame () const
 get frame that this sensor is attached to. More...
 
rw::sensor::SensorModel::Ptr getSensorModel ()
 get the sensor model of this simulated sensor.
 
rw::sensor::Sensor::Ptr getSensorHandle (rwlibs::simulation::Simulator::Ptr sim)
 get a handle to controlling an instance of the simulated sensor in a specific simulator 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

ClassState::Ptr getClassState (rw::kinematics::State &state) const
 
ClassState::Ptr getClassState (rw::kinematics::State &state)
 
- Protected Member Functions inherited from SimulatedTactileSensor
 SimulatedTactileSensor (rw::sensor::SensorModel::Ptr model)
 Constructor. More...
 
- Protected Member Functions inherited from SimulatedSensor
 SimulatedSensor (rw::sensor::SensorModel::Ptr model)
 constructor
 
- 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
 

Protected Attributes

rw::kinematics::StatelessData< int > _sdata
 
VertexMatrix _contactMatrix
 
VertexMatrix _distCenterMatrix
 
Eigen::MatrixXf _distDefMatrix
 
const rw::math::Vector2D _texelSize
 
double _texelArea
 
const rw::math::Transform3D _fThmap
 
const rw::math::Transform3D _hmapTf
 
Eigen::MatrixXf _dmask
 
rwlibs::proximitystrategies::ProximityStrategyPQP_narrowStrategy
 
double _maxPenetration
 
double _elasticity
 
double _tau
 
rw::core::Ptr< rwsim::dynamics::Body_body
 
double _maskWidth
 
double _maskHeight
 
rw::core::Ptr< rw::geometry::Geometry_ngeom
 
rw::core::Ptr< rw::geometry::PlainTriMesh< rw::geometry::Triangle<> > > _ntrimesh
 
rw::proximity::ProximityModel::Ptr _nmodel
 
std::map< rw::kinematics::Frame *, std::vector< rw::core::Ptr< rw::geometry::Geometry > > > _frameToGeoms
 
rw::sensor::TactileArrayModel::Ptr _tmodel
 
- 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.
 

Detailed Description

the TactileMatrixSensor class combines a TactileMatrix data type with the actual shape of a tactile sensor. The shape is described with a matrix of 3d vertices. Such that tactil (0,0) maps to the quad defined by the four vertices {(0,0),(0,1),(1,1),(1,0)}. Notice that the normal is defined by sequence of the vertices and that the normal defines the direction of tactile sensing.

Constructor & Destructor Documentation

◆ TactileArraySensor()

TactileArraySensor ( const std::string &  name,
rw::core::Ptr< rwsim::dynamics::Body obj,
const rw::math::Transform3D<> &  fThmap,
const ValueMatrix &  heightMap,
const rw::math::Vector2D< double > &  texelSize 
)

Creates a TactileSensor with a geometry specified by a height map and equally sized Texels in an matrix of a given dimension. The transform describe the location of the lower left corner of the texel (0,0).

Parameters
name[in]
obj[in]
fThmap[in]
heightMap[in]
texelSize[in]

Member Function Documentation

◆ addForce()

void addForce ( const rw::math::Vector3D<> &  point,
const rw::math::Vector3D<> &  force,
const rw::math::Vector3D<> &  snormal,
rw::kinematics::State state,
rw::core::Ptr< rwsim::dynamics::Body body = NULL 
)
virtual

add a force to a point on the sensor geometry. The force is described relative to the sensor frame.

Parameters
point[in] the point where the force is acting.
force[in] the direction in which the force is acting
snormal[in] the contact normal where the origin is on the contacting body and the direction is toward the sensor
state[in/out] the state is updated with new sensor information.
body[in] the body that caused the contact force. If no body caused the force on the sensor (could be user input) then the body is NULL

Implements SimulatedTactileSensor.

◆ addForceW()

void addForceW ( const rw::math::Vector3D<> &  point,
const rw::math::Vector3D<> &  force,
const rw::math::Vector3D<> &  snormal,
rw::kinematics::State state,
rw::core::Ptr< rwsim::dynamics::Body body = NULL 
)
virtual

add a force to a point on the sensor geometry. The force is described relative to the world frame.

Parameters
point[in] the point where the force is acting.
force[in] the direction in which the force is acting
snormal[in] the contact normal where the origin is on the contacting body and the direction is toward the sensor
state[in/out] the state is updated with new sensor information.
body[in] the body that caused the contact force. If no body caused the force on the sensor (could be user input) then the body is NULL

Implements SimulatedTactileSensor.

◆ addWrenchToCOM()

void addWrenchToCOM ( const rw::math::Vector3D<> &  force,
const rw::math::Vector3D<> &  torque,
rw::kinematics::State state,
rw::core::Ptr< rwsim::dynamics::Body body = NULL 
)
virtual

add a wrench to the center of mass of this object

Parameters
force
torque
state
body

Implements SimulatedTactileSensor.

◆ addWrenchWToCOM()

void addWrenchWToCOM ( const rw::math::Vector3D<> &  force,
const rw::math::Vector3D<> &  torque,
rw::kinematics::State state,
rw::core::Ptr< rwsim::dynamics::Body body = NULL 
)
virtual

add a wrench described in World frame to the center of mass of this object

Parameters
force
torque
state
body

Implements SimulatedTactileSensor.

◆ getCenters()

const VertexMatrix& getCenters ( ) const
inline

a matrix with position of each tactile cell center. The coordinates are described relative to the TactileArray transform (see getTransform())

Returns
a matrix describing the center of each tactile cell.

◆ getHeight()

int getHeight ( ) const
inline

get height of tactile array

◆ getMesh()

const rw::geometry::PlainTriMeshD& getMesh ( )
inline

get triangle mesh representing the tactile array

Returns
triangle mesh

◆ getNormals()

const VertexMatrix& getNormals ( ) const
inline

a matrix with position of each tactile cell center. The coordinates are described relative to the TactileArray transform (see getTransform())

Returns
a matrix describing the center of each tactile cell.

◆ getPressureLimit()

std::pair<double, double> getPressureLimit ( ) const
inline

get the minimum and maximum pressure capability of any tactile cell in the TactileArray

Returns
min and max pressure in Pa

◆ getSensor()

get sensor with specific name

◆ getSensorFrame()

rw::kinematics::Frame* getSensorFrame ( )
inline

The frame to which the sensor is attached.

The frame can be NULL.

◆ getTactileArraySensor()

get a handle to the statefull instance of the simulated sensor

Parameters
sim[in] simulator in which instance is active.
Returns
handle to instance of simulated sensor

◆ getTexelData() [1/2]

const rw::sensor::TactileArrayModel::ValueMatrix& getTexelData ( const rw::kinematics::State state) const

get last sampled texel pressure values

Parameters
state[in] state in which values are to be found

◆ getTexelData() [2/2]

get last sampled texel pressure values

Parameters
state[in] state in which values are to be found

◆ getTexelSize()

rw::math::Vector2D getTexelSize ( int  x,
int  y 
) const
inline

gets the size of an individual tactile cell with coordinates (x,y)

Parameters
x
y
Returns
the dimensions of the tactile cell in meters

◆ getTransform()

const rw::math::Transform3D& getTransform ( void  ) const
inline

a transformation from the sensor frame to the geometric data of the tactile array.

Returns

◆ getVertexGrid()

const VertexMatrix& getVertexGrid ( ) const
inline

gets the 3d geometry of this tactilearray. The vertexes are expressed realtive to the transform.

Returns

◆ getWidth()

int getWidth ( ) const
inline

get width of tactile array

◆ reset()

void reset ( const rw::kinematics::State state)
virtual

Resets the state of the SimulatedSensor to that of state.

Parameters
state[in] the state that the sensor is reset too.

Implements SimulatedSensor.

◆ setDeformationMask()

void setDeformationMask ( const ValueMatrix &  dmask,
double  width,
double  height 
)

sets the deformation mask used for determining the deformation of the sensor surface when a point force is applied to it.

Note
make sure that the sum of all elements in the mask is 1 or less.

◆ update()

void update ( const rwlibs::simulation::Simulator::UpdateInfo info,
rw::kinematics::State state 
)
virtual

steps the the SimulatedSensor with time dt and saves any state changes in state.

Parameters
info[in] update information related to the time step.
state[out] changes of the SimulatedSensor is saved in state.

Implements SimulatedSensor.


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