SOFA plugin: Sensable  master
Open source framework for multi-physics simuation
sofa::component::controller::NewOmniDriver Class Reference

#include <NewOmniDriver.h>

Inheritance diagram for sofa::component::controller::NewOmniDriver:

Detailed Description

Omni driver

Classes

struct  VisualComponent
 

Public Attributes

Data< double > forceScale
 Default scaling factor applied to the force feedback. More...
 
Data< double > scale
 Default scale applied to the Phantom Coordinates. More...
 
Data< Vec3d > positionBase
 Position of the interface base in the scene world coordinates. More...
 
Data< Quat > orientationBase
 Orientation of the interface base in the scene world coordinates. More...
 
Data< Vec3d > positionTool
 Position of the tool in the omni end effector frame. More...
 
Data< Quat > orientationTool
 Orientation of the tool in the omni end effector frame. More...
 
Data< bool > permanent
 Apply the force feedback permanently. More...
 
Data< bool > omniVisu
 Visualize the position of the interface in the virtual scene. More...
 
Data< VecCoordposDevice
 position of the base of the part of the device More...
 
Data< VecCoordposStylus
 position of the base of the stylus More...
 
Data< std::string > locDOF
 localisation of the DOFs MechanicalObject More...
 
Data< std::string > deviceName
 name of the device More...
 
Data< int > deviceIndex
 index of the device More...
 
Data< Vec1d > openTool
 opening of the tool More...
 
Data< double > maxTool
 maxTool value More...
 
Data< double > minTool
 minTool value More...
 
Data< double > openSpeedTool
 openSpeedTool value More...
 
Data< double > closeSpeedTool
 closeSpeedTool value More...
 
Data< bool > useScheduler
 Enable use of OpenHaptics Scheduler methods to synchronize haptics thread. More...
 
Data< bool > setRestShape
 True to control the rest position instead of the current position directly. More...
 
Data< bool > applyMappings
 True to enable applying the mappings after setting the position. More...
 
Data< bool > alignOmniWithCamera
 True to keep the Omni's movements in the same reference frame as the camera. More...
 
Data< bool > stateButton1
 True if the First button of the Omni is pressed. More...
 
Data< bool > stateButton2
 True if the Second button of the Omni is pressed. More...
 
sofa::component::container::MechanicalObject< sofa::defaulttype::Rigid3dTypes > * DOFs
 
sofa::component::visualmodel::BaseCamera::SPtr camera
 
bool initVisu
 
NewOmniData data
 
AllNewOmniData allData
 
VisualComponent visualNode [NVISUALNODE]
 
simulation::Node::SPtr nodePrincipal
 
MMechanicalObject::SPtr rigidDOF
 
bool changeScale
 
bool firstInit
 
float oldScale
 
bool visuActif
 
bool isInitialized
 
Vec3d positionBase_buf
 
bool modX
 
bool modY
 
bool modZ
 
bool modS
 
bool axesActif
 
HDfloat angle1 [3]
 
HDfloat angle2 [3]
 
bool firstDevice
 
- Public Attributes inherited from sofa::core::objectmodel::BaseObject
Data< bool > f_listening
 
- Public Attributes inherited from sofa::core::objectmodel::Base
std::vector< lifecycle::DeprecatedData * > m_oldAttributes
 
Data< int > d_messageLogCount
 
Data< std::string > name
 
Data< bool > f_printLog
 
Data< sofa::core::objectmodel::TagSetf_tags
 
Data< sofa::type::BoundingBoxf_bbox
 
Data< sofa::core::objectmodel::ComponentStated_componentState
 
std::string m_definitionSourceFileName
 
int m_definitionSourceFilePos
 
std::string m_instanciationSourceFileName
 
int m_instanciationSourceFilePos
 

Static Public Attributes

static const char * visualNodeNames [NVISUALNODE]
 
static const char * visualNodeFiles [NVISUALNODE]
 

Public Member Functions

 SOFA_CLASS (NewOmniDriver, Controller)
 
 NewOmniDriver ()
 
virtual ~NewOmniDriver ()
 
virtual void init () override
 
virtual void bwdInit () override
 
virtual void reset () override
 
void reinit () override
 
int initDevice ()
 
void cleanup () override
 
virtual void draw (const core::visual::VisualParams *) override
 
virtual void draw ()
 
void setForceFeedback (ForceFeedback *ff)
 
void onKeyPressedEvent (core::objectmodel::KeypressedEvent *) override
 
void onKeyReleasedEvent (core::objectmodel::KeyreleasedEvent *) override
 
void onAnimateBeginEvent ()
 
void setDataValue ()
 
- Public Member Functions inherited from sofa::component::controller::Controller
 SOFA_CLASS (Controller, core::behavior::BaseController)
 
virtual void onMouseEvent (core::objectmodel::MouseEvent *)
 
virtual void onHapticDeviceEvent (core::objectmodel::HapticDeviceEvent *)
 
virtual void onJoystickEvent (core::objectmodel::JoystickEvent *)
 
virtual void onBeginAnimationStep (const double)
 
virtual void onEndAnimationStep (const double)
 
virtual void onGUIEvent (core::objectmodel::GUIEvent *)
 
- Public Member Functions inherited from sofa::core::behavior::BaseController
 SOFA_ABSTRACT_CLASS (BaseController, core::objectmodel::BaseObject)
 
- Public Member Functions inherited from sofa::core::objectmodel::BaseObject
 SOFA_CLASS (BaseObject, Base)
 
virtual void computeBBox (const core::ExecParams *, bool=false)
 
void setSrc (const std::string &v, std::vector< std::string > *attributeList=nullptr)
 
void setSrc (const std::string &v, const BaseObject *loader, std::vector< std::string > *attributeList=nullptr)
 
BasefindLinkDestClass (const BaseClass *destType, const std::string &path, const BaseLink *link) override
 
virtual std::string getPathName () const override
 
virtual bool insertInNode (BaseNode *)
 
virtual bool removeInNode (BaseNode *)
 
SReal getTime () const
 
const BaseContextgetContext () const
 
BaseContextgetContext ()
 
const BaseObjectgetMaster () const
 
BaseObjectgetMaster ()
 
const VecSlavesgetSlaves () const
 
BaseObjectgetSlave (const std::string &name) const
 
virtual void addSlave (BaseObject::SPtr s)
 
virtual void removeSlave (BaseObject::SPtr s)
 
virtual void handleTopologyChange ()
 
virtual void handleTopologyChange (core::topology::Topology *t)
 
void parse (BaseObjectDescription *arg) override
 
void updateInternal ()
 
virtual void storeResetState ()
 
SReal getTime () const
 
- Public Member Functions inherited from sofa::core::objectmodel::Base
virtual const BaseClassgetClass () const
 
void addDeprecatedAttribute (lifecycle::DeprecatedData *attribute)
 
void addUpdateCallback (const std::string &name, std::initializer_list< BaseData * > inputs, std::function< sofa::core::objectmodel::ComponentState(const DataTracker &)> function, std::initializer_list< BaseData * > outputs)
 
void addOutputsToCallback (const std::string &name, std::initializer_list< BaseData * > outputs)
 
const std::string & getName () const
 
void setName (const std::string &n)
 
void setName (const std::string &n, int counter)
 
std::string getTypeName () const
 
virtual std::string getClassName () const
 
virtual std::string getTemplateName () const final
 
std::string getNameSpaceName () const
 
void setDefinitionSourceFileName (const std::string &sourceFileName)
 
const std::string & getDefinitionSourceFileName () const
 
void setDefinitionSourceFilePos (const int)
 
int getDefinitionSourceFilePos () const
 
void setInstanciationSourceFileName (const std::string &sourceFileName)
 
const std::string & getInstanciationSourceFileName () const
 
void setInstanciationSourceFilePos (const int)
 
int getInstanciationSourceFilePos () const
 
void addMessage (const sofa::helper::logging::Message &m) const
 
size_t countLoggedMessages (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
const std::deque< sofa::helper::logging::Message > & getLoggedMessages () const
 
const std::string getLoggedMessagesAsString (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
void clearLoggedMessages () const
 
bool notMuted () const
 
const sofa::core::objectmodel::TagSetgetTags () const
 
bool hasTag (Tag t) const
 
void addTag (Tag t)
 
void removeTag (Tag t)
 
ComponentState getComponentState () const
 
bool isComponentStateValid () const
 
bool isComponentStateInvalid () const
 
 SOFA_ATTRIBUTE_DEPRECATED__TOBASECONSTRAINT () virtual const behavior
 
virtual bool parseField (const std::string &attribute, const std::string &value)
 
virtual bool hasField (const std::string &attribute) const
 
void parseFields (const std::list< std::string > &str)
 
virtual void parseFields (const std::map< std::string, std::string * > &str)
 
void writeDatas (std::map< std::string, std::string * > &str)=delete
 
void writeDatas (std::ostream &out, const std::string &separator=" ")
 
BaseDatafindData (const std::string &name) const
 
std::vector< BaseData * > findGlobalField (const std::string &name) const
 
BaseLinkfindLink (const std::string &name) const
 
std::vector< BaseLink * > findLinks (const std::string &name) const
 
virtual void updateLinks (bool logErrors=true)
 
BaseData::BaseInitData initData (::sofa::core::objectmodel::Data< T > *field, const char *name, const char *help, ::sofa::core::objectmodel::BaseData::DataFlags dataflags)
 
BaseData::BaseInitData initData (Data< T > *field, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 
Data< T >::InitData initData (Data< T > *field, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 
void addData (BaseData *f, const std::string &name)
 
void addData (BaseData *f)
 
void removeData (BaseData *f)
 
void addAlias (BaseData *field, const char *alias)
 
void addLink (BaseLink *l)
 
void addAlias (BaseLink *link, const char *alias)
 
const VecDatagetDataFields () const
 
const MapDatagetDataAliases () const
 
const VecLinkgetLinks () const
 
const MapLinkgetLinkAliases () const
 
virtual bool findDataLinkDest (BaseData *&ptr, const std::string &path, const BaseLink *link)
 
bool findLinkDest (T *&ptr, const std::string &path, const BaseLink *link)
 
const sofa::core::objectmodel::TagSetgetTags () const
 
bool hasTag (Tag t) const
 
void addTag (Tag t)
 
void removeTag (Tag t)
 
ComponentState getComponentState () const
 
bool isComponentStateValid () const
 
bool isComponentStateInvalid () const
 
 SOFA_ATTRIBUTE_DEPRECATED__TOBASECONSTRAINT () virtual const behavior
 

Additional Inherited Members

- Protected Attributes inherited from sofa::component::controller::Controller
Data< bool > d_handleEventTriggersUpdate
 
- Protected Attributes inherited from sofa::core::objectmodel::BaseObject
SingleLink< BaseObject, BaseContext, BaseLink::FLAG_DOUBLELINK > l_context
 
LinkSlaves l_slaves
 
SingleLink< BaseObject, BaseObject, BaseLink::FLAG_DOUBLELINK > l_master
 
- Protected Attributes inherited from sofa::core::objectmodel::Base
std::map< std::string, sofa::core::DataTrackerCallbackm_internalEngine
 
VecData m_vecData
 
MapData m_aliasData
 
VecLink m_vecLink
 
MapLink m_aliasLink
 
- Static Public Member Functions inherited from sofa::core::objectmodel::BaseObject
static bool canCreate (T *, BaseContext *, BaseObjectDescription *)
 
static T::SPtr create (T *, BaseContext *context, BaseObjectDescription *arg)
 
- Static Public Member Functions inherited from sofa::core::objectmodel::Base
static const BaseClassGetClass ()
 
static std::string shortName (const T *ptr=nullptr, BaseObjectDescription *=nullptr)
 
- Protected Member Functions inherited from sofa::component::controller::Controller
 Controller ()
 
 ~Controller () override
 
- Protected Member Functions inherited from sofa::core::objectmodel::BaseObject
 BaseObject ()
 
 ~BaseObject () override
 
virtual void doUpdateInternal ()
 
void changeContextLink (BaseContext *before, BaseContext *&after)
 
void changeSlavesLink (BaseObject::SPtr ptr, std::size_t, bool add)
 
void trackInternalData (const BaseData &data)
 
void cleanTracker ()
 
bool hasDataChanged (const BaseData &data)
 
- Protected Member Functions inherited from sofa::core::objectmodel::Base
 Base ()
 
virtual ~Base ()
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, BaseData::DataFlags dataFlags)
 
void initData0 (Data< T > *field, typename Data< T >::InitData &res, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 
- Protected Member Functions inherited from sofa::core::IntrusiveObject
virtual ~IntrusiveObject ()=default
 

Attribute details

◆ alignOmniWithCamera

Data<bool> sofa::component::controller::NewOmniDriver::alignOmniWithCamera

True to keep the Omni's movements in the same reference frame as the camera.

◆ allData

AllNewOmniData sofa::component::controller::NewOmniDriver::allData

◆ angle1

HDfloat sofa::component::controller::NewOmniDriver::angle1[3]

◆ angle2

HDfloat sofa::component::controller::NewOmniDriver::angle2[3]

◆ applyMappings

Data<bool> sofa::component::controller::NewOmniDriver::applyMappings

True to enable applying the mappings after setting the position.

◆ axesActif

bool sofa::component::controller::NewOmniDriver::axesActif

◆ camera

sofa::component::visualmodel::BaseCamera::SPtr sofa::component::controller::NewOmniDriver::camera

◆ changeScale

bool sofa::component::controller::NewOmniDriver::changeScale

◆ closeSpeedTool

Data<double> sofa::component::controller::NewOmniDriver::closeSpeedTool

closeSpeedTool value

◆ data

NewOmniData sofa::component::controller::NewOmniDriver::data

◆ deviceIndex

Data< int > sofa::component::controller::NewOmniDriver::deviceIndex

index of the device

◆ deviceName

Data< std::string > sofa::component::controller::NewOmniDriver::deviceName

name of the device

◆ DOFs

sofa::component::container::MechanicalObject<sofa::defaulttype::Rigid3dTypes>* sofa::component::controller::NewOmniDriver::DOFs

◆ firstDevice

bool sofa::component::controller::NewOmniDriver::firstDevice

◆ firstInit

bool sofa::component::controller::NewOmniDriver::firstInit

◆ forceScale

Data<double> sofa::component::controller::NewOmniDriver::forceScale

Default scaling factor applied to the force feedback.

◆ initVisu

bool sofa::component::controller::NewOmniDriver::initVisu

◆ isInitialized

bool sofa::component::controller::NewOmniDriver::isInitialized

◆ locDOF

Data< std::string > sofa::component::controller::NewOmniDriver::locDOF

localisation of the DOFs MechanicalObject

◆ maxTool

Data<double> sofa::component::controller::NewOmniDriver::maxTool

maxTool value

◆ minTool

Data<double> sofa::component::controller::NewOmniDriver::minTool

minTool value

◆ modS

bool sofa::component::controller::NewOmniDriver::modS

◆ modX

bool sofa::component::controller::NewOmniDriver::modX

◆ modY

bool sofa::component::controller::NewOmniDriver::modY

◆ modZ

bool sofa::component::controller::NewOmniDriver::modZ

◆ nodePrincipal

simulation::Node::SPtr sofa::component::controller::NewOmniDriver::nodePrincipal

◆ oldScale

float sofa::component::controller::NewOmniDriver::oldScale

◆ omniVisu

Data<bool> sofa::component::controller::NewOmniDriver::omniVisu

Visualize the position of the interface in the virtual scene.

◆ openSpeedTool

Data<double> sofa::component::controller::NewOmniDriver::openSpeedTool

openSpeedTool value

◆ openTool

Data<Vec1d> sofa::component::controller::NewOmniDriver::openTool

opening of the tool

◆ orientationBase

Data<Quat> sofa::component::controller::NewOmniDriver::orientationBase

Orientation of the interface base in the scene world coordinates.

◆ orientationTool

Data<Quat> sofa::component::controller::NewOmniDriver::orientationTool

Orientation of the tool in the omni end effector frame.

◆ permanent

Data<bool> sofa::component::controller::NewOmniDriver::permanent

Apply the force feedback permanently.

◆ posDevice

Data< VecCoord > sofa::component::controller::NewOmniDriver::posDevice

position of the base of the part of the device

◆ positionBase

Data<Vec3d> sofa::component::controller::NewOmniDriver::positionBase

Position of the interface base in the scene world coordinates.

◆ positionBase_buf

Vec3d sofa::component::controller::NewOmniDriver::positionBase_buf

◆ positionTool

Data<Vec3d> sofa::component::controller::NewOmniDriver::positionTool

Position of the tool in the omni end effector frame.

◆ posStylus

Data< VecCoord > sofa::component::controller::NewOmniDriver::posStylus

position of the base of the stylus

◆ rigidDOF

MMechanicalObject::SPtr sofa::component::controller::NewOmniDriver::rigidDOF

◆ scale

Data<double> sofa::component::controller::NewOmniDriver::scale

Default scale applied to the Phantom Coordinates.

◆ setRestShape

Data<bool> sofa::component::controller::NewOmniDriver::setRestShape

True to control the rest position instead of the current position directly.

◆ stateButton1

Data<bool> sofa::component::controller::NewOmniDriver::stateButton1

True if the First button of the Omni is pressed.

◆ stateButton2

Data<bool> sofa::component::controller::NewOmniDriver::stateButton2

True if the Second button of the Omni is pressed.

◆ useScheduler

Data<bool> sofa::component::controller::NewOmniDriver::useScheduler

Enable use of OpenHaptics Scheduler methods to synchronize haptics thread.

◆ visuActif

bool sofa::component::controller::NewOmniDriver::visuActif

◆ visualNode

VisualComponent sofa::component::controller::NewOmniDriver::visualNode[NVISUALNODE]

◆ visualNodeFiles

const char * sofa::component::controller::NewOmniDriver::visualNodeFiles
static
Initial value:
=
{
"mesh/stylusO.obj",
"mesh/articulation5O.obj",
"mesh/articulation4O.obj",
"mesh/articulation3O.obj",
"mesh/articulation2O.obj",
"mesh/articulation1O.obj",
"mesh/BASEO.obj",
"mesh/axeX.obj",
"mesh/axeY.obj",
"mesh/axeZ.obj"
}

◆ visualNodeNames

const char * sofa::component::controller::NewOmniDriver::visualNodeNames
static
Initial value:
=
{
"stylus",
"joint 2",
"joint 1",
"arm 2",
"arm 1",
"joint 0",
"base",
"axe X",
"axe Y",
"axe Z"
}

Constructor details

◆ NewOmniDriver()

sofa::component::controller::NewOmniDriver::NewOmniDriver ( )

◆ ~NewOmniDriver()

sofa::component::controller::NewOmniDriver::~NewOmniDriver ( )
virtual

Function details

◆ bwdInit()

void sofa::component::controller::NewOmniDriver::bwdInit ( )
overridevirtual

◆ cleanup()

void sofa::component::controller::NewOmniDriver::cleanup ( )
overridevirtual

◆ draw() [1/2]

void sofa::component::controller::NewOmniDriver::draw ( )
virtual

◆ draw() [2/2]

void sofa::component::controller::NewOmniDriver::draw ( const core::visual::VisualParams vparam)
overridevirtual

◆ init()

void sofa::component::controller::NewOmniDriver::init ( void  )
overridevirtual

◆ initDevice()

int sofa::component::controller::NewOmniDriver::initDevice ( )

Sets up the device,

◆ onAnimateBeginEvent()

void sofa::component::controller::NewOmniDriver::onAnimateBeginEvent ( )

◆ onKeyPressedEvent()

void sofa::component::controller::NewOmniDriver::onKeyPressedEvent ( core::objectmodel::KeypressedEvent kpe)
overridevirtual

◆ onKeyReleasedEvent()

void sofa::component::controller::NewOmniDriver::onKeyReleasedEvent ( core::objectmodel::KeyreleasedEvent kre)
overridevirtual

◆ reinit()

void sofa::component::controller::NewOmniDriver::reinit ( )
overridevirtual

◆ reset()

void sofa::component::controller::NewOmniDriver::reset ( )
overridevirtual

◆ setDataValue()

void sofa::component::controller::NewOmniDriver::setDataValue ( )

◆ setForceFeedback()

void sofa::component::controller::NewOmniDriver::setForceFeedback ( ForceFeedback ff)

◆ SOFA_CLASS()

sofa::component::controller::NewOmniDriver::SOFA_CLASS ( NewOmniDriver  ,
Controller   
)

Enum details

◆ anonymous enum

anonymous enum
Enumerator
VN_stylus 
VN_joint2 
VN_joint1 
VN_arm2 
VN_arm1 
VN_joint0 
VN_base 
VN_X 
VN_Y 
VN_Z 
NVISUALNODE