Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
Kinematics Class Reference#include <Kinematics.h>
Inheritance diagram for Kinematics:
![]() Detailed DescriptionProvides access to the mathematical functionality of the ROBOOP package using Tekkotsu data structures.You should read the Kinematics tutorial to get a general understanding of the math involved and diagrams for usage with supported robots. This class involves all aspects of the forward kinematics: calculations concerning locations and orientations in space given a known set of joint configurations. There is a global instantiation of Kinematics named kine, which can be used to perform these calculations regarding the joint positions currently in state. To perform kinematics on a hypothetical set of joint values, use PostureEngine or one of its subclasses. PostureEngine also adds inverse kinematic functions, which will allow you to determine joint angles in order to reach a given point. The underlying ROBOOP library does not currently handle branching kinematic chains - in other words, each limb of the robot is a separate ROBOOP::Robot as far as ROBOOP is concerned. This Kinematics class interfaces the Tekkotsu array index approach to referencing joints with ROBOOP's chain based hierarchy. Thus, wherever a reference frame index is requested, you can simply supply one of the output indexes in the usual manner:
However, there are also a number of points on the body which are not joints, but should have their own reference frames, such as the base frame, or the camera. These frames have their own indices, listed in the robot info file for the model in question (such as ERS7Info.h), with names ending in Since newmat matrix library is used by ROBOOP, you will need to pass and receive information in newmat matrices. Kinematics class provides static pack and unpack functions which can convert individual x,y,z variables into a NEWMAT::ColumnVector, and vice versa. However, for readability of your code and long-term ease of use, we recommend embracing the newmat data structures directly when appropriate. // Find the ray from the camera to whatever the near-field IR is hitting: NEWMAT::Matrix T = kine->jointToJoint(NearIRFrameOffset,CameraFrameOffset); NEWMAT::ColumnVector camera_ray = T*Kinematics::pack(0,0,state->sensors[NearIRDistOffset]); float x,y; // x and y will be in the range -1 to 1 for resolution layer independence config->vision.computePixel(camera_ray(1),camera_ray(2),camera_ray(3),x,y); Finally, for each model we have created a database of "interest points" -- locations of notable interest on the body of the robot. These may be of use to people attempting to use the limbs to manipulate objects. To access these interest points, call either getLinkInterestPoint or getJointInterestPoint with the name of the interest point, obtained from the diagrams. Note that you can pass a comma separated list of interest point names and the result will be the midpoint of those interest points: kine->getLinkInterestPoint(BaseFrameOffset,"LowerInnerFrontLFrShin,LowerOuterFrontLFrShin");
Configuration File FormatThe file is actually read by ROBOOP::Config, and thus the syntax of the file is defined by that class. However, Tekkotsu will look for some additional sections beyond what is expected by ROBOOP.
In any give link section, a
Additionally, Kinematics will look for an custom
Each
Definition at line 115 of file Kinematics.h.
Member Typedef Documentation
we'll be using the hash_map to store named interest points
Definition at line 380 of file Kinematics.h.
Constructor & Destructor Documentation
Constructor, pass the full path to the kinematics configuration file.
Definition at line 118 of file Kinematics.h.
Copy constructor, everything is either update-before-use or static, copy is normal init.
Definition at line 126 of file Kinematics.h.
Member Function Documentation
Assignment operator, everything is either update-before-use or static, assignment is no-op.
Definition at line 134 of file Kinematics.h. Referenced by PostureEngine::operator=().
Returns a matrix for transforming from link frame j to base frame.
Definition at line 169 of file Kinematics.cc.
Returns a matrix for transforming from joint frame j to base frame.
Definition at line 154 of file Kinematics.cc.
Returns a matrix for transforming from the base frame to link j frame.
Definition at line 199 of file Kinematics.cc. Referenced by PostureEngine::solveLinkVector().
Returns a matrix for transforming from the base frame to joint j frame.
Definition at line 184 of file Kinematics.cc.
Returns a matrix for transforming from link ij to link oj.
Definition at line 298 of file Kinematics.cc. Referenced by projectToPlane().
Returns a matrix for transforming from link frame ij to joint frame oj.
Definition at line 270 of file Kinematics.cc.
Returns a matrix for transforming from joint frame ij to link frame oj.
Definition at line 242 of file Kinematics.cc. Referenced by getLinkInterestPoint().
Returns a matrix for transforming from joint ij to joint oj.
Definition at line 214 of file Kinematics.cc.
Returns the location of a named point and the link it is attached to.
Definition at line 326 of file Kinematics.cc. Referenced by getJointInterestPoint().
Returns the location of a named point, relative to any desired joint reference frame.
Definition at line 354 of file Kinematics.cc. Referenced by getLinkInterestPoint().
Returns the location of a named point, relative to any desired reference frame.
Definition at line 199 of file Kinematics.h.
Find the ground plane by fitting a plane to the lowest 3 interest points. This function merely calls the other version of calculateGroundPlane with the current gravity vector as the "down" vector.
Definition at line 605 of file Kinematics.cc.
Find the ground plane by fitting a plane to the lowest 3 interest points.
Definition at line 610 of file Kinematics.cc.
Find the point of intersection between a ray and a plane.
![]()
Mathematical implementation: Need to convert p_b to p_j
Once we have the transformation Tb_j from b to j, we need: After we obtain p_j, we can find the point of intersection of r_j and p_j using:
Where
Of course, if Definition at line 617 of file Kinematics.cc.
A simple utility function, converts x,y,z,h to a NEWMAT::ColumnVector.
Definition at line 253 of file Kinematics.h. Referenced by calculateGroundPlane(), getInterestPoint(), PostureEngine::solveLinkPosition(), and PostureEngine::solveLinkVector().
A simple utility function, pulls the first 3 rows of the first column, divides each by the fourth row, and stores into ox, oy, and oz.
Definition at line 263 of file Kinematics.h.
A simple utility function, pulls the first 4 rows of the first column, stores into ox, oy, oz, oh.
Definition at line 272 of file Kinematics.h.
returns the global ROBOOP::Config object which Kinematics classes initialize themselves from (roconfig)
Definition at line 277 of file Kinematics.h.
Called by constructors to do basic setup - first call will read Config::motion_config::kinematics from disk, future initializes reuse static roconfig.
Reimplemented in PostureMC. Definition at line 23 of file Kinematics.cc. Referenced by Kinematics().
initializes static variables -- only call if not staticsInited
Definition at line 35 of file Kinematics.cc. Referenced by checkStatics().
checks that statics have been initialized, and calls initStatics if they are missing
Definition at line 287 of file Kinematics.h. Referenced by baseToJoint(), baseToLink(), getInterestPoint(), getJointInterestPoint(), init(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), and linkToLink().
called by init to allocate/initialize each of chains
Definition at line 93 of file Kinematics.cc. Referenced by init(), and initStatics().
Returns the location of a named point, relative to the link it is attached to.
Definition at line 336 of file Kinematics.cc.
Called at the beginning of each function which accesses ROBOOP computations - should make sure the ROBOOP structures are up to date with Tekkotsu structures. This class will pull current values from WorldState, but it is expected that subclasses (i.e. PostureEngine) will want to provide their own joint values. Updates from link 1 through link l.
Reimplemented in PostureEngine. Definition at line 668 of file Kinematics.cc. Referenced by baseToJoint(), baseToLink(), getJointInterestPoint(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), and linkToLink().
converts a Tekkotsu output index to a chain and link
Definition at line 315 of file Kinematics.h. Referenced by baseToJoint(), baseToLink(), getJointInterestPoint(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), linkToLink(), and PostureEngine::solveLinkPosition().
Member Data Documentation
initially false, set to true after first Kinematics is initialized
Definition at line 330 of file Kinematics.h. Referenced by checkStatics(), and initStatics().
A separate ROBOOP::Robot instantiation for each chain since ROBOOP package doesn't support branching chains (which would be rather difficult to implement well). static allocation solves problems with shared memory regions, but becomes thread-UNsafe... Definition at line 338 of file Kinematics.h. Referenced by baseToJoint(), baseToLink(), getJointInterestPoint(), init(), initStatics(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), linkToLink(), lookup(), PostureEngine::solveLinkPosition(), PostureEngine::update(), update(), and ~Kinematics().
holds mapping for each chain's links back to the tekkotsu outputs and reference frames they represent
Definition at line 342 of file Kinematics.h. Referenced by getInterestPoint(), newChain(), PostureEngine::solveLinkPosition(), PostureEngine::update(), and update().
holds mapping from tekkotsu output index to chain and link indicies
Definition at line 364 of file Kinematics.h. Referenced by initStatics(), lookup(), and newChain().
cache of the configuration of the robot for rapid initialization (so we don't have to re-read from disk)
Definition at line 367 of file Kinematics.h. Referenced by getConfig(), initStatics(), and newChain().
these interest points are shared by all Kinematics classes (i.e. all PostureEngines) this is to reduce initialization time, but does mean one robot can't do kinematic calculations regarding a different model robot... Definition at line 384 of file Kinematics.h. Referenced by getInterestPoint(), and initStatics().
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:27 2007 by Doxygen 1.5.4 |