| 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 378 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
Returns a matrix for transforming from the base frame to joint j frame.
Definition at line 183 of file Kinematics.cc.
Returns a matrix for transforming from the base frame to link j frame.
Definition at line 198 of file Kinematics.cc. Referenced by PostureEngine::solveLinkVector().
Calculate the leg heights along a given "down" vector (0 is level with base frame). This can be based on either the gravity vector from accelerometer readings, or if that may be unreliable due to being in motion, you could do some basic balance modeling and pass a predicted vector. This uses the interest point database to find the lowest interest point for each leg
Definition at line 394 of file Kinematics.cc. Referenced by findUnusedLeg().
Find the ground plane by fitting a plane to the lowest 3 interest points.
Definition at line 456 of file Kinematics.cc.
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 446 of file Kinematics.cc.
checks that statics have been initialized, and calls initStatics if they are missing
Definition at line 285 of file Kinematics.h. Referenced by baseToJoint(), baseToLink(), calcLegHeights(), calculateGroundPlane(), findUnusedLeg(), getInterestPoint(), getJointInterestPoint(), init(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), and linkToLink().
Find the leg which is in least contact with ground.
Definition at line 430 of file Kinematics.cc.
returns the global ROBOOP::Config object which Kinematics classes initialize themselves from (roconfig)
Definition at line 275 of file Kinematics.h.
Returns the location of a named point, relative to the link it is attached to.
Definition at line 335 of file Kinematics.cc.
Returns the location of a named point and the link it is attached to.
Definition at line 325 of file Kinematics.cc. Referenced by getJointInterestPoint().
Returns the location of a named point, relative to any desired joint reference frame.
Definition at line 353 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.
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().
Returns a matrix for transforming from joint frame j to base frame.
Definition at line 153 of file Kinematics.cc. Referenced by calcLegHeights(), and calculateGroundPlane().
Returns a matrix for transforming from joint ij to joint oj.
Definition at line 213 of file Kinematics.cc.
Returns a matrix for transforming from joint frame ij to link frame oj.
Definition at line 241 of file Kinematics.cc. Referenced by getLinkInterestPoint().
Returns a matrix for transforming from link frame j to base frame.
Definition at line 168 of file Kinematics.cc.
Returns a matrix for transforming from link frame ij to joint frame oj.
Definition at line 269 of file Kinematics.cc.
Returns a matrix for transforming from link ij to link oj.
Definition at line 297 of file Kinematics.cc. Referenced by projectToPlane().
converts a Tekkotsu output index to a chain and link
Definition at line 313 of file Kinematics.h. Referenced by baseToJoint(), baseToLink(), getJointInterestPoint(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), linkToLink(), and PostureEngine::solveLinkPosition().
called by init to allocate/initialize each of chains
Definition at line 92 of file Kinematics.cc. Referenced by init(), and initStatics().
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=().
A simple utility function, converts x,y,z,h to a NEWMAT::ColumnVector.
Definition at line 251 of file Kinematics.h. Referenced by calcLegHeights(), calculateGroundPlane(), getInterestPoint(), PostureEngine::solveLinkPosition(), and PostureEngine::solveLinkVector().
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 601 of file Kinematics.cc.
A simple utility function, pulls the first 4 rows of the first column, stores into ox, oy, oz, oh.
Definition at line 270 of file Kinematics.h.
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 261 of file Kinematics.h.
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 652 of file Kinematics.cc. Referenced by baseToJoint(), baseToLink(), calcLegHeights(), calculateGroundPlane(), getJointInterestPoint(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), and linkToLink().
Member Data Documentation
holds mapping for each chain's links back to the tekkotsu outputs and reference frames they represent
Definition at line 340 of file Kinematics.h. Referenced by getInterestPoint(), newChain(), PostureEngine::solveLinkPosition(), PostureEngine::update(), and update().
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 336 of file Kinematics.h. Referenced by baseToJoint(), baseToLink(), calcLegHeights(), calculateGroundPlane(), getJointInterestPoint(), init(), initStatics(), jointToBase(), jointToJoint(), jointToLink(), linkToBase(), linkToJoint(), linkToLink(), lookup(), PostureEngine::solveLinkPosition(), PostureEngine::update(), update(), and ~Kinematics().
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 382 of file Kinematics.h. Referenced by calcLegHeights(), calculateGroundPlane(), getInterestPoint(), and initStatics().
holds mapping from tekkotsu output index to chain and link indicies
Definition at line 362 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 365 of file Kinematics.h. Referenced by getConfig(), initStatics(), and newChain().
initially false, set to true after first Kinematics is initialized
Definition at line 328 of file Kinematics.h. Referenced by checkStatics(), and initStatics().
The documentation for this class was generated from the following files: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tekkotsu v3.0 |
Generated Wed Oct 4 00:05:04 2006 by Doxygen 1.4.7 |