|
|
world.c File ReferenceImplementaton of the function operating on Tworld. More... #include "world.h" #include "defines.h" #include "error.h" #include "varnames.h" #include "random.h" #include "list.h" #include <math.h> #include <string.h> #include <unistd.h> Go to the source code of this file.
Detailed DescriptionImplementaton of the function operating on Tworld. Definition in file world.c. Function Documentation
Defines an empty kinematic chain.
Definition at line 160 of file world.c. References CopyVoidPtr(), DeleteVoidPtr(), INIT_NUM_JOINTS, InitVector(), and Tbranch::steps. Referenced by Branch2Link(), CopyBranch(), InitKinTreeNode(), and MergeBranches().
Here is the call graph for this function:
Here is the caller graph for this function:
Defines a kinematic chain from another chain.
Definition at line 165 of file world.c. References AddStepToBranch(), CreateBranch(), GetBranchStep(), and nStepsBranch(). Referenced by Branch2Link(), GenerateKinTree(), and InitKinTreeNode().
Here is the call graph for this function:
Here is the caller graph for this function:
Adds a step to a kinematic chain.
Definition at line 180 of file world.c. References TBranchStep::joint, NEW, NewVectorElement(), TBranchStep::sign, and Tbranch::steps. Referenced by Branch2Link(), CopyBranch(), GenerateKinTree(), and MergeBranches().
Here is the call graph for this function:
Here is the caller graph for this function:
Gets the number of steps in a kinematic chain.
Definition at line 192 of file world.c. References Tbranch::steps, and VectorSize(). Referenced by CopyBranch(), DeleteBranch(), GenerateEquationsFromBranch(), GenerateKinTree(), GenerateTransEquationsFromBranch(), GetBranchDestination(), and MergeBranches().
Here is the call graph for this function:
Here is the caller graph for this function:
Retrives a particular step form a kinematic chain. If there is no step with the given number in the kinematic chain, this funtion triggers an error.
Definition at line 197 of file world.c. References Error(), GetVectorElement(), and Tbranch::steps. Referenced by CopyBranch(), GenerateTransEquationsFromBranch(), GetBranchDestination(), GetBranchOrigin(), and MergeBranches().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the identifier of the link where the kinematic chain starts.
Definition at line 211 of file world.c. References GetBranchStep(), JointFromID(), and JointToID(). Referenced by GenerateEquationsFromBranch().
Here is the call graph for this function:
Here is the caller graph for this function:
Returns the identifier of the link where the kinematic chain ends.
Definition at line 226 of file world.c. References GetBranchStep(), JointFromID(), JointToID(), and nStepsBranch(). Referenced by GenerateEquationsFromBranch().
Here is the call graph for this function:
Here is the caller graph for this function:
We get two branches, b1,b2, representing two paths from, typically, the groundLink to the same link. The output, b, will be the closed branch resulting from eliminating from b1 and b2 the initial common path from the groudnLink to the point where the paths diverge.
Definition at line 241 of file world.c. References AddStepToBranch(), CreateBranch(), FALSE, GetBranchStep(), and nStepsBranch(). Referenced by GenerateKinTree().
Here is the call graph for this function:
Here is the caller graph for this function:
Deletes the information stored in a kinematic branch and frees the allocated memory.
Definition at line 284 of file world.c. References DeleteVector(), GetVectorElement(), nStepsBranch(), and Tbranch::steps. Referenced by Branch2Link(), DeleteKinTreeNode(), GenerateKinTree(), and InitWorldKinCS().
Here is the call graph for this function:
Here is the caller graph for this function:
Initializes a node in a kinematic tree.
Definition at line 355 of file world.c. References TKinTreeNode::b, CopyBranch(), CreateBranch(), and TKinTreeNode::lID. Referenced by GenerateKinTree().
Here is the call graph for this function:
Here is the caller graph for this function:
Gets the identifier of the link reached in a kinematic tree node.
Definition at line 364 of file world.c. References TKinTreeNode::lID.
Gets the kinematic branch stored in a kinematic tree node.
Definition at line 369 of file world.c. References TKinTreeNode::b. Referenced by GenerateKinTree().
Here is the caller graph for this function:
Deletes the information stored in a kinematic tree node and frees the allocated memory.
Definition at line 374 of file world.c. References TKinTreeNode::b, and DeleteBranch(). Referenced by GenerateKinTree().
Here is the call graph for this function:
Here is the caller graph for this function:
Considering the mechanisms as a graph where the vertices are the links and the edges are defined by the joints, this function determines the shortest from link f to link t, in the form of a kinematic branch. If there is no path from link from link f to link t, we return an empty branch.
Definition at line 532 of file world.c. References AddStepToBranch(), CopyBranch(), CreateBranch(), DeleteBranch(), FALSE, GetMechanismJoint(), JointFromID(), JointToID(), Tworld::m, NEW, Tworld::nl, and TRUE. Referenced by GenerateKinTree(), and GenerateWorldEquationSystems().
Here is the call graph for this function:
Here is the caller graph for this function:
Builds a kinematic tree departing from the ground link. From the kinematic tree we extract two types of branches
A mechanism can have the two types of branches. Before building the kinematic tree, we ensure the mechanism to be fully connected: Parts of the mechanism disconnected from the ground link are connected to it using free-joints.
Definition at line 601 of file world.c. References AddJoint2Mechanism(), AddStepToBranch(), Branch2Link(), CopyBranch(), CopyVoidPtr(), DeleteBranch(), DeleteJoint(), DeleteKinTreeNode(), DeleteVoidPtr(), FALSE, GetKinTreeNodeBranch(), GetMechanismJoint(), GetMechanismLink(), GetMechanismNJoints(), InitKinTreeNode(), InitVector(), JointFromID(), JointToID(), Tworld::m, MergeBranches(), NEW, NewFreeJoint(), NewVectorElement(), Tworld::nj, Tworld::nl, nStepsBranch(), and TRUE. Referenced by InitWorldKinCS().
Here is the call graph for this function:
Here is the caller graph for this function:
Generate equations from a branch considering the branch merely as a sum of vectors. The difference with GenerateEquationsFromBranch is that for open branches we do not add to the resulting equations the variables representing the position of the link reached by this open branch. Thus, the output equations here only involve system equations. Moreove, the resulting equations are not added to a cuiksystem but returned to the caller.
Definition at line 754 of file world.c. References EQU, GenerateJointEquationsInBranch(), GetBranchStep(), InitEquation(), Tworld::kinCS, nStepsBranch(), SetEquationCmp(), and SetEquationType(). Referenced by GenerateEquationsFromBranch(), and GenerateWorldEquationSystems().
Here is the call graph for this function:
Here is the caller graph for this function:
Generate equations from a branch. If the branch is closed, we generate 3 loop equations (X, Y and Z) that are added to the given cuiksystem. If the branch is open we generate equations that give the 3D position in the global frame of reference of the origin of the frame of reference of the last link in the branch. This function uses GenerateTransEquationsFromBranch and then completes equations for open branches and add the results to the given cuiksystem.
Definition at line 782 of file world.c. References AddCt2Monomial(), AddEquation2CS(), AddMonomial(), AddVariable2CS(), AddVariable2Monomial(), DeleteEquation(), DeleteInterval(), DeleteMonomial(), DeleteVariable(), FALSE, GenerateTransEquationsFromBranch(), GetBranchDestination(), GetBranchOrigin(), GetLinkName(), GetMechanismLink(), InitMonomial(), LINK_TRANS, Tworld::m, Tworld::maxCoord, NEW, NewInterval(), NewVariable(), nStepsBranch(), ResetMonomial(), SECONDARY_VAR, and SetVariableInterval(). Referenced by InitWorldKinCS().
Here is the call graph for this function:
Here is the caller graph for this function:
Identifies links articulated with only two revolute joints. For those links it is possible to re-define the reference frame so that simpler equations will be obtained.
Definition at line 845 of file world.c. References GetJointPoint(), GetJointType(), GetMechanismJoint(), JointFromID(), JointToID(), Tworld::m, and REV_JOINT. Referenced by InitWorldKinCS().
Here is the call graph for this function:
Here is the caller graph for this function:
Initializes the kinematic sub-problem of a Tworld structure.
Definition at line 880 of file world.c. References ChangeLinkReferenceFrame(), DeleteBranch(), DeleteVector(), Error(), GenerateEquationsFromBranch(), GenerateJointEquations(), GenerateJointRangeEquations(), GenerateKinTree(), GenerateLinkRot(), GetMechanismJoint(), GetMechanismLink(), GetVectorElement(), IsRevoluteBinaryLink(), Tworld::kinCS, Tworld::m, Tworld::maxCoord, NEW, Tworld::nj, Tworld::nl, SYSTEM_EQ, and VectorSize(). Referenced by GenerateWorldEquationSystems().
Here is the call graph for this function:
Here is the caller graph for this function:
Initializes the cuiksystems in a Tworld structure. The Tworld::kinCS is initialized as an empty cuiksystem. Tworld::globalCS is not initialized since it is directly copied from the kinCS in GenerateWorldEquationSystems. The rest of cuiksystems (Tworld::obsCS) are set to NULL pointers.
Definition at line 948 of file world.c. References InitCuikSystem(), and Tworld::kinCS. Referenced by GenerateWorldEquationSystems().
Here is the call graph for this function:
Here is the caller graph for this function:
Deletes the cuiksystems stored in a Tworld structure: Tworld::kinCS, Tworld::globalCS and all the Tworld::obsCS cuiksystems.
Definition at line 953 of file world.c. References DeleteCuikSystem(), and Tworld::kinCS. Referenced by DeleteWorld().
Here is the call graph for this function:
Here is the caller graph for this function:
Initializes an empty world.
Definition at line 964 of file world.c. References EMPTY_WORLD, InitMechanism(), Tworld::m, Tworld::nb, Tworld::nj, Tworld::nl, Tworld::refEqs, Tworld::stage, and Tworld::systemVars.
Here is the call graph for this function:
Adds a link to the mechanism in the world.
Definition at line 978 of file world.c. References AddLink2Mechanism(), LinkNBodies(), Tworld::m, Tworld::nb, and Tworld::nl.
Here is the call graph for this function:
Adds a joint to the mechanism in the world.
Definition at line 989 of file world.c. References AddJoint2Mechanism(), Tworld::m, and Tworld::nj.
Here is the call graph for this function:
Returns the number of degrees of freedom of the mechanism in the world.
Definition at line 996 of file world.c. References GetMechanismDOF(), and Tworld::m.
Here is the call graph for this function:
Gets the identifier of a link from its name (NO_UINT if there is no link with the given name).
Definition at line 1001 of file world.c. References GetLinkID(), and Tworld::m.
Here is the call graph for this function:
Gets a pointer to a link in the mechanism included in the world from its identifier (NULL if there is no link with the given identifier).
Definition at line 1006 of file world.c. References GetMechanismLink(), and Tworld::m.
Here is the call graph for this function:
Gets the number of links in the mechanism included in the world.
Definition at line 1011 of file world.c. References Tworld::nl.
Gets the number of joints in the mechanism included in the world.
Definition at line 1016 of file world.c. References Tworld::nj.
Each link can include more than one convex polyhedron. This function returns the sum of the number of convex polyhedrons defined over all links
Definition at line 1021 of file world.c. References Tworld::nb. Gets the system vars of the global cuiksystem in the form of an array of booleans, one for each variable in the kinCS where only entries corresponding to system variables are set to TRUE.
Definition at line 1026 of file world.c. References Error(), GetCSSystemVars(), Tworld::kinCS, Tworld::stage, and WORLD_WITH_EQUATIONS.
Here is the call graph for this function:
From the information stored in a .world file, we generate the environment and mechanisms structures. From this information we have to generate systems of equations necessary to solve the problem. This is the purpose of this function. Therefore, this function should be used after reading the .world file and before start to solve the problem.
Definition at line 1034 of file world.c. References Branch2Link(), COORD_EQ, Error(), GenerateTransEquationsFromBranch(), GetCSSystemVars(), GetMechanismMaxCoordinate(), InitWorldCS(), InitWorldKinCS(), Tworld::kinCS, Tworld::m, Tworld::maxCoord, NEW, Tworld::nl, Tworld::refEqs, Tworld::stage, Tworld::systemVars, WORLD_WITH_EQUATIONS, and WORLD_WITH_GEOMETRY.
Here is the call graph for this function:
Gets the search space for a given problem. The search space is deduced from the ranges of the variables involved in the problem. This can be seen as a box from world constructor.
Definition at line 1077 of file world.c. References Error(), GenerateInitialBox(), Tworld::kinCS, Tworld::stage, and WORLD_WITH_EQUATIONS.
Here is the call graph for this function:
Reduces the system variables as much as possible taking into account only the system equations (i.e., using only the Tworld::kinCS).
Definition at line 1085 of file world.c. References EMPTY_BOX, Error(), GetBoxLevel(), GetBoxSize(), Tworld::kinCS, MaxReduction(), Tworld::stage, SYSTEM_VAR, Tworld::systemVars, and WORLD_WITH_EQUATIONS.
Here is the call graph for this function:
Definition at line 1130 of file world.c. References ComputeSplitDim(), CUT_POINT, Error(), Tworld::kinCS, NEW, SplitBox(), Tworld::stage, and WORLD_WITH_EQUATIONS.
Here is the call graph for this function:
Adds a world (environment plus mechanism) in a 3D scene. Note that the the mechanism is not set in any valid configuration but all links are plotted with its local frame overlapped with the global one. To actually display the mechanism in a correct configuration you should use MoveWorld.
Definition at line 1152 of file world.c. References Error(), Tworld::m, PlotMechanism(), Tworld::stage, and WORLD_WITH_GEOMETRY. Referenced by AnimateWorld(), and main().
Here is the call graph for this function:
Here is the caller graph for this function:
Moves the mechanisms defined in a world information to a given configuration. Note that the box should only include ranges for the system variables. Therefore, the box given as a parameter is a sub-box of the box associated with Tworld::kinCS.
Definition at line 1160 of file world.c. References Error(), EvaluateEquation(), GetBoxInterval(), GetCSNumVariables(), GetEquationValue(), IntervalCenter(), Tworld::kinCS, Tworld::m, MoveMechanism(), NEW, Tworld::nl, Tworld::refEqs, RegenerateMechanismSolution(), Tworld::stage, Tworld::systemVars, and WORLD_WITH_EQUATIONS. Referenced by AnimateWorld(), and main().
Here is the call graph for this function:
Here is the caller graph for this function:
Produces an animation along a path. An animation is a 3d geometry that can be browsed with geomview. Note that the boxes in the list should only include ranges for the system variables. Therefore, the box given as a parameter is a sub-box of the box associated with Tworld::kinCS. Lists printed while solving a problem are already in this form (i.e., including only system variables)
Definition at line 1211 of file world.c. References Advance(), Close3dBlock(), ClosePlot3d(), Delay3dObject(), EndOfList(), Error(), FALSE, FINAL_FRAME_DELAY, First(), FRAME_RATE, GetBoxNIntervals(), GetCSNumNonDummyVariables(), GetCurrent(), INITIAL_FRAME_DELAY, InitIterator(), InitPlot3d(), Tworld::kinCS, MoveWorld(), PlotWorld(), Tworld::stage, Start3dBlock(), TRUE, and WORLD_WITH_EQUATIONS. Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
Generate a file with the cuiksystems generated from the world information.
Definition at line 1254 of file world.c. References CreateFileName(), CUIK_EXT, DeleteFileName(), Error(), GetFileFullName(), GetFileName(), GetFilePath(), Tworld::kinCS, PARAM_EXT, PrintCuikSystem(), Tworld::stage, and WORLD_WITH_EQUATIONS. Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
Deletes the information stored in a world and frees the allocated memory.
Definition at line 1286 of file world.c. References DeleteEquation(), DeleteMechanism(), DeleteWorldCS(), Tworld::m, Tworld::nl, Tworld::refEqs, Tworld::stage, Tworld::systemVars, WORLD_WITH_EQUATIONS, and WORLD_WITH_GEOMETRY. Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
|