RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
LogForceTorque Class Referenceabstract

Logging for forces and torques. More...

#include <LogForceTorque.hpp>

Inherits SimulatorLogEntry.

Inherited by LogConstraintForceTorque, and LogContactForceTorque.

Public Types

typedef rw::core::Ptr< LogForceTorquePtr
 Smart pointer type of LogForceTorque.
 
- Public Types inherited from SimulatorLogEntry
typedef rw::core::Ptr< SimulatorLogEntryPtr
 Smart pointer type of SimulatorLogEntry.
 
- Public Types inherited from SimulatorLog
typedef rw::core::Ptr< SimulatorLogPtr
 Smart pointer type of SimulatorLog.
 
typedef rw::core::Ptr< const SimulatorLogCPtr
 Smart pointer type of const SimulatorLog.
 

Public Member Functions

 LogForceTorque (SimulatorLogScope *parent)
 Constructor. More...
 
virtual ~LogForceTorque ()
 Destructor.
 
virtual void read (class rw::common::InputArchive &iarchive, const std::string &id)
 
virtual void write (class rw::common::OutputArchive &oarchive, const std::string &id) const
 
virtual std::string getType () const =0
 Get a textual representation of the type of the item. More...
 
virtual bool operator== (const SimulatorLog &b) const
 Check if logs are identical. More...
 
virtual std::list< SimulatorLogEntry::PtrgetLinkedEntries () const =0
 Get a list of other entries that this entry is linked to. More...
 
virtual bool autoLink ()=0
 Do automatic linking to other entries. More...
 
virtual SimulatorLogEntry::Ptr createNew (SimulatorLogScope *parent) const =0
 Create a new entry of the same type (no data is copied). More...
 
virtual int sizeLinkedEntry () const =0
 Get the size of the linked entry (if any). More...
 
virtual const std::string & getNameA (std::size_t i) const =0
 Get name of the first object. More...
 
virtual const std::string & getNameB (std::size_t i) const =0
 Get name of the second object. More...
 
virtual rw::math::Vector3D getPositionA (std::size_t i) const =0
 Get anchor position on the first object. More...
 
virtual rw::math::Vector3D getPositionB (std::size_t i) const =0
 Get anchor position on the second object. More...
 
rw::math::Wrench6D getWrenchBodyA (std::size_t i) const
 Get the contact wrench acting at the first body. More...
 
rw::math::Wrench6D getWrenchBodyB (std::size_t i) const
 Get the contact wrench acting at the second body. More...
 
void setWrench (std::size_t i, const rw::math::Wrench6D<> &wrenchA, const rw::math::Wrench6D<> &wrenchB)
 Set a given wrench pair. More...
 
- Public Member Functions inherited from SimulatorLogEntry
 SimulatorLogEntry (SimulatorLogScope *parent)
 Constructor. More...
 
virtual ~SimulatorLogEntry ()
 Destructor.
 
virtual std::size_t children () const
 Get the number of children under this log item. More...
 
virtual int line () const
 Get the line number in the file where this entry was added. More...
 
virtual void setLine (int line)
 Set the line number where this entry was added. More...
 
- Public Member Functions inherited from SimulatorLog
 SimulatorLog (SimulatorLogScope *parent=NULL)
 Constructor. More...
 
virtual ~SimulatorLog ()
 Destructor.
 
virtual SimulatorLogScopegetParent () const
 Get the parent of this log item. More...
 
virtual bool operator!= (const SimulatorLog &b) const
 Check if logs are non-identical. More...
 
virtual std::string getFilename () const
 Get the full filename with path for where this log entry was created. More...
 
virtual void setFilename (const std::string &file)
 Set the name of the file where this log entry was created. More...
 
virtual void setFilename (const char *file)
 Set the name of the file where this log entry was created. More...
 
virtual std::string getDescription () const
 Get a string describing this entry. More...
 
virtual void setDescription (const std::string &description)
 Set a very short description of this entry. More...
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 destructor
 

Detailed Description

Logging for forces and torques.

Constructor & Destructor Documentation

◆ LogForceTorque()

Constructor.

Note
This item will not be added as a child to the parent scope using this constructor.
Parameters
parentthe parent of this log item.

Member Function Documentation

◆ autoLink()

virtual bool autoLink ( )
pure virtual

Do automatic linking to other entries.

Returns
true if linking succeeded, false otherwise.

Implements SimulatorLogEntry.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ createNew()

virtual SimulatorLogEntry::Ptr createNew ( SimulatorLogScope parent) const
pure virtual

Create a new entry of the same type (no data is copied).

Parameters
parentthe parent of the new entry.
Returns
the new entry.

Implements SimulatorLogEntry.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ getLinkedEntries()

virtual std::list<SimulatorLogEntry::Ptr> getLinkedEntries ( ) const
pure virtual

Get a list of other entries that this entry is linked to.

Using linked entries makes it possible to avoid logging too much redundant information.

Returns
a list of linked entries.

Implements SimulatorLogEntry.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ getNameA()

virtual const std::string& getNameA ( std::size_t  i) const
pure virtual

Get name of the first object.

Parameters
i[in] the index.
Returns
the name or an empty string if not linked properly.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ getNameB()

virtual const std::string& getNameB ( std::size_t  i) const
pure virtual

Get name of the second object.

Parameters
i[in] the index.
Returns
the name or an empty string if not linked properly.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ getPositionA()

virtual rw::math::Vector3D getPositionA ( std::size_t  i) const
pure virtual

Get anchor position on the first object.

Parameters
i[in] the index.
Returns
the anchor point or zero if not linked.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ getPositionB()

virtual rw::math::Vector3D getPositionB ( std::size_t  i) const
pure virtual

Get anchor position on the second object.

Parameters
i[in] the index.
Returns
the anchor point or zero if not linked.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ getType()

virtual std::string getType ( ) const
pure virtual

Get a textual representation of the type of the item.

Returns
the type of item as a string.

Implements SimulatorLogEntry.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ getWrenchBodyA()

rw::math::Wrench6D getWrenchBodyA ( std::size_t  i) const

Get the contact wrench acting at the first body.

Parameters
i[in] the constraint to get wrench for.
Returns
the wrench.

◆ getWrenchBodyB()

rw::math::Wrench6D getWrenchBodyB ( std::size_t  i) const

Get the contact wrench acting at the second body.

Parameters
i[in] the constraint to get wrench for.
Returns
the wrench.

◆ operator==()

virtual bool operator== ( const SimulatorLog b) const
virtual

Check if logs are identical.

Parameters
b[in] other log to compare with.
Returns
true if identical, false otherwise.

Reimplemented from SimulatorLogEntry.

Reimplemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ read()

virtual void read ( class rw::common::InputArchive iarchive,
const std::string &  id 
)
virtual

Enable read-serialization of inherited class by implementing this method. Data is read from iarchive and filled into this object.

Parameters
iarchive[in] the InputArchive from which to read data.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

Reimplemented from SimulatorLogEntry.

◆ setWrench()

void setWrench ( std::size_t  i,
const rw::math::Wrench6D<> &  wrenchA,
const rw::math::Wrench6D<> &  wrenchB 
)

Set a given wrench pair.

Parameters
i[in] the constraint to set wrench for.
wrenchA[in] the wrench acting in the constraint at the first body.
wrenchB[in] the wrench acting in the constraint at the second body.

◆ sizeLinkedEntry()

virtual int sizeLinkedEntry ( ) const
pure virtual

Get the size of the linked entry (if any).

Returns
size of the linked entry or negative value if not linked.

Implemented in LogContactForceTorque, and LogConstraintForceTorque.

◆ write()

virtual void write ( class rw::common::OutputArchive oarchive,
const std::string &  id 
) const
virtual

Enable write-serialization of inherited class by implementing this method. Data is written to oarchive from this object.

Parameters
oarchive[out] the OutputArchive in which data should be written.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

Reimplemented from SimulatorLogEntry.


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