#include <prmTransformationManager.h>
Inheritance diagram for prmTransformationManager:


setup joints transformation vctFrm3 setupPos; setupPos.Translation() = vct3(10.0, 4.0, 3.0); prmTransformationFixed setupFrame("Setup frame", setupPos);
robot transformation prmTransformationDynamic robotFrame("Robot frame", setupFrame, robot.GetCommandRead("GetTipPosition"));
add a camera defined in world frame vctFrm3 cameraPos; cameraPos.Translation() = vct3(-10.0, 3.4, 5.34); vctRandom(cameraPos.Rotation()); // artificial move! prmTransformationFixed cameraFrame("Camera frame", cameraPos);
Get the position of the camera wrt to the robot std::cout << prmWRTReference(cameraFrame, robotFrame) << std::endl;
Compute the robot motion wrt its base so that the tip moves in the x direction of the camera. vctFrm3 moveWRTCamera; PositionCartesianArg goalArgs;
move.Translation() = vct3(1.0, 0.0, 0.0); vctFrm3 moveWRTRobot = prmWRTReference(cameraFrame, setupFrame) * move; goalArgs.SetGoal(moveWRTRobot); myRobot.MovePositionCart(goalArgs);
Definition at line 80 of file prmTransformationManager.h.
| static bool prmTransformationManager::Attach | ( | const prmTransformationBasePtr & | attachPoint, | |
| const prmTransformationBasePtr & | newFrame | |||
| ) | [static, protected] |
Add the frame to the tree in the transformation manager. This method is private and can only be accessed by the "friend" class prmTransformationBase.
| attachPoint | prmTransformationBasePtr pointer to the new frame | |
| newFrame | prmTransformationBasePtr pointer to parent in the tree |
| static bool prmTransformationManager::Detach | ( | const prmTransformationBasePtr & | frame | ) | [static, protected] |
Remove the frame from the tree Internally calls ReplaceReference(frame, theWorld).
| frame | prmTransformationBase* pointer to the frame to be discarded. |
| static void prmTransformationManager::Clear | ( | ) | [static] |
A method to clean up a transformation tree. Deletes all nodes and restores clean state. This should never need to be used as every node should attach or detach itself. It is primarily meant for testing and debugging purposes.
| static bool prmTransformationManager::NodeCreatesCycle | ( | const prmTransformationBasePtr & | attachPoint, | |
| const prmTransformationBasePtr & | newFrame | |||
| ) | [static] |
Test if attaching a reference frame at a particular node will introduce a circular dependency. The implementation is a simple depth first search, that returns true if a node is revisited more than once.
| attachPoint | prmTransformationBasePr new parent | |
| newFrame | prmTransformationBasePtr candidate frame |
| static vctFrm3 prmTransformationManager::WRTReference | ( | const prmTransformationBasePtr & | tipFrame, | |
| const prmTransformationBasePtr & | refFrame | |||
| ) | [static] |
Compute the transformation between two frames (WRT = With Respect To). The computation will use registered get mtsCommandRead methods for the nodes on the path from node refFrame to node tipFrame. The implementation is a breadth first search from refFrame to tipFrame.
| tipFrame | prmTransformationBasePtr the frame transform to be computed | |
| refFrame | prmTransformationBasePtr the reference frame chosen |
Referenced by prmWRTReference(), and prmWRTWorld().
| static unsigned int prmTransformationManager::ReplaceReference | ( | const prmTransformationBasePtr & | nodePtr, | |
| const prmTransformationBasePtr & | newReference | |||
| ) | [static] |
Update all frames using a given frame as reference.
May be useful before a call to prmTransformationManager::Detach or its equivalent prmTransformationBase::~prmTransformationBase
| currentReference | prmTransformationBase* old Reference frame | |
| newReference | prmTransformationBase* new Reference frame |
| static void prmTransformationManager::ToStreamDot | ( | std::ostream & | outputStream | ) | [static] |
Print the tree to a graphviz dot file
If you have graphviz then "dot -Tjpg -o tree.jpg tree.dot" where tree.dot is the output of this function will print a tree representation of the transformation tree.
| outputStream | std::ostream stream to dump dot file |
| static void prmTransformationManager::ToStreamDotHelper | ( | std::ostream & | outputStream, | |
| prmTransformationBasePtr | parent | |||
| ) | [static] |
Helper function for printing the tree to a graphviz dot file
| static bool prmTransformationManager::FindPath | ( | const prmTransformationBasePtr & | target, | |
| const prmTransformationBasePtr & | reference | |||
| ) | [static] |
Helper function for computing transformations. Traverses the tree and stores the path between target and reference in path
| static bool prmTransformationManager::FindPathConnectedTree | ( | const prmTransformationBasePtr & | target, | |
| const prmTransformationBasePtr & | reference | |||
| ) | [static] |
Helper function for computing transformations. In contrast to above, this assumes a path exists and only merges two traversals from target/reference to tree root
| static prmTransformationBasePtr prmTransformationManager::GetTransformationNodePtr | ( | const std::string | pName | ) | [static] |
Helper function for attaching with names
Referenced by prmWRTReference().
| static void prmTransformationManager::PathToStreamDot | ( | std::ostream & | outputStream | ) | [static] |
Print the path for last reference computation to a graphviz dot file
NodeListType prmTransformationManager::Path [static, protected] |
List of modes on the last transformation computed.
Definition at line 90 of file prmTransformationManager.h.
NodeListType prmTransformationManager::VisitedNodes [static, protected] |
Tree traversal helper
Definition at line 92 of file prmTransformationManager.h.
Frame used as reference for all other frames, root of the tree. All other frames are attached/detached by application code.
Definition at line 118 of file prmTransformationManager.h.
Referenced by prmWRTWorld().