RobWorkProject
24.8.23-
|
This sensor attaches to a body and records all forces and the corresponding positions where the forces act. More...
#include <BodyContactSensor.hpp>
Inherits SimulatedTactileSensor.
Classes | |
class | ClassState |
The state of the sensor. More... | |
Public Types | |
typedef rw::core::Ptr< BodyContactSensor > | Ptr |
Smart pointer type for BodyContactSensor. | |
Public Types inherited from SimulatedSensor | |
typedef rw::core::Ptr< SimulatedSensor > | Ptr |
smart pointer type of this class | |
Public Types inherited from Stateless | |
typedef rw::core::Ptr< Stateless > | Ptr |
Smart pointer type for Stateless. | |
Public Member Functions | |
BodyContactSensor (const std::string &name, rw::core::Ptr< rw::kinematics::Frame > frame) | |
constructor More... | |
virtual | ~BodyContactSensor () |
Destructor. | |
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... | |
void | reset (const rw::kinematics::State &state) |
Resets the state of the SimulatedSensor to that of state. More... | |
rw::sensor::Sensor::Ptr | getSensor () |
Get sensor (should not be used). More... | |
void | addForceW (const rw::math::Vector3D<> &point, const rw::math::Vector3D<> &force, const rw::math::Vector3D<> &cnormal, 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<> &cnormal, rw::kinematics::State &state, rw::core::Ptr< rwsim::dynamics::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... | |
const std::vector< rw::sensor::Contact3D > & | getContacts (const rw::kinematics::State &state) const |
return all contacts registered in the last timestep More... | |
std::vector< rw::core::Ptr< rwsim::dynamics::Body > > | getBodies (const rw::kinematics::State &state) |
Get the bodies in contact. 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::Frame * | getFrame () 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... | |
Additional Inherited Members | |
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 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. | |
This sensor attaches to a body and records all forces and the corresponding positions where the forces act.
BodyContactSensor | ( | const std::string & | name, |
rw::core::Ptr< rw::kinematics::Frame > | frame | ||
) |
constructor
name | [in] the sensor name |
frame | [in] the frame of this sensor. |
|
virtual |
add a force to a point on the sensor geometry. The force is described relative to the sensor frame.
point | [in] the point where the force is acting. |
force | [in] the direction in which the force is acting |
cnormal | [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.
|
virtual |
add a force to a point on the sensor geometry. The force is described relative to the world frame.
point | [in] the point where the force is acting. |
force | [in] the direction in which the force is acting |
cnormal | [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.
|
inlinevirtual |
add a wrench to the center of mass of this object
force | |
torque | |
state | |
body |
Implements SimulatedTactileSensor.
|
inlinevirtual |
add a wrench described in World frame to the center of mass of this object
force | |
torque | |
state | |
body |
Implements SimulatedTactileSensor.
|
inline |
Get the bodies in contact.
state | [in] the state. |
|
inline |
return all contacts registered in the last timestep
state | [in] the state. |
rw::sensor::Sensor::Ptr getSensor | ( | ) |
Get sensor (should not be used).
|
virtual |
Resets the state of the SimulatedSensor to that of state.
state | [in] the state that the sensor is reset too. |
Implements SimulatedSensor.
|
virtual |
steps the the SimulatedSensor with time dt and saves any state changes in state.
info | [in] update information related to the time step. |
state | [out] changes of the SimulatedSensor is saved in state. |
Implements SimulatedSensor.