Privacy
An open-source, flexible 3D physical simulation framework
mars::interfaces::NodeManagerInterface Class Referenceabstract

"NodeManagerInterface" declares the interfaces for all NodeOperations that are used for the communication between the simulation modules. More...

#include <NodeManagerInterface.h>

Public Member Functions

virtual ~NodeManagerInterface ()
 
virtual NodeId addNode (NodeData *nodeS, bool reload=false, bool loadGraphics=true)=0
 Add a node to the node pool of the simulation. More...
 
virtual NodeId createPrimitiveNode (const std::string &name, NodeType type, bool movable=false, const utils::Vector &pos=utils::Vector::Zero(), const utils::Vector &extension=utils::Vector::Identity(), double mass=0, const utils::Quaternion &orientation=utils::Quaternion::Identity(), bool disablePhysics=false)=0
 
virtual NodeId addTerrain (terrainStruct *terrainS)=0
 Add a terrain node to the node pool of the simulation. More...
 
virtual std::vector< NodeIdaddNode (std::vector< NodeData > v_NodeData)=0
 Add a vector of nodes to the node pool of the simulation. More...
 
virtual NodeId addPrimitive (NodeData *snode)=0
 Add a node of type primitive to the node pool of the simulation. More...
 
virtual bool exists (NodeId id) const =0
 Returns true, if the node with the given id exists. More...
 
virtual int getNodeCount () const =0
 Returns the number of nodes that are added to the simulation. More...
 
virtual NodeId getNextNodeID () const =0
 Returns the ID for the next node which will be added to the simulation. More...
 
virtual void editNode (NodeData *nodeS, int changes)=0
 This function supports the possibility to change some properties of a node. More...
 
virtual void changeGroup (NodeId id, int group)=0
 This function is not implemented yet. More...
 
virtual void getListNodes (std::vector< core_objects_exchange > *nodeList) const =0
 Gives information about core exchange data for nodes. More...
 
virtual void getNodeExchange (NodeId id, core_objects_exchange *obj) const =0
 Gives information about core exchange data for a certain node. More...
 
virtual const NodeData getFullNode (NodeId id) const =0
 Gives all information of a certain node. More...
 
virtual void removeNode (NodeId id, bool clearGraphics=true)=0
 Removes a node from the simulation. More...
 
virtual void setNodeState (NodeId id, const nodeState &state)=0
 Set a state of a node. More...
 
virtual void getNodeState (NodeId id, nodeState *state) const =0
 
virtual const utils::Vector getCenterOfMass (const std::vector< NodeId > &ids) const =0
 Gives the center of mass of a set of nodes. More...
 
virtual const utils::Vector setReloadExtent (NodeId id, const utils::Vector &ext)=0
 Sets the new size of a node after a reset of the simulation. More...
 
virtual void setReloadPosition (NodeId id, const utils::Vector &pos)=0
 Sets the new position of a node after a reset of the simulation. More...
 
virtual void setReloadFriction (NodeId id, sReal friction1, sReal friction2)=0
 Sets the new contact friction of a node after a reset of the simulation. More...
 
virtual void setPosition (NodeId id, const utils::Vector &pos)=0
 Sets the current position of a node. More...
 
virtual const utils::Vector getPosition (NodeId id) const =0
 Returns the current position of a node. More...
 
virtual const utils::Quaternion getRotation (NodeId id) const =0
 Returns the current orientation of a node. More...
 
virtual void setRotation (NodeId id, const utils::Quaternion &rot)=0
 Sets the current orientation of a node. More...
 
virtual const utils::Vector getLinearVelocity (NodeId id) const =0
 Gets the current linear velocity of a node. More...
 
virtual const utils::Vector getAngularVelocity (NodeId id) const =0
 Gets the current angular velocity of a node. More...
 
virtual const utils::Vector getLinearAcceleration (NodeId id) const =0
 Gets the current linear acceleration of a node. More...
 
virtual const utils::Vector getAngularAcceleration (NodeId id) const =0
 Gets the current angular/rotational acceleration of a node. More...
 
virtual void applyForce (NodeId id, const utils::Vector &force, const utils::Vector &pos)=0
 Applies a off-center force to a physical node. More...
 
virtual void applyForce (NodeId id, const utils::Vector &force)=0
 Applies a force to a physical node. More...
 
virtual void applyTorque (NodeId id, const utils::Vector &torque)=0
 Applies a torque to a physical node. More...
 
virtual void setContactParamMotion1 (NodeId id, sReal motion)=0
 Sets a specific contact parameter; the motion of the contact. More...
 
virtual void addNodeSensor (BaseNodeSensor *sensor)=0
 This function is used to add sensor to a node that need more specific physical implementations. More...
 
virtual void reloadNodeSensor (BaseNodeSensor *sensor)=0
 This function resets a added sensor by removing it and add a new defined by the sensor config struct. More...
 
virtual sim::SimNodegetSimNode (NodeId id)=0
 This function returns the SimNode object for a given id. More...
 
virtual const sim::SimNodegetSimNode (NodeId id) const =0
 
virtual void reloadNodes (bool reloadGraphics)=0
 This function reloads all node from a temporally NodeData pool. More...
 
virtual void updateDynamicNodes (sReal calc_ms, bool physics_thread=true)=0
 Updates the node values of dynamic nodes from the physics. More...
 
virtual void clearAllNodes (bool clear_all=false, bool clearGraphics=true)=0
 This function destroys all nodes within the simulation. More...
 
virtual void setReloadAngle (NodeId id, const utils::sRotation &angle)=0
 Sets the new orientation of a node after a reset of the simulation. More...
 
virtual void setContactParams (NodeId id, const contact_params &cp)=0
 Sets the contact properties of the node. More...
 
virtual const contact_params getContactParams (NodeId id) const =0
 Returns the contact properties of a certain node. More...
 
virtual void setVelocity (NodeId id, const utils::Vector &vel)=0
 Sets the linear velocity of a node. More...
 
virtual void setAngularVelocity (NodeId id, const utils::Vector &vel)=0
 Sets the angular velocity of a node. More...
 
virtual void scaleReloadNodes (sReal x, sReal y, sReal z)=0
 Scales the size of all node after a reset of the simulation. More...
 
virtual void getNodeMass (NodeId id, sReal *mass, sReal *inertia=0) const =0
 Returns the mass and inertia of a certain node. More...
 
virtual void setAngularDamping (NodeId id, sReal damping)=0
 Sets a angular damping factor to the node dynamics. More...
 
virtual void addRotation (NodeId id, const utils::Quaternion &q)=0
 Adds a additional rotation to the orientation of a node. More...
 
virtual void setReloadQuaternion (NodeId id, const utils::Quaternion &q)=0
 Sets the new orientation of a node after a reset of the simulation. More...
 
virtual void exportGraphicNodesByID (const std::string &folder) const =0
 If a graphicsManager is loaded, exports the graphical models of all nodes. More...
 
virtual std::vector< NodeIdgetConnectedNodes (NodeId id)=0
 
virtual void getContactPoints (std::vector< NodeId > *ids, std::vector< utils::Vector > *contact_points) const =0
 
virtual void updateRay (NodeId id)=0
 
virtual NodeId getDrawID (NodeId id) const =0
 
virtual void setVisualRep (NodeId id, int val)=0
 
virtual const utils::Vector getContactForce (NodeId id) const =0
 
virtual NodeId getID (const std::string &node_name) const =0
 Retrieve the id of a node by name. More...
 
virtual double getCollisionDepth (NodeId id) const =0
 
virtual bool getDataBrokerNames (NodeId id, std::string *groupName, std::string *dataName) const =0
 Retrieves the groupName and dataName under which the node with the specified id publishes its data in the DataBroker. More...
 
virtual void setVisualQOffset (NodeId id, const utils::Quaternion &q)=0
 
virtual void updatePR (unsigned long id, const utils::Vector &pos, const utils::Quaternion &rot, const utils::Vector &visOffsetPos, const utils::Quaternion &visOffsetRot, bool doLock=true)=0
 
virtual bool getIsMovable (NodeId id) const =0
 
virtual void setIsMovable (NodeId id, bool isMovable)=0
 
virtual void lock ()=0
 
virtual void unlock ()=0
 
virtual void rotateNode (NodeId id, utils::Vector pivot, utils::Quaternion q, unsigned long excludeJointId, bool includeConnected=true)=0
 Rotates the specified node according to the provided quaternion. More...
 
virtual void positionNode (NodeId id, utils::Vector pos, unsigned long excludeJointId)=0
 Positions the node according to the provided vector. More...
 
virtual unsigned long getMaxGroupID ()=0
 
virtual void printNodeMasses (bool onlysum)=0
 
virtual void edit (NodeId id, const std::string &key, const std::string &value)=0
 Edit a node property by giving a key and value. More...
 

Detailed Description

"NodeManagerInterface" declares the interfaces for all NodeOperations that are used for the communication between the simulation modules.

Author
Malte Langosz, Lorenz Quack

Definition at line 59 of file NodeManagerInterface.h.

Constructor & Destructor Documentation

◆ ~NodeManagerInterface()

virtual mars::interfaces::NodeManagerInterface::~NodeManagerInterface ( )
inlinevirtual

Definition at line 61 of file NodeManagerInterface.h.

Member Function Documentation

◆ addNode() [1/2]

virtual NodeId mars::interfaces::NodeManagerInterface::addNode ( NodeData nodeS,
bool  reload = false,
bool  loadGraphics = true 
)
pure virtual

Add a node to the node pool of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
This method only adds the physical representation of a node. To add a node completely use the other addNode function!
Parameters
nodeSIs a pointer to the NodeData that defines the new node.

Generally the default value should be used.

Parameters
reloadThis param is used internally by the simulation. The default value is false. If this param is set to true the new node will not be reloaded by a reset of the simulation. But a simulation reset only destroys the physical representation of all nodes. Thus a node created with this param set to true will produce visual waste if the node is not removed manually before reseting the simulation.
Returns
The unique id of the newly added node is returned.

Implemented in mars::sim::NodeManager.

◆ addNode() [2/2]

virtual std::vector<NodeId> mars::interfaces::NodeManagerInterface::addNode ( std::vector< NodeData v_NodeData)
pure virtual

Add a vector of nodes to the node pool of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
This function is the right one to add a mesh to the simulation. To add a primitive node use i_NodeManager::addPrimitive!
Parameters
v_NodeDataIs a vector of NodeDatas that have to be added to the simulation. In this method, the addNode function above is called indirectly for every NodeData of the vector.
Returns
Returns a vector with the unique ids of the new added nodes.

Implemented in mars::sim::NodeManager.

◆ addNodeSensor()

virtual void mars::interfaces::NodeManagerInterface::addNodeSensor ( BaseNodeSensor sensor)
pure virtual

This function is used to add sensor to a node that need more specific physical implementations.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Right now, this method is used to add range sensors to the simulation by adding a necessary sensor configuration to a node.

Warning
This method is used internally by the simulation, more specific by some sensor implementations. This method don't have to be used elsewhere, normally.
See also
RaySensor RayGridSensor
Parameters
idThe id of the node to add a sensor.
s_cfgThe sensor configuration struct.
See also
sensor_config

Implemented in mars::sim::NodeManager.

◆ addPrimitive()

virtual NodeId mars::interfaces::NodeManagerInterface::addPrimitive ( NodeData snode)
pure virtual

Add a node of type primitive to the node pool of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
This function is the right one to add a primitive node to the simulation!
Parameters
snodeThe NodeData that defines the node to be added.
Returns
The unique id of the new added node is returned.

Implemented in mars::sim::NodeManager.

◆ addRotation()

virtual void mars::interfaces::NodeManagerInterface::addRotation ( NodeId  id,
const utils::Quaternion q 
)
pure virtual

Adds a additional rotation to the orientation of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to add the rotation.
qThe rotation to be added (see Quaternion).

Implemented in mars::sim::NodeManager.

◆ addTerrain()

virtual NodeId mars::interfaces::NodeManagerInterface::addTerrain ( terrainStruct terrainS)
pure virtual

Add a terrain node to the node pool of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
terrainSIs a pointer to the terrainStruct that defines the new terrain node.
Returns
The unique id of the new added node is returned.

Implemented in mars::sim::NodeManager.

◆ applyForce() [1/2]

virtual void mars::interfaces::NodeManagerInterface::applyForce ( NodeId  id,
const utils::Vector force,
const utils::Vector pos 
)
pure virtual

Applies a off-center force to a physical node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

This function applies forces to the simulation, which can produce instability if it is done with a high frequency.

Parameters
idThe id of the node to apply a force.
forceA Vector that defines the direction and the strength (length of the vector) of the force to be applied.
posThe force is applied to the given position.

Implemented in mars::sim::NodeManager.

◆ applyForce() [2/2]

virtual void mars::interfaces::NodeManagerInterface::applyForce ( NodeId  id,
const utils::Vector force 
)
pure virtual

Applies a force to a physical node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

This function applies forces to the simulation, which can produce instability if it is done with a high frequency.

Parameters
idThe id of the node to apply a force.
forceA Vector that defines the direction and the strength (length of the vector) of the force to be applied.

Implemented in mars::sim::NodeManager.

◆ applyTorque()

virtual void mars::interfaces::NodeManagerInterface::applyTorque ( NodeId  id,
const utils::Vector torque 
)
pure virtual

Applies a torque to a physical node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

This function applies forces to the simulation, which can produce instability if it is done with a high frequency.

Parameters
idThe id of the node to apply a torque.
forceA Vector that defines the axis and the strength (length of the vector) of the torque to be applied. The torque will be applied at. the center of mass of the node.

Implemented in mars::sim::NodeManager.

◆ changeGroup()

virtual void mars::interfaces::NodeManagerInterface::changeGroup ( NodeId  id,
int  group 
)
pure virtual

This function is not implemented yet.

To change a group of a node it has to be removed and added again with a new group_id.

Implemented in mars::sim::NodeManager.

◆ clearAllNodes()

virtual void mars::interfaces::NodeManagerInterface::clearAllNodes ( bool  clear_all = false,
bool  clearGraphics = true 
)
pure virtual

This function destroys all nodes within the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
This method don't destroys the visual object, nor the joints of the simulation. To clear the whole world call i_GuiToSim::newWorld. But also that function don't clears the visual nodes right now.
See also
i_GuiToSim::newWorld

Implemented in mars::sim::NodeManager.

◆ createPrimitiveNode()

virtual NodeId mars::interfaces::NodeManagerInterface::createPrimitiveNode ( const std::string &  name,
NodeType  type,
bool  movable = false,
const utils::Vector pos = utils::Vector::Zero(),
const utils::Vector extension = utils::Vector::Identity(),
double  mass = 0,
const utils::Quaternion orientation = utils::Quaternion::Identity(),
bool  disablePhysics = false 
)
pure virtual

Implemented in mars::sim::NodeManager.

◆ edit()

virtual void mars::interfaces::NodeManagerInterface::edit ( NodeId  id,
const std::string &  key,
const std::string &  value 
)
pure virtual

Edit a node property by giving a key and value.

Parameters
idThe id of the node to be edit.
keyDefines the key in the ConfigMap. Could also include the path, in the end pattern matching is used.
valueString containing the value.

Implemented in mars::sim::NodeManager.

◆ editNode()

virtual void mars::interfaces::NodeManagerInterface::editNode ( NodeData nodeS,
int  changes 
)
pure virtual

This function supports the possibility to change some properties of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
nodeSThe NodeData refereed by this pointer have to store the node_id of the node to edit and the properties that have to be changed. Which properties have to be changed is given by the next param.
changesThis parameter defines what properties of the node have to be edited. Possible options are:
  • EDIT_NODE_POS
  • EDIT_NODE_ROT
  • EDIT_NODE_MOVE_ALL
  • EDIT_NODE_SIZE
  • EDIT_NODE_TYPE
  • EDIT_NODE_MASS

Implemented in mars::sim::NodeManager.

◆ exists()

virtual bool mars::interfaces::NodeManagerInterface::exists ( NodeId  id) const
pure virtual

Returns true, if the node with the given id exists.

Parameters
idThe id of the node to look for.
Returns
Whether the node exists.

Implemented in mars::sim::NodeManager.

◆ exportGraphicNodesByID()

virtual void mars::interfaces::NodeManagerInterface::exportGraphicNodesByID ( const std::string &  folder) const
pure virtual

If a graphicsManager is loaded, exports the graphical models of all nodes.

Every node is exported by its id to a seperated file into the given folder.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
folderThe folder where to exort the models.

Implemented in mars::sim::NodeManager.

◆ getAngularAcceleration()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::getAngularAcceleration ( NodeId  id) const
pure virtual

Gets the current angular/rotational acceleration of a node.

Parameters
idThe id of the node to get the angular/rotational acceleration from.
Returns
The angular/rotational acceleration of the node.

Implemented in mars::sim::NodeManager.

◆ getAngularVelocity()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::getAngularVelocity ( NodeId  id) const
pure virtual

Gets the current angular velocity of a node.

Parameters
idThe id of the node to get the angular/rotational velocity from.
Returns
The angular/rotational velocity of the node.

Implemented in mars::sim::NodeManager.

◆ getCenterOfMass()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::getCenterOfMass ( const std::vector< NodeId > &  ids) const
pure virtual

Gives the center of mass of a set of nodes.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idsThis vector defines the ids of the nodes that will be included into the calculation of the center of mass.
Returns
A Vector representing the center of mass for the specified ids is returned.

Implemented in mars::sim::NodeManager.

◆ getCollisionDepth()

virtual double mars::interfaces::NodeManagerInterface::getCollisionDepth ( NodeId  id) const
pure virtual

Implemented in mars::sim::NodeManager.

◆ getConnectedNodes()

virtual std::vector<NodeId> mars::interfaces::NodeManagerInterface::getConnectedNodes ( NodeId  id)
pure virtual

Implemented in mars::sim::NodeManager.

◆ getContactForce()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::getContactForce ( NodeId  id) const
pure virtual

Implemented in mars::sim::NodeManager.

◆ getContactParams()

virtual const contact_params mars::interfaces::NodeManagerInterface::getContactParams ( NodeId  id) const
pure virtual

Returns the contact properties of a certain node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to get the contact properties from.
Returns
A contact parameter struct which stores the contact properties.
See also
contact_params

Implemented in mars::sim::NodeManager.

◆ getContactPoints()

virtual void mars::interfaces::NodeManagerInterface::getContactPoints ( std::vector< NodeId > *  ids,
std::vector< utils::Vector > *  contact_points 
) const
pure virtual

Implemented in mars::sim::NodeManager.

◆ getDataBrokerNames()

virtual bool mars::interfaces::NodeManagerInterface::getDataBrokerNames ( NodeId  id,
std::string *  groupName,
std::string *  dataName 
) const
pure virtual

Retrieves the groupName and dataName under which the node with the specified id publishes its data in the DataBroker.

Returns
true if the names were successfully retrieved. false if no node with the given id exists.

Implemented in mars::sim::NodeManager.

◆ getDrawID()

virtual NodeId mars::interfaces::NodeManagerInterface::getDrawID ( NodeId  id) const
pure virtual

Implemented in mars::sim::NodeManager.

◆ getFullNode()

virtual const NodeData mars::interfaces::NodeManagerInterface::getFullNode ( NodeId  id) const
pure virtual

Gives all information of a certain node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe unique id of the node to get information from.
Returns
A copy of the NodeData of the node with the given id.

Implemented in mars::sim::NodeManager.

◆ getID()

virtual NodeId mars::interfaces::NodeManagerInterface::getID ( const std::string &  node_name) const
pure virtual

Retrieve the id of a node by name.

Parameters
node_nameName of the node to get the id for
Returns
Id of the node if it exists, otherwise 0

Implemented in mars::sim::NodeManager.

◆ getIsMovable()

virtual bool mars::interfaces::NodeManagerInterface::getIsMovable ( NodeId  id) const
pure virtual

Implemented in mars::sim::NodeManager.

◆ getLinearAcceleration()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::getLinearAcceleration ( NodeId  id) const
pure virtual

Gets the current linear acceleration of a node.

Parameters
idThe id of the node to get the acceleration from.
Returns
The linear acceleration of the node.

Implemented in mars::sim::NodeManager.

◆ getLinearVelocity()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::getLinearVelocity ( NodeId  id) const
pure virtual

Gets the current linear velocity of a node.

Parameters
idThe id of the node to get the velocity from.
Returns
The linear velocity of the node.

Implemented in mars::sim::NodeManager.

◆ getListNodes()

virtual void mars::interfaces::NodeManagerInterface::getListNodes ( std::vector< core_objects_exchange > *  nodeList) const
pure virtual

Gives information about core exchange data for nodes.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
nodeListA pointer to a vector that is filled with a core_objects_exchange struct for every node. The vector is cleared in the beginning of this function.

Implemented in mars::sim::NodeManager.

◆ getMaxGroupID()

virtual unsigned long mars::interfaces::NodeManagerInterface::getMaxGroupID ( )
pure virtual

Implemented in mars::sim::NodeManager.

◆ getNextNodeID()

virtual NodeId mars::interfaces::NodeManagerInterface::getNextNodeID ( ) const
pure virtual

Returns the ID for the next node which will be added to the simulation.

It is very important to assure the serializaion between the threads to have the desired results. This function should be thread save.

Returns
The ID for the next inserted node is returned.

Implemented in mars::sim::NodeManager.

◆ getNodeCount()

virtual int mars::interfaces::NodeManagerInterface::getNodeCount ( ) const
pure virtual

Returns the number of nodes that are added to the simulation.

It is very important to assure the serializaion between the threads to have the desired results. This function should be thread save.

Returns
The number of all added nodes is returned.

Implemented in mars::sim::NodeManager.

◆ getNodeExchange()

virtual void mars::interfaces::NodeManagerInterface::getNodeExchange ( NodeId  id,
core_objects_exchange obj 
) const
pure virtual

Gives information about core exchange data for a certain node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe unique id of the node to get information from.
objA pointer to a core_objects_exchange struct that will be filled with a the core exchange data of the node with the given id.
See also
i_SimLog

Implemented in mars::sim::NodeManager.

◆ getNodeMass()

virtual void mars::interfaces::NodeManagerInterface::getNodeMass ( NodeId  id,
sReal mass,
sReal inertia = 0 
) const
pure virtual

Returns the mass and inertia of a certain node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to get the mass information from.
massA pointer to the sReal variable, where the mass will be stored.
inertiaA pointer to a sReal array with a dimension of 9. If the pointer is unequal 0, the inertia information will be stored in this array.

Implemented in mars::sim::NodeManager.

◆ getNodeState()

virtual void mars::interfaces::NodeManagerInterface::getNodeState ( NodeId  id,
nodeState state 
) const
pure virtual

Implemented in mars::sim::NodeManager.

◆ getPosition()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::getPosition ( NodeId  id) const
pure virtual

Returns the current position of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to get the position from.
Returns
The position of the node is returned.

Implemented in mars::sim::NodeManager.

◆ getRotation()

virtual const utils::Quaternion mars::interfaces::NodeManagerInterface::getRotation ( NodeId  id) const
pure virtual

Returns the current orientation of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to get the orientation from.
Returns
The orientation of the node is returned.

Implemented in mars::sim::NodeManager.

◆ getSimNode() [1/2]

virtual sim::SimNode* mars::interfaces::NodeManagerInterface::getSimNode ( NodeId  id)
pure virtual

This function returns the SimNode object for a given id.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
This method is only internal used by the JointManager. Generally no other modules know the SimNode class and shouldn't use this method. All node operations from outside the core should be done over the NodeManager.
Parameters
idThe id of the node to get the core node object.
Returns
Returns a pointer to the corresponding node object.

Implemented in mars::sim::NodeManager.

◆ getSimNode() [2/2]

virtual const sim::SimNode* mars::interfaces::NodeManagerInterface::getSimNode ( NodeId  id) const
pure virtual

Implemented in mars::sim::NodeManager.

◆ lock()

virtual void mars::interfaces::NodeManagerInterface::lock ( )
pure virtual

Implemented in mars::sim::NodeManager.

◆ positionNode()

virtual void mars::interfaces::NodeManagerInterface::positionNode ( NodeId  id,
utils::Vector  pos,
unsigned long  excludeJointId 
)
pure virtual

Positions the node according to the provided vector.

Parameters
idThe id of the node to be moved.
posThe utils::Vector defining the new position of the node.
excludeJointId?

Implemented in mars::sim::NodeManager.

◆ printNodeMasses()

virtual void mars::interfaces::NodeManagerInterface::printNodeMasses ( bool  onlysum)
pure virtual

Implemented in mars::sim::NodeManager.

◆ reloadNodes()

virtual void mars::interfaces::NodeManagerInterface::reloadNodes ( bool  reloadGraphics)
pure virtual

This function reloads all node from a temporally NodeData pool.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
This method should only be used internally. This function don't removes any nodes, before calling this function i_NodeManager::clearAllNodes should be executed. To reload the simulation the function i_GuiToSim::spotReload should be used.
See also
i_GuiToSim::spotReload

Implemented in mars::sim::NodeManager.

◆ reloadNodeSensor()

virtual void mars::interfaces::NodeManagerInterface::reloadNodeSensor ( BaseNodeSensor sensor)
pure virtual

This function resets a added sensor by removing it and add a new defined by the sensor config struct.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

This method is implemented for a special case where the distance sensors have to be reconfigured. Don't know if it's used right now (maybe in the A3 project).

Parameters
idThe id of the node to reload a sensor.
s_cfgThe sensor configuration struct.
See also
sensor_config

Implemented in mars::sim::NodeManager.

◆ removeNode()

virtual void mars::interfaces::NodeManagerInterface::removeNode ( NodeId  id,
bool  clearGraphics = true 
)
pure virtual

Removes a node from the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
Currently this function only removes the physical representation of a node. To remove a node completely use MainWindowInterface::removeNode() instead.
Parameters
idThe unique id of the node to remove form the simulation.

Implemented in mars::sim::NodeManager.

◆ rotateNode()

virtual void mars::interfaces::NodeManagerInterface::rotateNode ( NodeId  id,
utils::Vector  pivot,
utils::Quaternion  q,
unsigned long  excludeJointId,
bool  includeConnected = true 
)
pure virtual

Rotates the specified node according to the provided quaternion.

Parameters
idThe id of the node to be rotated.
pivotThe utils::Vector defining the pivot point around which to rotate.
qThe utils::Quaternion defining the rotation vector and angle.
excludeJointId?

Implemented in mars::sim::NodeManager.

◆ scaleReloadNodes()

virtual void mars::interfaces::NodeManagerInterface::scaleReloadNodes ( sReal  x,
sReal  y,
sReal  z 
)
pure virtual

Scales the size of all node after a reset of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
factorThe scaling factor for the size of the nodes.

Implemented in mars::sim::NodeManager.

◆ setAngularDamping()

virtual void mars::interfaces::NodeManagerInterface::setAngularDamping ( NodeId  id,
sReal  damping 
)
pure virtual

Sets a angular damping factor to the node dynamics.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to add the angular damping.
dampingFactor to multiply with the velocity of the node after every simulation step. The value should be between 0 and 1, while 0 means no damping and 1 the maximum damping. $ angular\_velocity = angular\_velocity * (1-damping)$

Implemented in mars::sim::NodeManager.

◆ setAngularVelocity()

virtual void mars::interfaces::NodeManagerInterface::setAngularVelocity ( NodeId  id,
const utils::Vector vel 
)
pure virtual

Sets the angular velocity of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
velThe new angular velocity of the node. The vector describes the axis of the rotation and the angular velocity (length of the vector).

Implemented in mars::sim::NodeManager.

◆ setContactParamMotion1()

virtual void mars::interfaces::NodeManagerInterface::setContactParamMotion1 ( NodeId  id,
sReal  motion 
)
pure virtual

Sets a specific contact parameter; the motion of the contact.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

This contact parameter must be enabled by the contact_params of the node first. If it is enabled, it can be used to simulate effects like a convener belt.

See also
contact_params
Parameters
idThe id of the node to set the motion contact parameter.
motionThe velocity to set for the contact motion.

Implemented in mars::sim::NodeManager.

◆ setContactParams()

virtual void mars::interfaces::NodeManagerInterface::setContactParams ( NodeId  id,
const contact_params cp 
)
pure virtual

Sets the contact properties of the node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
posThe contact parameter struct. For detailed information see contact_params.
See also
contact_params

Implemented in mars::sim::NodeManager.

◆ setIsMovable()

virtual void mars::interfaces::NodeManagerInterface::setIsMovable ( NodeId  id,
bool  isMovable 
)
pure virtual

Implemented in mars::sim::NodeManager.

◆ setNodeState()

virtual void mars::interfaces::NodeManagerInterface::setNodeState ( NodeId  id,
const nodeState state 
)
pure virtual

Set a state of a node.

This function is not fully implemented

yet ##

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
stateThe new state of the node. Currently the angular and linear velocity of the state is applied to the node.
See also
nodeState

Implemented in mars::sim::NodeManager.

◆ setPosition()

virtual void mars::interfaces::NodeManagerInterface::setPosition ( NodeId  id,
const utils::Vector pos 
)
pure virtual

Sets the current position of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
posThe new position of the node.

Implemented in mars::sim::NodeManager.

◆ setReloadAngle()

virtual void mars::interfaces::NodeManagerInterface::setReloadAngle ( NodeId  id,
const utils::sRotation angle 
)
pure virtual

Sets the new orientation of a node after a reset of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
angleThe new orientation given in euler angles.

Implemented in mars::sim::NodeManager.

◆ setReloadExtent()

virtual const utils::Vector mars::interfaces::NodeManagerInterface::setReloadExtent ( NodeId  id,
const utils::Vector ext 
)
pure virtual

Sets the new size of a node after a reset of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
extThe new size of the node. For more information of how the vector is interpreted by the simulation see NodeData::ext.
Returns
A Vector with the ratio of the old and the new size for every dimension.

Implemented in mars::sim::NodeManager.

◆ setReloadFriction()

virtual void mars::interfaces::NodeManagerInterface::setReloadFriction ( NodeId  id,
sReal  friction1,
sReal  friction2 
)
pure virtual

Sets the new contact friction of a node after a reset of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
friction1The new contact friction coefficient for the first friction direction.
friction2The new contact friction coefficient for the second friction direction.
See also
contact_params

Implemented in mars::sim::NodeManager.

◆ setReloadPosition()

virtual void mars::interfaces::NodeManagerInterface::setReloadPosition ( NodeId  id,
const utils::Vector pos 
)
pure virtual

Sets the new position of a node after a reset of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
posThe new position of the node.

Implemented in mars::sim::NodeManager.

◆ setReloadQuaternion()

virtual void mars::interfaces::NodeManagerInterface::setReloadQuaternion ( NodeId  id,
const utils::Quaternion q 
)
pure virtual

Sets the new orientation of a node after a reset of the simulation.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
qThe new orientation given as quaternion.

Implemented in mars::sim::NodeManager.

◆ setRotation()

virtual void mars::interfaces::NodeManagerInterface::setRotation ( NodeId  id,
const utils::Quaternion rot 
)
pure virtual

Sets the current orientation of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
rotThe new orientation of the node.

Implemented in mars::sim::NodeManager.

◆ setVelocity()

virtual void mars::interfaces::NodeManagerInterface::setVelocity ( NodeId  id,
const utils::Vector vel 
)
pure virtual

Sets the linear velocity of a node.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Parameters
idThe id of the node to edit.
velThe new linear velocity of the node. The vector describes the direction and the velocity (length of the vector).

Implemented in mars::sim::NodeManager.

◆ setVisualQOffset()

virtual void mars::interfaces::NodeManagerInterface::setVisualQOffset ( NodeId  id,
const utils::Quaternion q 
)
pure virtual

Implemented in mars::sim::NodeManager.

◆ setVisualRep()

virtual void mars::interfaces::NodeManagerInterface::setVisualRep ( NodeId  id,
int  val 
)
pure virtual

Implemented in mars::sim::NodeManager.

◆ unlock()

virtual void mars::interfaces::NodeManagerInterface::unlock ( )
pure virtual

Implemented in mars::sim::NodeManager.

◆ updateDynamicNodes()

virtual void mars::interfaces::NodeManagerInterface::updateDynamicNodes ( sReal  calc_ms,
bool  physics_thread = true 
)
pure virtual

Updates the node values of dynamic nodes from the physics.

It is very important to assure the serialization between the threads to have the desired results. Currently the verified use of this function is only guaranteed by calling it within the main thread (update callback from gui_thread).

Warning
This method is called after each simulation step and don't have to be used in other cases, generally.

Implemented in mars::sim::NodeManager.

◆ updatePR()

virtual void mars::interfaces::NodeManagerInterface::updatePR ( unsigned long  id,
const utils::Vector pos,
const utils::Quaternion rot,
const utils::Vector visOffsetPos,
const utils::Quaternion visOffsetRot,
bool  doLock = true 
)
pure virtual

Implemented in mars::sim::NodeManager.

◆ updateRay()

virtual void mars::interfaces::NodeManagerInterface::updateRay ( NodeId  id)
pure virtual

Implemented in mars::sim::NodeManager.


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