![]() |
An open-source, flexible 3D physical simulation framework
|
The declaration of the JointManager class. More...
#include <JointManager.h>
Public Member Functions | |
JointManager (interfaces::ControlCenter *c) | |
Initialization of a new JointManager. More... | |
virtual | ~JointManager () |
virtual unsigned long | addJoint (interfaces::JointData *jointS, bool reload=false) |
Add a joint to the joint pool of the simulation. More... | |
virtual int | getJointCount () |
Returns the number of joints added to the simulation. More... | |
virtual void | editJoint (interfaces::JointData *jointS) |
Change a Joint. More... | |
virtual void | getListJoints (std::vector< interfaces::core_objects_exchange > *jointList) |
Fills a list of core_object_exchange objects with joint informations. More... | |
virtual void | getJointExchange (unsigned long id, interfaces::core_objects_exchange *obj) |
Fills one core_object_exchange object with joint information of the joint with the given id. More... | |
virtual const interfaces::JointData | getFullJoint (unsigned long index) |
get the full struct of a joint for editing purposes. More... | |
virtual void | removeJoint (unsigned long index) |
Removes the joint with the given id. More... | |
virtual void | removeJointByIDs (unsigned long id1, unsigned long id2) |
removes the joint connecting the two nodes with the given ids More... | |
virtual SimJoint * | getSimJoint (unsigned long id) |
Returns a pointer to the SimJoint Object. More... | |
virtual std::vector< SimJoint * > | getSimJoints (void) |
Return a copy of the SimJointVector;. More... | |
virtual void | reattacheJoints (unsigned long node_id) |
Reattaches the joints that are connected to the node with id node_id. More... | |
virtual void | reloadJoints (void) |
Reloads all joints in the simulation. More... | |
virtual void | updateJoints (interfaces::sReal calc_ms) |
Update the Joint values from the physics. More... | |
virtual void | clearAllJoints (bool clear_all=false) |
Removes all joints from the simulation to clear the world. More... | |
virtual void | setReloadJointOffset (unsigned long id, interfaces::sReal offset) |
Set a new joint offset for reloading a joint. More... | |
virtual void | setReloadJointAxis (unsigned long id, const utils::Vector &axis) |
Set a new axis for reloading a joint. More... | |
virtual void | scaleReloadJoints (interfaces::sReal x, interfaces::sReal y, interfaces::sReal z) |
virtual void | setJointTorque (unsigned long id, interfaces::sReal torque) |
virtual void | changeStepSize (void) |
virtual void | setReloadAnchor (unsigned long id, const utils::Vector &anchor) |
virtual void | setSDParams (unsigned long id, interfaces::JointData *sJoint) |
virtual void | setVelocity (unsigned long id, interfaces::sReal velocity) |
sets the velocity of the first axis of the joint More... | |
virtual void | setVelocity2 (unsigned long id, interfaces::sReal velocity) |
sets the velocity of the second axis of the joint More... | |
virtual void | setForceLimit (unsigned long id, interfaces::sReal max_force, bool first_axis=1) |
virtual unsigned long | getID (const std::string &joint_name) const |
Retrieve the id of a joint by name. More... | |
virtual bool | getDataBrokerNames (unsigned long id, std::string *groupName, std::string *dataName) const |
Retrieves the groupName and dataName under which the joint with the specified id publishes its data in the DataBroker. More... | |
virtual void | setOfflineValue (unsigned long id, interfaces::sReal value) |
virtual interfaces::sReal | getLowStop (unsigned long id) const |
virtual interfaces::sReal | getHighStop (unsigned long id) const |
virtual interfaces::sReal | getLowStop2 (unsigned long id) const |
virtual interfaces::sReal | getHighStop2 (unsigned long id) const |
virtual void | setLowStop (unsigned long id, interfaces::sReal lowStop) |
virtual void | setHighStop (unsigned long id, interfaces::sReal highStop) |
virtual void | setLowStop2 (unsigned long id, interfaces::sReal lowStop2) |
virtual void | setHighStop2 (unsigned long id, interfaces::sReal highStop2) |
virtual void | edit (interfaces::JointId id, const std::string &key, const std::string &value) |
![]() | |
virtual | ~JointManagerInterface () |
Private Member Functions | |
interfaces::JointManagerInterface * | getJointInterface (unsigned long node_id) |
std::list< interfaces::JointData >::iterator | getReloadJoint (unsigned long id) |
Private Attributes | |
unsigned long | next_joint_id |
std::map< unsigned long, SimJoint * > | simJoints |
std::list< interfaces::JointData > | simJointsReload |
interfaces::ControlCenter * | control |
utils::Mutex | iMutex |
The declaration of the JointManager class.
Definition at line 48 of file JointManager.h.
mars::sim::JointManager::JointManager | ( | interfaces::ControlCenter * | c | ) |
Initialization of a new JointManager.
pre:
Definition at line 61 of file JointManager.cpp.
|
inlinevirtual |
Definition at line 51 of file JointManager.h.
|
virtual |
Add a joint to the joint pool of the simulation.
It is very important to assure the serialization between the threads to have the desired results.
pre:
Implements mars::interfaces::JointManagerInterface.
Definition at line 66 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 326 of file JointManager.cpp.
|
virtual |
Removes all joints from the simulation to clear the world.
Implements mars::interfaces::JointManagerInterface.
Definition at line 268 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 466 of file JointManager.cpp.
|
virtual |
Change a Joint.
The simulation must be updated in here.
Implements mars::interfaces::JointManagerInterface.
Definition at line 141 of file JointManager.cpp.
|
virtual |
Retrieves the groupName and dataName under which the joint with the specified id publishes its data in the DataBroker.
true
if the names were successfully retrieved. false
if no joint with the given id exists. Implements mars::interfaces::JointManagerInterface.
Definition at line 390 of file JointManager.cpp.
|
virtual |
get the full struct of a joint for editing purposes.
std::runtime_error | if the joint cannot be found |
Implements mars::interfaces::JointManagerInterface.
Definition at line 177 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 415 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 429 of file JointManager.cpp.
|
virtual |
Retrieve the id of a joint by name.
joint_name | Name of the joint to get the id for |
Implements mars::interfaces::JointManagerInterface.
Definition at line 379 of file JointManager.cpp.
|
virtual |
Returns the number of joints added to the simulation.
Implements mars::interfaces::JointManagerInterface.
Definition at line 136 of file JointManager.cpp.
|
virtual |
Fills one core_object_exchange object with joint information of the joint with the given id.
Implements mars::interfaces::JointManagerInterface.
Definition at line 166 of file JointManager.cpp.
|
private |
|
virtual |
Fills a list of core_object_exchange objects with joint informations.
Implements mars::interfaces::JointManagerInterface.
Definition at line 155 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 408 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 422 of file JointManager.cpp.
|
private |
Definition at line 283 of file JointManager.cpp.
|
virtual |
Returns a pointer to the SimJoint Object.
Implements mars::interfaces::JointManagerInterface.
Definition at line 222 of file JointManager.cpp.
|
virtual |
Return a copy of the SimJointVector;.
Implements mars::interfaces::JointManagerInterface.
Definition at line 232 of file JointManager.cpp.
|
virtual |
Reattaches the joints that are connected to the node with id node_id.
Implements mars::interfaces::JointManagerInterface.
Definition at line 242 of file JointManager.cpp.
|
virtual |
Reloads all joints in the simulation.
Implements mars::interfaces::JointManagerInterface.
Definition at line 253 of file JointManager.cpp.
|
virtual |
Removes the joint with the given id.
Implements mars::interfaces::JointManagerInterface.
Definition at line 189 of file JointManager.cpp.
|
virtual |
removes the joint connecting the two nodes with the given ids
id1 | the id of one of the nodes attached to the joint to be removed |
id2 | the id of the other node attached to the joint to be removed |
Implements mars::interfaces::JointManagerInterface.
Definition at line 206 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 306 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 366 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 443 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 457 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 318 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 436 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 450 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 400 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 334 of file JointManager.cpp.
|
virtual |
Set a new axis for reloading a joint.
Implements mars::interfaces::JointManagerInterface.
Definition at line 298 of file JointManager.cpp.
|
virtual |
Set a new joint offset for reloading a joint.
Implements mars::interfaces::JointManagerInterface.
Definition at line 291 of file JointManager.cpp.
|
virtual |
Implements mars::interfaces::JointManagerInterface.
Definition at line 342 of file JointManager.cpp.
|
virtual |
sets the velocity of the first axis of the joint
id | the id of the joint whos velocity should be set |
the | new velocity |
Implements mars::interfaces::JointManagerInterface.
Definition at line 350 of file JointManager.cpp.
|
virtual |
sets the velocity of the second axis of the joint
id | the id of the joint whos velocity should be set |
the | new velocity If the joint has no second axis the behaviour is undefined. |
Implements mars::interfaces::JointManagerInterface.
Definition at line 358 of file JointManager.cpp.
|
virtual |
Update the Joint values from the physics.
Implements mars::interfaces::JointManagerInterface.
Definition at line 260 of file JointManager.cpp.
|
private |
Definition at line 99 of file JointManager.h.
|
mutableprivate |
Definition at line 100 of file JointManager.h.
|
private |
Definition at line 96 of file JointManager.h.
|
private |
Definition at line 97 of file JointManager.h.
|
private |
Definition at line 98 of file JointManager.h.