wcs.h File Reference

Introduction

Interface that unifies the access to world and cuiksystems so that the atlas related applications can operate on both structures.

Definition in file wcs.h.

Data Structures

struct  TAtlasBase
 Type defining the equations on which the atlas is defined. More...
 

Macros

#define CS_WD_EXT   "world/cuik"
 Possible extensions for the equation files. More...
 
#define CS_WD_INIT(pr, name, wcs)   InitCSWDFromFile(pr,name,wcs)
 Initializes the equations from a file. More...
 
#define CS_WD_FROM_WORLD(ptr, wcs)   { (wcs)->isCS=FALSE; (wcs)->cs=NULL; (wcs)->w=ptr; }
 Initializes the equations from a world structure. More...
 
#define CS_WD_FROM_CUIKSYSTEM(ptr, wcs)   { (wcs)->isCS=TRUE; (wcs)->cs=ptr; (wcs)->w=NULL; }
 Initializes the equations from a CuikSystem structure. More...
 
#define ON_CUIKSYSTEM(wcs)   (wcs)->isCS
 TRUE if the atlas is defined on a cuiksystem. More...
 
#define GET_WORLD(wcs)   (wcs)->w
 Returns the world from an TAtlasBase. More...
 
#define GET_CUIKSYSTEM(wcs)   (wcs)->cs
 Returns the CuikSystem from an TAtlasBase. More...
 
#define CS_WD_EVALUATE_SIMP_EQUATIONS(pr, p, r, wcs)   if ((wcs)->isCS) EvaluateSimpCSEquations(pr,p,r,(wcs)->cs); else WorldEvaluateSimpEquations(pr,p,r,(wcs)->w);
 Evaluates the simplified set of equations. More...
 
#define CS_WD_EVALUATE_SUBSET_SIMP_EQUATIONS(pr, st, p, r, wcs)   if ((wcs)->isCS) EvaluateSubSetSimpCSEquations(pr,st,p,r,(wcs)->cs); else WorldEvaluateSubSetSimpEquations(pr,st,p,r,(wcs)->w);
 Evaluates a subset of the simplified set of equations. More...
 
#define CS_WD_SIMP_INEQUALITIES_HOLD(pr, p, wcs)   ((wcs)->isCS ? SimpInequalitiesHoldOnPoint(pr,p,(wcs)->cs) : WorldSimpInequalitiesHold(pr,p,(wcs)->w))
 Cheks if all inequalities hold. More...
 
#define CS_WD_SIMP_INEQUALITIES_ERROR(pr, p, wcs)   ((wcs)->isCS ? ErrorInSimpInequalitiesOnPoint(pr,p,(wcs)->cs) : WorldErrorInSimpInequalities(pr,p,(wcs)->w))
 Maximum error in the inequalities. More...
 
#define CS_WD_GET_SYSTEM_VARS(sv, wcs)   ((wcs)->isCS ? GetCSSystemVars(sv,(wcs)->cs) : GetWorldSystemVars(sv,(wcs)->w))
 Gets the system variables. More...
 
#define CS_WD_GET_POSITION_VARS(pv, wcs)   ((wcs)->isCS ? GetCSPositionVars(pv,(wcs)->cs) : GetWorldPositionVars(pv,(wcs)->w))
 Gets the position variables. More...
 
#define CS_WD_GET_POSITION_VELOCITY_VARS(pv, wcs)   ((wcs)->isCS ? GetCSPositionVelocityVars(pv,(wcs)->cs) : GetWorldPositionVelocityVars(pv,(wcs)->w))
 Gets the position/velocity variables. More...
 
#define CS_WD_GET_POSITION_EQS(pe, wcs)   ((wcs)->isCS ? GetCSPositionEqs(pe,(wcs)->cs) : GetWorldPositionEqs(pe,(wcs)->w))
 Gets the position equations. More...
 
#define CS_WD_GET_POSITION_VELOCITY_EQS(pe, wcs)   ((wcs)->isCS ? GetCSPositionVelocityEqs(pe,(wcs)->cs) : GetWorldPositionVelocityEqs(pe,(wcs)->w))
 Gets the position and velocity equations. More...
 
#define CS_WD_GET_SYSTEM_VAR_NAME(id, wcs)   ((wcs)->isCS ? GetCSSystemVariableName(id,(wcs)->cs) : GetWorldSystemVarName(id,(wcs)->w))
 Name of a particular system variables. More...
 
#define CS_WD_GET_NUM_SYSTEM_VARS(wcs)   ((wcs)->isCS ? GetCSNumSystemVariables((wcs)->cs) : GetWorldNumSystemVariables((wcs)->w))
 Gets the number of system variables. More...
 
#define CS_WD_GET_VAR_TOPOLOGY(varID, wcs)   ((wcs)->isCS ? GetCSVarTopology(varID,(wcs)->cs) : GetWorldVarTopology(varID,(wcs)->w))
 Gets the variable topology. More...
 
#define CS_WD_REGENERATE_ORIGINAL_POINT(pr, p, o, wcs)   ((wcs)->isCS ? RegenerateOriginalPoint(pr,p,o,(wcs)->cs) : RegenerateWorldOriginalPoint(pr,p,o,(wcs)->w))
 Completes an original point from a simplified one. More...
 
#define CS_WD_INIT_CD(pr, mt, wcs)   { if (!(wcs)->isCS) InitWorldCD(pr,mt,(wcs)->w); }
 Initializes the collision detector. More...
 
#define CS_ANY_COLLISION(wcs)   (((wcs)->isCS)?FALSE:AnyCollision((wcs)->w))
 Determines if there is any collision to be checked. More...
 
#define CS_WD_TEST_COLLISION(f, pr, all, s, sPrev, wcs)
 Checks collisions. More...
 
#define CS_WD_IN_COLLISION(f, pr, s, sPrev, wcs)   CS_WD_TEST_COLLISION(f,pr,FALSE,s,sPrev,wcs)
 Checks if a configuration is in collision. More...
 
#define CS_WD_ALL_COLLISIONS(f, pr, s, sPrev, wcs)   CS_WD_TEST_COLLISION(f,pr,TRUE,s,sPrev,wcs)
 Checks if a configuration is in collision. More...
 
#define CS_WD_ORIGINAL_IN_COLLISION(pr, o, oPrev, wcs)   (((wcs)->isCS)||(!WorldCanCollide((wcs)->w)) ? FALSE : MoveAndCheckCD(pr,FALSE,0,o,oPrev,(wcs)->w))
 Checks if a configuration is in collision. More...
 
#define CS_WD_COST_PTR(wcs)   ((wcs)->isCS ? (void *)((wcs)->cs) : (void *)((wcs)->w))
 Pointer to the base type. More...
 
#define CS_WD_COST_FN(wcs)   ((wcs)->isCS ? EvaluateCSCost : EvaluateWorldCost)
 Cost function for a given configution. More...
 
#define CS_WD_COST(pr, simp, p, wcs)   ((wcs)->isCS ? EvaluateCSCost(pr,simp,p,(void *)((wcs)->cs)) : EvaluateWorldCost(pr,simp,p,(void *)((wcs)->w)))
 Evaluates the cost of a given configution. More...
 
#define CS_WD_GET_SIMP_TOPOLOGY(pr, tp, wcs)   ((wcs)->isCS ? GetSimpCSTopology(pr,tp,(wcs)->cs) : GetWorldSimpTopology(pr,tp,(wcs)->w))
 Gets the simplified variable topology. More...
 
#define CS_WD_GET_TOPOLOGY(pr, tp, wcs)   ((wcs)->isCS ? GetCSTopology(pr,tp,(wcs)->cs) : GetWorldTopology(pr,tp,(wcs)->w))
 Gets the variable topology. More...
 
#define CS_WD_REGENERATE_SOLUTION_POINT(pr, p, r, wcs)   ((wcs)->isCS ? RegenerateSolutionPoint(pr,p,r,(wcs)->cs) : RegenerateWorldSolutionPoint(pr,p,r,(wcs)->w))
 Compleates a solution point with the dummy variables. More...
 
#define CS_WD_GENERATE_SIMPLIFIED_POINT(pr, p, r, wcs)   ((wcs)->isCS ? GenerateSimplifiedPoint(pr,p,r,(wcs)->cs) : WorldGenerateSimplifiedPoint(pr,p,r,(wcs)->w))
 Generates a simplified point from an original one. More...
 
#define CS_WD_ERROR_IN_SIMP_EQUATIONS(pr, p, wcs)   ((wcs)->isCS ? ErrorInSimpCSEquations(pr,p,(wcs)->cs) : WorldErrorInSimpEquations(pr,p,(wcs)->w))
 Computes the error in the simplified system for a given point. More...
 
#define CS_WD_ERROR_IN_EQUATIONS(pr, p, wcs)   ((wcs)->isCS ? ErrorInCSEquations(pr,p,(wcs)->cs) : WorldErrorInEquations(pr,p,(wcs)->w))
 Computes the error for a given point. More...
 
#define CS_WD_GENERATE_SIMP_INITIAL_BOX(pr, b, wcs)   { if ((wcs)->isCS) GenerateSimpInitialBox(pr,b,(wcs)->cs); else GetWorldSimpInitialBox(pr,b,(wcs)->w); }
 Computes the global box for the simplified system. More...
 
#define CS_WD_GET_SIMP_JACOBIAN(pr, J, wcs)   { if ((wcs)->isCS) GetSimpCSJacobian(pr,J,(wcs)->cs); else GetWorldSimpJacobian(pr,J,(wcs)->w); }
 Computes the Jacobian of the simplified system. More...
 
#define CS_WD_GET_SIMP_NJACOBIAN(pr, nJ, wcs)   ((wcs)->isCS?GetSimpCSNJacobian(pr,nJ,(wcs)->cs):GetWorldSimpNJacobian(pr,nJ,(wcs)->w))
 Computes the numerical Jacobian of the simplified system. More...
 
#define CS_WD_GET_SIMP_NHESSIAN(pr, sJ, nH, wcs)   ((wcs)->isCS?GetSimpCSNHessian(pr,sJ,nH,(wcs)->cs):GetWorldSimpNHessian(pr,sJ,nH,(wcs)->w))
 Computes the numerical Hessian of the simplified system. More...
 
#define CS_WD_MANIFOLD_DIMENSION(pr, p, wcs)   ((wcs)->isCS ? ManifoldDimension(pr,p,(wcs)->cs) : WorldManifoldDimension(pr,p,(wcs)->w))
 Computes the dimension of the solution set. More...
 
#define CS_WD_NEWTON_IN_SIMP(pr, p, wcs)   ((wcs)->isCS ? CuikNewtonSimp(pr,p,(wcs)->cs) : WorldSimpCuikNewton(pr,p,(wcs)->w))
 Applies a Newton procedure to move a point towads the manifold. More...
 
#define CS_WD_HAS_VELOCITY(pr, wcs)   ((wcs)->isCS ? CuikHasVelocity(pr,(wcs)->cs) : WorldHasVelocity(pr,(wcs)->w))
 Determines if the problem includes velocity information. More...
 
#define CS_WD_DELETE(wcs)   { if ((wcs)->isCS) { DeleteCuikSystem((wcs)->cs); free((wcs)->cs); } else { DeleteWorld((wcs)->w); free((wcs)->w); } }
 Destructor of the equation structure. More...
 

Functions

void InitCSWDFromFile (Tparameters *pr, char *name, TAtlasBase *wcs)
 Initializes a world or a CuikSystem structre. More...
 

Macro Definition Documentation

◆ CS_WD_EXT

#define CS_WD_EXT   "world/cuik"

Extension for the equation files. This is only used for printing.

See also
CUIK_EXT, WORLD_EXT

Definition at line 49 of file wcs.h.

◆ CS_WD_INIT

#define CS_WD_INIT (   pr,
  name,
  wcs 
)    InitCSWDFromFile(pr,name,wcs)

Initializes the equations from a file.

Parameters
prPointer to the set of parameters.
nameThe file name given by the caller.
wcsPointer to the equation structure to initialize.
See also
InitCSWDFromFile

Definition at line 90 of file wcs.h.

◆ CS_WD_FROM_WORLD

#define CS_WD_FROM_WORLD (   ptr,
  wcs 
)    { (wcs)->isCS=FALSE; (wcs)->cs=NULL; (wcs)->w=ptr; }

Initializes the equations from a world structure.

CAUTION: Do not use CS_WD_DELETE for structures created using this macro. The internal pointer to world in wcs copies the input pointer. Thus a delete would produce a double free.

Parameters
ptrA pointer to the world structure.
wcsPointer to the equation structure to initialize.
See also
InitCSWDFromFile

Definition at line 109 of file wcs.h.

◆ CS_WD_FROM_CUIKSYSTEM

#define CS_WD_FROM_CUIKSYSTEM (   ptr,
  wcs 
)    { (wcs)->isCS=TRUE; (wcs)->cs=ptr; (wcs)->w=NULL; }

Initializes the equations from a CuikSystem structure.

CAUTION: Do not use CS_WD_DELETE for structures created using this macro. The internal pointer to CuikSystem wcs copies the input pointer. Thus a delete would produce a double free.

Parameters
ptrA pointer to the CuikSystem structure.
wcsPointer to the equation structure to initialize.
See also
InitCSWDFromFile

Definition at line 128 of file wcs.h.

◆ ON_CUIKSYSTEM

#define ON_CUIKSYSTEM (   wcs)    (wcs)->isCS

TRUE if the equations defining the implicit conf. space are given by a cuiksystem and FALSE if they are given by a world file (possibly involving obstacles,...)

Parameters
wcsPointer to the equation structure to query.

Definition at line 140 of file wcs.h.

◆ GET_WORLD

#define GET_WORLD (   wcs)    (wcs)->w

Returns the world from an TAtlasBase.

Parameters
wcsPointer to the equation structure to query.

Definition at line 151 of file wcs.h.

◆ GET_CUIKSYSTEM

#define GET_CUIKSYSTEM (   wcs)    (wcs)->cs

Returns the CuikSystem from an TAtlasBase.

Parameters
wcsPointer to the equation structure to query.

Definition at line 161 of file wcs.h.

◆ CS_WD_EVALUATE_SIMP_EQUATIONS

#define CS_WD_EVALUATE_SIMP_EQUATIONS (   pr,
  p,
  r,
  wcs 
)    if ((wcs)->isCS) EvaluateSimpCSEquations(pr,p,r,(wcs)->cs); else WorldEvaluateSimpEquations(pr,p,r,(wcs)->w);

Evaluates the simplified set of equations.

Parameters
prPointer to the set of parameters.
pPointer to the point.
rPointer to the result.
wcsPointer to the equation set.
See also
EvaluateSimpCSEquations, WorldEvaluateSimpEquations

Definition at line 176 of file wcs.h.

◆ CS_WD_EVALUATE_SUBSET_SIMP_EQUATIONS

#define CS_WD_EVALUATE_SUBSET_SIMP_EQUATIONS (   pr,
  st,
  p,
  r,
  wcs 
)    if ((wcs)->isCS) EvaluateSubSetSimpCSEquations(pr,st,p,r,(wcs)->cs); else WorldEvaluateSubSetSimpEquations(pr,st,p,r,(wcs)->w);

Evaluates a subset of the simplified set of equations.

Parameters
prPointer to the set of parameters.
stArray of booleans indicating the subset to evaluate.
pPointer to the point.
rPointer to the result.
wcsPointer to the equation set.
See also
EvaluateSimpCSEquations, WorldEvaluateSimpEquations

Definition at line 192 of file wcs.h.

◆ CS_WD_SIMP_INEQUALITIES_HOLD

#define CS_WD_SIMP_INEQUALITIES_HOLD (   pr,
  p,
  wcs 
)    ((wcs)->isCS ? SimpInequalitiesHoldOnPoint(pr,p,(wcs)->cs) : WorldSimpInequalitiesHold(pr,p,(wcs)->w))

Determines if the set of inequalities in the simplified set of equations actually hold for a given point.

Parameters
prPointer to the set of parameters.
pPointer to the point.
wcsPointer to the equation set.
See also
SimpInequalitiesHoldOnPoint, WorldSimpInequalitiesHold

Definition at line 207 of file wcs.h.

◆ CS_WD_SIMP_INEQUALITIES_ERROR

#define CS_WD_SIMP_INEQUALITIES_ERROR (   pr,
  p,
  wcs 
)    ((wcs)->isCS ? ErrorInSimpInequalitiesOnPoint(pr,p,(wcs)->cs) : WorldErrorInSimpInequalities(pr,p,(wcs)->w))

Determines the maximum error in the inequalities in the simplified set of equations actually hold for a given point.

Parameters
prPointer to the set of parameters.
pPointer to the point.
wcsPointer to the equation set.
See also
ErrorInSimpInequalitiesOnPoint, WorldErrorInSimpInequalities

Definition at line 222 of file wcs.h.

◆ CS_WD_GET_SYSTEM_VARS

#define CS_WD_GET_SYSTEM_VARS (   sv,
  wcs 
)    ((wcs)->isCS ? GetCSSystemVars(sv,(wcs)->cs) : GetWorldSystemVars(sv,(wcs)->w))

Gets an array of booleans with TRUE for the system variables.

Parameters
svPointer to the array where to store the system var flags.
wcsPointer to the equation set.
Returns
The number of variables in the problem.
See also
GetCSSystemVars, GetWorldSystemVars

Definition at line 237 of file wcs.h.

◆ CS_WD_GET_POSITION_VARS

#define CS_WD_GET_POSITION_VARS (   pv,
  wcs 
)    ((wcs)->isCS ? GetCSPositionVars(pv,(wcs)->cs) : GetWorldPositionVars(pv,(wcs)->w))

Gets an array of booleans with TRUE for the position variables (i.e., non-velocity variables).

Parameters
pvPointer to the array where to store the system var flags.
wcsPointer to the equation set.
Returns
The number of variables in the problem.
See also
GetCSPositionVars, GetWorldPositionVars

Definition at line 253 of file wcs.h.

◆ CS_WD_GET_POSITION_VELOCITY_VARS

#define CS_WD_GET_POSITION_VELOCITY_VARS (   pv,
  wcs 
)    ((wcs)->isCS ? GetCSPositionVelocityVars(pv,(wcs)->cs) : GetWorldPositionVelocityVars(pv,(wcs)->w))

Gets an array of booleans with TRUE for the position or velocity variables (i.e., non-velocity variables). This is used to do not take into account the equations not related with dynamics.

Parameters
pvPointer to the array where to store the system var flags.
wcsPointer to the equation set.
Returns
The number of variables in the problem.
See also
GetCSPositionVelocityVars, GetWorldPositionVelocityxVars

Definition at line 270 of file wcs.h.

◆ CS_WD_GET_POSITION_EQS

#define CS_WD_GET_POSITION_EQS (   pe,
  wcs 
)    ((wcs)->isCS ? GetCSPositionEqs(pe,(wcs)->cs) : GetWorldPositionEqs(pe,(wcs)->w))

Gets an array of booleans with TRUE for the position equations (i.e., non-velocity equations).

Parameters
pePointer to the array where to store the system var flags.
wcsPointer to the equation set.
Returns
The number of equations in the problem.
See also
GetCSPositionEqs, GetWorldPositionEqs

Definition at line 286 of file wcs.h.

◆ CS_WD_GET_POSITION_VELOCITY_EQS

#define CS_WD_GET_POSITION_VELOCITY_EQS (   pe,
  wcs 
)    ((wcs)->isCS ? GetCSPositionVelocityEqs(pe,(wcs)->cs) : GetWorldPositionVelocityEqs(pe,(wcs)->w))

Gets an array of booleans with TRUE for the position or velocity equations (i.e., non-velocity equations). This is used to do not take into account equations not related with the dynamics (e.g., discriminant equations).

Parameters
pePointer to the array where to store the system var flags.
wcsPointer to the equation set.
Returns
The number of equations in the problem.
See also
GetCSPositionVelocityEqs, GetWorldPositionVelocityEqs

Definition at line 303 of file wcs.h.

◆ CS_WD_GET_SYSTEM_VAR_NAME

#define CS_WD_GET_SYSTEM_VAR_NAME (   id,
  wcs 
)    ((wcs)->isCS ? GetCSSystemVariableName(id,(wcs)->cs) : GetWorldSystemVarName(id,(wcs)->w))

Returns the name of a particular system variable. This is used to print the names of the variables used in several applications such as cuikplotpath, cuikplotforcefield, cuikplotatlas, etc.

Parameters
idThe index of the variable (over the system variables only).
wcsThe structure to query.

Definition at line 317 of file wcs.h.

◆ CS_WD_GET_NUM_SYSTEM_VARS

#define CS_WD_GET_NUM_SYSTEM_VARS (   wcs)    ((wcs)->isCS ? GetCSNumSystemVariables((wcs)->cs) : GetWorldNumSystemVariables((wcs)->w))

Number of system vars.

Parameters
wcsPointer to the equation set.
See also
GetCSNumSystemVars, GetWorldNumSystemVars

Definition at line 329 of file wcs.h.

◆ CS_WD_GET_VAR_TOPOLOGY

#define CS_WD_GET_VAR_TOPOLOGY (   varID,
  wcs 
)    ((wcs)->isCS ? GetCSVarTopology(varID,(wcs)->cs) : GetWorldVarTopology(varID,(wcs)->w))

Gets an array with the topology flag for each variable in the original system.

Parameters
varIDIdentifier of the variaable whose topology is required.
wcsPointer to the equation set.
See also
GetCSVarTopology, GetWorldVarTopology

Definition at line 343 of file wcs.h.

◆ CS_WD_REGENERATE_ORIGINAL_POINT

#define CS_WD_REGENERATE_ORIGINAL_POINT (   pr,
  p,
  o,
  wcs 
)    ((wcs)->isCS ? RegenerateOriginalPoint(pr,p,o,(wcs)->cs) : RegenerateWorldOriginalPoint(pr,p,o,(wcs)->w))

Compleates a point of the original system of equations from the values of the variables in the simplified system.

Parameters
prPointer to the set of parameters.
pPointer to the point.
oPointer where to store the results.
wcsPointer to the equation set.
See also
RegenerateOriginalPoint, RegenerateWorldOriginalPoint

Definition at line 359 of file wcs.h.

◆ CS_WD_INIT_CD

#define CS_WD_INIT_CD (   pr,
  mt,
  wcs 
)    { if (!(wcs)->isCS) InitWorldCD(pr,mt,(wcs)->w); }

Initializes the collision detector. This only has effects if we are operating over world structures (the cuiksystem do not have obstacle information).

Parameters
prThe set of parameters.
mtMaximum number of threads to check collision in parallel.
wcsPointer to the equation set.
See also
InitWorldCD

Definition at line 374 of file wcs.h.

◆ CS_ANY_COLLISION

#define CS_ANY_COLLISION (   wcs)    (((wcs)->isCS)?FALSE:AnyCollision((wcs)->w))

Determines if there is any collision to be checked.

Parameters
wcsPointer to the equation set.

Definition at line 384 of file wcs.h.

◆ CS_WD_TEST_COLLISION

#define CS_WD_TEST_COLLISION (   f,
  pr,
  all,
  s,
  sPrev,
  wcs 
)
Value:
{ if (((wcs)->isCS)||(!WorldCanCollide((wcs)->w))) f=FALSE; else { double *oPrev=NULL,*o; \
RegenerateWorldOriginalPoint(pr,s,&o,(wcs)->w);if ((sPrev!=NULL)&&(WorldContinuousCD((wcs)->w))) RegenerateWorldOriginalPoint(pr,sPrev,&oPrev,(wcs)->w); \
f=MoveAndCheckCD(pr,all,0,o,oPrev,(wcs)->w); \
free(o);if (oPrev!=NULL) free(oPrev);} \
}

Checks the collision status of a configuration.

Parameters
fOutput flag. TRUE if the configuration is in collision.
prPointer to the set of parameters.
allTRUE if we want to detect all collision. FALSE for only the first collision.
sPointer to the configuration in the simple system.
sPrevPointer to the previous configuration (also in the simple system). Only used for continuous collision detection.
wcsPointer to the set of equations and obstacles.
See also
RegenerateWorldOriginalPoint, MoveAndCheckCD

Definition at line 409 of file wcs.h.

◆ CS_WD_IN_COLLISION

#define CS_WD_IN_COLLISION (   f,
  pr,
  s,
  sPrev,
  wcs 
)    CS_WD_TEST_COLLISION(f,pr,FALSE,s,sPrev,wcs)

Determines the first collision of a configuration.

Parameters
fOutput flag. TRUE if the configuration is in collision.
prPointer to the set of parameters.
sPointer to the configuration in the simple system.
sPrevPointer to the previous configuration (also in the simple system). Only used for continuous collision detection.
wcsPointer to the set of equations and obstacles.
See also
RegenerateWorldOriginalPoint, MoveAndCheckCD

Definition at line 431 of file wcs.h.

◆ CS_WD_ALL_COLLISIONS

#define CS_WD_ALL_COLLISIONS (   f,
  pr,
  s,
  sPrev,
  wcs 
)    CS_WD_TEST_COLLISION(f,pr,TRUE,s,sPrev,wcs)

Determines all the collisions of a configuration.

Parameters
fOutput flag. TRUE if the configuration is in collision.
prPointer to the set of parameters.
sPointer to the configuration in the simple system.
sPrevPointer to the previous configuration (also in the simple system). Only used for continuous collision detection.
wcsPointer to the set of equations and obstacles.
See also
RegenerateWorldOriginalPoint, MoveAndCheckCD

Definition at line 449 of file wcs.h.

◆ CS_WD_ORIGINAL_IN_COLLISION

#define CS_WD_ORIGINAL_IN_COLLISION (   pr,
  o,
  oPrev,
  wcs 
)    (((wcs)->isCS)||(!WorldCanCollide((wcs)->w)) ? FALSE : MoveAndCheckCD(pr,FALSE,0,o,oPrev,(wcs)->w))

Determines if a configuration given in the original form is in collision.

This is typically used instead of CS_WD_IN_COLLISION when we already have the point in the original system (i.e., after using CS_WD_REGENERATE_ORIGINAL_POINT).

Parameters
prPointer to the set of parameters.
oPointer to the configuration in the original system.
oPrevPointer to the previous configuration in the original system. Only used for continuous collision detection.
wcsPointer to the set of equations and obstacles.
See also
CS_WD_IN_COLLISION, MoveAndCheckCD

Definition at line 473 of file wcs.h.

◆ CS_WD_COST_PTR

#define CS_WD_COST_PTR (   wcs)    ((wcs)->isCS ? (void *)((wcs)->cs) : (void *)((wcs)->w))

Returns the pointer to the base type. This is used as a parameter for the cost function.

See also
CS_WD_COST_FN

Definition at line 484 of file wcs.h.

◆ CS_WD_COST_FN

#define CS_WD_COST_FN (   wcs)    ((wcs)->isCS ? EvaluateCSCost : EvaluateWorldCost)

Gives the cost function used to evaluate a given set of configurations.

See also
EvaluateCSCost, EvaluateWorldCost

Definition at line 494 of file wcs.h.

◆ CS_WD_COST

#define CS_WD_COST (   pr,
  simp,
  p,
  wcs 
)    ((wcs)->isCS ? EvaluateCSCost(pr,simp,p,(void *)((wcs)->cs)) : EvaluateWorldCost(pr,simp,p,(void *)((wcs)->w)))

Computes the cost of a given set of configurations. In the world files the cost is defined using the "avoid limit" clause. In the cuik files it can be defined as an arbitrary equation invoving the problem variables.

Parameters
prPointer to the set of parameters.
simpTRUE if the point is in simplified form
pPointer to the point
wcsPointer to the set of equations.
See also
EvaluateCSCost, EvaluateWorldCost

Definition at line 512 of file wcs.h.

◆ CS_WD_GET_SIMP_TOPOLOGY

#define CS_WD_GET_SIMP_TOPOLOGY (   pr,
  tp,
  wcs 
)    ((wcs)->isCS ? GetSimpCSTopology(pr,tp,(wcs)->cs) : GetWorldSimpTopology(pr,tp,(wcs)->w))

Gets an array with the topology flag for each variable in the simplified system.

Parameters
prPointer to the set of parameters.
tpPointer to the array where to store the topology.
wcsPointer to the set of equations.
See also
CS_WD_GET_VAR_TOPOLOGY, GetSimpCSTopology, GetWorldSimpTopology

Definition at line 526 of file wcs.h.

◆ CS_WD_GET_TOPOLOGY

#define CS_WD_GET_TOPOLOGY (   pr,
  tp,
  wcs 
)    ((wcs)->isCS ? GetCSTopology(pr,tp,(wcs)->cs) : GetWorldTopology(pr,tp,(wcs)->w))

Gets an array with the topology flag for each variable in the system.

Parameters
prPointer to the set of parameters.
tpPointer to the array where to store the topology.
wcsPointer to the set of equations.
See also
CS_WD_GET_VAR_TOPOLOGY, GetCSTopology, GetWorldTopology

Definition at line 540 of file wcs.h.

◆ CS_WD_REGENERATE_SOLUTION_POINT

#define CS_WD_REGENERATE_SOLUTION_POINT (   pr,
  p,
  r,
  wcs 
)    ((wcs)->isCS ? RegenerateSolutionPoint(pr,p,r,(wcs)->cs) : RegenerateWorldSolutionPoint(pr,p,r,(wcs)->w))

Compleates a solution point including only values for the system variables with the values for the non-system (dummy) variables.

Parameters
prPointer to the set of parameters.
pPointer to the point.
rPointer to the array where to store the result.
wcsPointer to the set of equations.
See also
RegenerateSolutionPoint, RegenerateWorldSolutionPoint

Definition at line 556 of file wcs.h.

◆ CS_WD_GENERATE_SIMPLIFIED_POINT

#define CS_WD_GENERATE_SIMPLIFIED_POINT (   pr,
  p,
  r,
  wcs 
)    ((wcs)->isCS ? GenerateSimplifiedPoint(pr,p,r,(wcs)->cs) : WorldGenerateSimplifiedPoint(pr,p,r,(wcs)->w))

Generates a point in the simplified system from a point in the original system.

Parameters
prPointer to the set of parameters.
pPointer to the point.
rPointer to where to store the result.
wcsPointer to the set of equations.
See also
GenerateSimplifiedPoint, WorldGenerateSimplifiedPoint

Definition at line 571 of file wcs.h.

◆ CS_WD_ERROR_IN_SIMP_EQUATIONS

#define CS_WD_ERROR_IN_SIMP_EQUATIONS (   pr,
  p,
  wcs 
)    ((wcs)->isCS ? ErrorInSimpCSEquations(pr,p,(wcs)->cs) : WorldErrorInSimpEquations(pr,p,(wcs)->w))

Computes the error in the simplified system for a given point.

Parameters
prPointer to the set of parameters.
pPointer to the point.
wcsPointer to the set of equations.
See also
ErrorInSimpCSEquations, WorldErrorInSimpEquations

Definition at line 585 of file wcs.h.

◆ CS_WD_ERROR_IN_EQUATIONS

#define CS_WD_ERROR_IN_EQUATIONS (   pr,
  p,
  wcs 
)    ((wcs)->isCS ? ErrorInCSEquations(pr,p,(wcs)->cs) : WorldErrorInEquations(pr,p,(wcs)->w))

Computes the error in the for a given point. The difference with respect to CS_WD_ERROR_IN_SIMP_EQUATIONS is that here the point in not simplified.

Parameters
prThe parameters.
pPointer to the point.
wcsPointer to the set of equations.
See also
ErrorInCSEquations, WorldErrorInEquations

Definition at line 601 of file wcs.h.

◆ CS_WD_GENERATE_SIMP_INITIAL_BOX

#define CS_WD_GENERATE_SIMP_INITIAL_BOX (   pr,
  b,
  wcs 
)    { if ((wcs)->isCS) GenerateSimpInitialBox(pr,b,(wcs)->cs); else GetWorldSimpInitialBox(pr,b,(wcs)->w); }

Computes a box with the valid range for the variables of the simplifed system.

Parameters
prPointer to the set of parameters.
bPointer to the output box.
wcsPointer to the set of equations.
See also
GenerateSimpInitialBox, GetWorldSimpInitialBox

Definition at line 615 of file wcs.h.

◆ CS_WD_GET_SIMP_JACOBIAN

#define CS_WD_GET_SIMP_JACOBIAN (   pr,
  J,
  wcs 
)    { if ((wcs)->isCS) GetSimpCSJacobian(pr,J,(wcs)->cs); else GetWorldSimpJacobian(pr,J,(wcs)->w); }

Computes the symbolic Jacobian of the simplified system.

Parameters
prPointer to the set of parameters.
JPointer to the Jacobian.
wcsPointer to the set of equations.
See also
GetSimpCSJacobian, GetWorldSimpJacobian

Definition at line 629 of file wcs.h.

◆ CS_WD_GET_SIMP_NJACOBIAN

#define CS_WD_GET_SIMP_NJACOBIAN (   pr,
  nJ,
  wcs 
)    ((wcs)->isCS?GetSimpCSNJacobian(pr,nJ,(wcs)->cs):GetWorldSimpNJacobian(pr,nJ,(wcs)->w))

Defines the structure.

Parameters
prPointer to the set of parameters.
nJPointer to the numerical structure to create.
wcsPointer to the set of equations.
Returns
TRUE if the structure is actually created (it can only be created on particular systems).
See also
GetSimpCSNJacobian, GetWorldSimpNJacobian

Definition at line 645 of file wcs.h.

◆ CS_WD_GET_SIMP_NHESSIAN

#define CS_WD_GET_SIMP_NHESSIAN (   pr,
  sJ,
  nH,
  wcs 
)    ((wcs)->isCS?GetSimpCSNHessian(pr,sJ,nH,(wcs)->cs):GetWorldSimpNHessian(pr,sJ,nH,(wcs)->w))

Defines the structure.

Parameters
prPointer to the set of parameters.
sJThe Jacobian for the position scalar equations.
nHPointer to the numerical structure to create.
wcsPointer to the set of equations.
Returns
TRUE if the structure is actually created (it can only be created on particular systems).
See also
GetSimpCSNHessian, GetWorldSimpNHessian

Definition at line 662 of file wcs.h.

◆ CS_WD_MANIFOLD_DIMENSION

#define CS_WD_MANIFOLD_DIMENSION (   pr,
  p,
  wcs 
)    ((wcs)->isCS ? ManifoldDimension(pr,p,(wcs)->cs) : WorldManifoldDimension(pr,p,(wcs)->w))

Computes the dimension of the solution set assuming that we have a regular solution point.

Parameters
prPointer to the set of parameters.
pThe regular solution point (in the original form, not in the simplified).
wcsPointer to the set of equations.

Definition at line 675 of file wcs.h.

◆ CS_WD_NEWTON_IN_SIMP

#define CS_WD_NEWTON_IN_SIMP (   pr,
  p,
  wcs 
)    ((wcs)->isCS ? CuikNewtonSimp(pr,p,(wcs)->cs) : WorldSimpCuikNewton(pr,p,(wcs)->w))

Applies a Newton procedure to move a point towads the manifold defined by the equations.

Parameters
prPointer to the set of parameters.
pPointer to the point.
wcsPointer to the set of equations.
See also
CuikNewtonSimp, WorldSimpCuikNewton

Definition at line 689 of file wcs.h.

◆ CS_WD_HAS_VELOCITY

#define CS_WD_HAS_VELOCITY (   pr,
  wcs 
)    ((wcs)->isCS ? CuikHasVelocity(pr,(wcs)->cs) : WorldHasVelocity(pr,(wcs)->w))

Determines if the problem includes velocity variables and equations.

Parameters
prPointer to the set of parameters.
wcsPointer to the set of equations.

Definition at line 700 of file wcs.h.

◆ CS_WD_DELETE

#define CS_WD_DELETE (   wcs)    { if ((wcs)->isCS) { DeleteCuikSystem((wcs)->cs); free((wcs)->cs); } else { DeleteWorld((wcs)->w); free((wcs)->w); } }

Releases the memory used to store the equation structure.

Parameters
wcsPointer to the set of equations.
See also
DeleteCuikSystem, DeleteWorld

Definition at line 712 of file wcs.h.

Function Documentation

◆ InitCSWDFromFile()

void InitCSWDFromFile ( Tparameters pr,
char *  name,
TAtlasBase wcs 
)

Initializes the equations from a file. First we try to read the equations from cuik file. If this fails, we try to read them from a world file. If not possible, we trigger and error.

The cuik files are typically derived from the world ones (using cuikequations). So if the cuik file has been generated, then it probably means you want to work with it. Otherwise just delete (or rename) it and we will read the world file instead.

We have two main set of equation. One (the original system) is the one as given in the given file. The other (the simplified system) is the same after introducing trivial simplifications (removing variables with constant values, replacing variables by equivalent ones,...). Typically we operate with the simplified system but input and output points are given in the original system. Therefore we have to translate between them when necessary. But this is out of the scope of this function.

See also
InitCuikSystemFromFile, InitWorldFromFile

Definition at line 599 of file chart.c.

References CreateFileName(), TAtlasBase::cs, CUIK_EXT, DeleteFileName(), FALSE, GetFileFullName(), InitCuikSystemFromFile(), InitWorldFromFile(), TAtlasBase::isCS, NEW, TRUE, and TAtlasBase::w.

Referenced by main().