dynamics.h File Reference IntroductionFunctions related with dynamics. They are used to implement the planning with dynamical constraints. Definition in file dynamics.h.
Macro Definition Documentation◆ DEBUG_DYNAMICS
Set to 1 to print information about the dynamic procedures. Definition at line 32 of file dynamics.h. ◆ PRINT_J
If set we print information on the optimal LQR policy cost as computed for each time. This is an extra debug flag. Definition at line 41 of file dynamics.h. ◆ MAX_J
If set we define a maximum J in LQRComputePolicy (or LQRComputePolicy_t): The optimal cost computed in this function is only accepted if it is below maxJ. This is experimental and for normal operation should be 0. Definition at line 52 of file dynamics.h. ◆ DEBUG_HandC
Set to 1 to print information about the HandC execution. We print detailed information to facilitate the comparison with the Matlab code. Definition at line 60 of file dynamics.h. ◆ HandC_Thread
When debugging HandC we only print information about one of the threads running in parallel Definition at line 68 of file dynamics.h. ◆ HandC_FJH
If set, the position Function/Jacobian/Hessian used to find out the acceleration is computed in HandC, re-using other computations. Otherwise it is computed from the system Jacobian. Note that we do not compute exactly the same Jacobian matrix but matrices that expand the same linear sub-space. Typically the HandC computations are significantly faster. Definition at line 81 of file dynamics.h. ◆ DEBUG_HandC_FJH
If set we print the Jacobian/Hessian computed in HandC and the Jacobian evaluated from the equations. Note that, if set, the HandC Jacobian is computed but not used (the one from the equations is stored in the corresponding matrices overwritting the HandC computations). NOTE: To get exactly the same jacobian in both cases you should deactivate the SIMPLIFY_TS flag in trans_seq.h Used only for debug. Definition at line 97 of file dynamics.h. ◆ HandC_EQ_INV
If set, the equation generated in HandC for each loop is A*B^-1, where A and B are alternative transforms to the loop closure link (transfroms computed from alternative paths from the root to the link). If not set, the loop equations are computed as A-B. Used only for experimentation. Typically this should be 1. Definition at line 111 of file dynamics.h. ◆ START_BROYDEN_ON_MANIFOLD
If set the Broyden iteration is started froma point in the manifold: we use Euler in tangent space and then we project to the manifold. Otherwise we directly use Euler in ambient space and the initial point is not on the manifold. Used only for experimentation. Typicaly this should be 0. Definition at line 123 of file dynamics.h. ◆ USE_HTxSAV
If set, the product of homogenous transforms and spatial algebra vectors is performed without explicitly defining the spatial algebra matrix corresponding to the transform. Definition at line 132 of file dynamics.h. ◆ EXPLICIT_CRM
If set, we explicitly build the CRM 6x6 matrix. Otherwise, we direclty use the CRMxSAV method (which is supposed to be faster). Definition at line 140 of file dynamics.h. ◆ EXPLICIT_CRF
If set, we explicitly build the CRF 6x6 matrix. Otherwise, we direclty use the CRFxSAM method (which is supposed to be faster, but it is not). Definition at line 149 of file dynamics.h. ◆ USE_XUPTR
If set, Xup is also defined as an homogeneous transform. In this way, we can choose whether to use the homogenous transform or the spatial algebre matrix, depending on the case. Definition at line 158 of file dynamics.h. ◆ CUT_AT_LINK
If set, the kinematic tree used in HandC cuts the loops in the middle of some links and not in a joint. In this way all joints apperar in the kinematic tree. Definition at line 167 of file dynamics.h. ◆ EULER_LQR_COMPUTE_POLICY
We can select the integration methods to be used in LQRComputePolicy. We can chose Euler (1), fast but innacurate in the long term or Runge-Kutta 4 (0). Definition at line 176 of file dynamics.h. ◆ LQR_COMPUTE_POLICY
Use the time-based (closed-form expressions) procedure. Definition at line 184 of file dynamics.h. ◆ SATURATE_ACTIONS
If set, actions computed with an LQR policy are saturated to the maximum value set by the user (in the world file). If set to 0, actions are not saturated. This should be 1 and only set to 0 for debugging purposes. If set to zero, we assume that we are performing an LQR steering test and we deactivate many options. Definition at line 207 of file dynamics.h. ◆ RANDOM_DYNAMIC_ACTION
If set, the actions are selected randomly, otherwise bang-bang control is used. Definition at line 214 of file dynamics.h. ◆ T2G_METRIC_NN_EXTEND
When defining an RRT in a problem with dynamics, we can use time to go metric instead than the Euclidean metric. Only a first order approximation of the time to go is computed (see Time2Go) and the computation is slow, but it is supposed to give more effective RRT extensions. This is only active in dynamical systems and when NN_IN_CHART is active. In particular this flag determines if Time2Go metric is to be used when looking for nearest neighbours when extending the RRT. Definition at line 232 of file dynamics.h. ◆ T2G_METRIC_NN_CONNECT
The same as T2G_METRIC_NN_EXTEND but this determines if Time2Go metric is to be used when looking for nearest neighbours when trying to connect trees. Definition at line 241 of file dynamics.h. ◆ T2G_METRIC_INSIDE_EXTEND
If T2G_METRIC_NN_EXTEND is active, we can additionally use the Time2Go metric inside the extension (to determine reachability sets and alike). Definition at line 250 of file dynamics.h. ◆ T2G_METRIC_INSIDE_CONNECT
If T2G_METRIC_NN_CONNECT is active, we can additionally use the Time2Go metric inside the connection (to determine reachability sets and alike). Definition at line 259 of file dynamics.h. ◆ T2G_METRIC
TRUE if any of the time2go flatgs is active. Defined for convenience. Definition at line 267 of file dynamics.h. ◆ DYNAMICS_ONE_ACTION_EXTEND
In some modes (specially when using T2G_METRIC) it makes sense to execute just one action (generated at random or computed as you which) instead of simulating several candidate actions and selecting the best one. In paticular this flag is used for the extension of the RRT (when aiming at a random sample). This is typically active only when T2G_METRIC_NN_EXTEND is also active. Definition at line 284 of file dynamics.h. ◆ DYNAMICS_ONE_ACTION_CONNECT
The same as DYNAMICS_ONE_ACTION_EXTEND but used when trying to connect the two trees. This is typically active only when T2G_METRIC_NN_CONNECT is also active. Definition at line 295 of file dynamics.h. Typedef Documentation◆ Tintegrator
Numerical integration function. Currently we have implemented the Euler and the RK4 methods. See NextDynamicStateEuler or NextDynamicStateRK4 for an explanation of the function parameters. Definition at line 597 of file dynamics.h. Function Documentation◆ InitDynamicSpace()
Initializes the space to be used when computing the acceleration and during the integration.
Definition at line 2180 of file dynamics.c. References TDynamicSpace::A, TDynamicSpace::a2j, TDynamicSpace::a2x, TDynamicSpace::A_ID, TDynamicSpace::A_LQR, TDynamicSpace::action, ActuatedJoint(), AllocateHessianEvaluationAsVectors(), TDynamicSpace::B, TDynamicSpace::bJ, TDynamicSpace::bJp, TDynamicSpace::cJ, CopyNonDynamicsJacobian(), CopyPositionJacobian(), CS_WD_GENERATE_SIMP_INITIAL_BOX, CS_WD_GET_POSITION_EQS, CS_WD_GET_POSITION_VARS, CS_WD_GET_POSITION_VELOCITY_EQS, CS_WD_GET_POSITION_VELOCITY_VARS, CS_WD_GET_SIMP_NHESSIAN, CS_WD_GET_SIMP_NJACOBIAN, CS_WD_GET_SIMP_TOPOLOGY, CT_N_DOF, CT_REPRESENTATION, CT_TAU, TDynamicSpace::d0_LQR, TDynamicSpace::d_LQR, TDynamicSpace::da, TDynamicSpace::dG_LQR, TDynamicSpace::dGtemp_LQR, TDynamicSpace::dof, TDynamicSpace::domain, TDynamicSpace::dr_LQR, TDynamicSpace::eA_LQR, TDynamicSpace::effort, Error(), FALSE, TDynamicSpace::fe, TDynamicSpace::fE_LQR, TDynamicSpace::g, TDynamicSpace::G_LQR, TDynamicSpace::gamma, TDynamicSpace::Gd, GET_WORLD, GetBroydenMatrixBuffer(), GetBroydenRHBuffer(), GetJacobianSize(), GetJointCost(), GetJointDOF(), GetJointEffort(), GetLSMatrixBuffer(), GetLSRHBuffer(), GetLSSolutionBuffer(), GetParameter(), GetScalarJacobian(), GetWorldActionDimension(), GetWorldJoint(), GetWorldLink(), GetWorldNJoints(), GetWorldNLinks(), TDynamicSpace::gn, TDynamicSpace::Gnew_LQR, TDynamicSpace::Gtemp_LQR, TDynamicSpace::gy, TDynamicSpace::Hp, TDynamicSpace::Hpv, IdentityMatrix(), InitBroyden(), InitHandC(), InitHessian(), InitLS(), TDynamicSpace::iR, TDynamicSpace::iRBt, TDynamicSpace::J, TDynamicSpace::j, TDynamicSpace::Joo, TDynamicSpace::Jop, TDynamicSpace::Jot, TDynamicSpace::Jp, TDynamicSpace::k1, TDynamicSpace::k2, TDynamicSpace::k3, TDynamicSpace::l, TDynamicSpace::lsSize, TDynamicSpace::lsSize_ID, TDynamicSpace::lsSize_LQR, TDynamicSpace::mA, TDynamicSpace::mA_ID, TDynamicSpace::mA_LQR, TDynamicSpace::mAt, TDynamicSpace::mB, TDynamicSpace::Mm, TDynamicSpace::ndxOE, TDynamicSpace::ndxOV, TDynamicSpace::ndxPE, TDynamicSpace::ndxPV, TDynamicSpace::ndxVE, TDynamicSpace::ndxVV, TDynamicSpace::ne, NEW, TDynamicSpace::nHp, TDynamicSpace::nie, TDynamicSpace::nipe, TDynamicSpace::nj, TDynamicSpace::nJp, TDynamicSpace::nl, TDynamicSpace::noe, TDynamicSpace::nov, TDynamicSpace::npe, TDynamicSpace::npv, NumLoops(), TDynamicSpace::nv, TDynamicSpace::o, TDynamicSpace::oEqs, ON_CUIKSYSTEM, TDynamicSpace::P, TDynamicSpace::parallel, TDynamicSpace::pe, TDynamicSpace::pEqs, TDynamicSpace::pos, TDynamicSpace::pVars, TDynamicSpace::pvEqs, TDynamicSpace::pvVars, TDynamicSpace::Qa, TDynamicSpace::qdd, TDynamicSpace::r_LQR, RC2INDEX, REP_JOINTS, TDynamicSpace::rhsA, TDynamicSpace::rhsA_ID, TDynamicSpace::rhsA_LQR, TDynamicSpace::rnew_LQR, TDynamicSpace::rtemp_LQR, TDynamicSpace::selEqs, TDynamicSpace::sHp, TDynamicSpace::sJ, TDynamicSpace::sJoo, TDynamicSpace::sJop, TDynamicSpace::sJp, TDynamicSpace::solA, TDynamicSpace::solA_ID, TDynamicSpace::solA_LQR, TOPOLOGY_S, TDynamicSpace::tp, TRUE, TDynamicSpace::vel, TDynamicSpace::w, TDynamicSpace::x0_LQR, TDynamicSpace::x_LQR, TDynamicSpace::xa, TDynamicSpace::y, and TDynamicSpace::y_LQR. Referenced by InitAtlasRRT(), kinobiRRT(), kinoEST(), kinoRRT(), LoadAtlasRRT(), and main(). ◆ Getxdot()
Computes the derivative of a state. This includes the velocity, the acceleration and the derivative of the non-dynamic equations.
Definition at line 2598 of file dynamics.c. References ComputeAcceleration(), FALSE, TDynamicSpace::g, and TDynamicSpace::nv. Referenced by AtlasRRTValidateSample(), and main(). ◆ GetInverseActionCostMatrix()
Returns a pointer to the invers of the matrix weighting the cost of each action in the LQR used a sterring method.
Definition at line 2607 of file dynamics.c. References TDynamicSpace::iR. Referenced by UpdateLQRPolicy(). ◆ Time2Go()
Linear approximation of the time to go from a given state to another one. This is implemented with the aim of improving the nearest-neighbour metric in RRTs. The information is better than the one given by a simple Euclidean metric but it is significantly slower to compute and it is only a first order approximation. This is inspired in the derivation included in "An RRT-Based Algorithm for Testing and Validating Multi-Robot Controllers" by J. Kim, J. M. Esposito, and V. Kumar Robotics Science and Systems 2001. The main difference is that we have a constraint manifold and, thus, we compute the time to go in tangent space. Consequently, we can only compute it for samples in the same tangent space (sharing the same local parameterization). The time to go is computed as with d the distance between the goal and the current position and r the decrease ration of this distance. 'd' is computed as the Euclidean distance (between parameterizations). 'r' is more difficult to estimate. Actually an exact value for 'r' is as difficult as finding the solution to the two point boundary value problem (TPBVP) between the departing and the goal states. In general the TPBVP is hard and, thus we only find an approximation to the solution. This approximation is based on a linear approximation of the time to go evaluated at the departing state If 'd' is the Euclidean distance with . Moreover Thus, and In this context . We need to estimate . Probably the easiest estimation is to take it as 0. An alternative is to use the acceleration resulting from u=0 (null action). Yet another option is to select the action which results in lower time2go. This optimization can be approximated via sampling in the space of actions or computed in closed form via linear programming if can be expressed in linear form with respect to the actions (this is not implemented yet). Finally, note that we compute the time to go in the parameter space (in this way v, makes some sense). Thus, 'x' is actually 't' and is the second half of 't' (the one giving the velocity parameters).
Definition at line 2612 of file dynamics.c. References TDynamicSpace::action, ComputeAcceleration(), CT_EPSILON, TDynamicSpace::da, DifferenceVector(), TDynamicSpace::dof, FALSE, TDynamicSpace::g, GeneralDotProduct(), GetChartTangentSpace(), GetParameter(), INF, NEW, TDynamicSpace::nie, Norm(), TDynamicSpace::nv, and TMatrixVectorProduct(). Referenced by AddBranchToAtlasDynamicRRT(), GetRRTNNInChart(), and Time2GoNNToTree(). ◆ ApproachState()
Simulates different actions with the aim of approaching a given goal state and identifies the action that approaches most to the goal.
Definition at line 2687 of file dynamics.c. References CT_DELTA, CT_INTEGRATION_TIME, CT_N_DYNAMIC_ACTIONS, TDynamicSpace::da, DeleteTrajectory(), DistanceTopology(), GetActionFromID(), GetParameter(), INF, NEW, NumericIntegration(), TDynamicSpace::nv, randomDouble(), and TDynamicSpace::tp. Referenced by kinobiRRT(), and kinoRRT(). ◆ kinoRRT()
Adds as many branches as necessary to the RRT (using AddBranchToRRT) until a targed configuration is reached (approached at a small distance). The tree extension is performed using the strategy defined in Dalibard, S., Nakhaei, A., Lamiraux, F., and Laumond, J.-P. (2009). Whole-body task planning for a humanoid robot: a way to integrate collision avoidance. In IEEE-RAS International Conference on Humanoid Robots, pages 355-360.
Definition at line 2749 of file dynamics.c. References AddNodeToRRT(), ApproachState(), CS_WD_ERROR_IN_SIMP_EQUATIONS, CS_WD_GENERATE_SIMPLIFIED_POINT, CS_WD_GET_SIMP_JACOBIAN, CS_WD_ORIGINAL_IN_COLLISION, CS_WD_REGENERATE_SOLUTION_POINT, CS_WD_SIMP_INEQUALITIES_HOLD, CT_DELTA, CT_DYNAMIC_GOAL_ERROR, CT_EPSILON, CT_MAX_NODES_RRT, CT_MAX_PLANNING_TIME, CT_SAMPLING, TDynamicSpace::da, DeleteDynamicSpace(), DeleteJacobian(), DeleteStatistics(), DeleteTrajectory(), DistanceTopology(), TDynamicSpace::domain, Error(), EXPLORATION_RRT, FALSE, GetElapsedTime(), GetParameter(), GetRRTMode(), GetRRTNode(), GetRRTNumNodes(), INF, InitDynamicSpace(), InitStatistics(), TDynamicSpace::ne, NEW, NO_UINT, TDynamicSpace::nv, ONE_TREE, PathStart2GoalInRRT(), PointInBoxTopology(), PointInRRT(), RRT_VERBOSE, RRTSample(), RRTValidateSample(), START2GOAL, TDynamicSpace::tp, TRUE, and Warning(). Referenced by main(). ◆ kinobiRRT()
Adds as many branches as necessary to the RRT (using AddBranchToRRT) until a targed configuration is reached (approached at a small distance). The tree extension is performed using the strategy defined in Dalibard, S., Nakhaei, A., Lamiraux, F., and Laumond, J.-P. (2009). Whole-body task planning for a humanoid robot: a way to integrate collision avoidance. In IEEE-RAS International Conference on Humanoid Robots, pages 355-360.
Definition at line 2898 of file dynamics.c. References AddNodeToRRT(), ApproachState(), CS_WD_ERROR_IN_SIMP_EQUATIONS, CS_WD_GENERATE_SIMPLIFIED_POINT, CS_WD_GET_SIMP_JACOBIAN, CS_WD_ORIGINAL_IN_COLLISION, CS_WD_REGENERATE_SOLUTION_POINT, CS_WD_SIMP_INEQUALITIES_HOLD, CT_DELTA, CT_DYNAMIC_GOAL_ERROR, CT_EPSILON, CT_MAX_NODES_RRT, CT_MAX_PLANNING_TIME, CT_SAMPLING, TDynamicSpace::da, DeleteDynamicSpace(), DeleteJacobian(), DeleteStatistics(), DeleteTrajectory(), DistanceTopology(), TDynamicSpace::domain, Error(), FALSE, GetElapsedTime(), GetParameter(), GetRRTMode(), GetRRTNN(), GetRRTNode(), GetRRTNumNodes(), GOAL2START, INF, InitDynamicSpace(), InitStatistics(), TDynamicSpace::ne, NEW, TDynamicSpace::nv, PathStart2GoalInRRT(), PointInBoxTopology(), PointInRRT(), RRT_VERBOSE, RRTSample(), RRTValidateSample(), START2GOAL, TDynamicSpace::tp, TRUE, TWO_TREES, and Warning(). Referenced by main(). ◆ kinoEST()
Adds as many branches as necessary to the EST (using AddBranchToRRT) until a targed configuration is reached (approached at a small distance). The tree extension is performed using the strategy defined in HSU et al.
Definition at line 3096 of file dynamics.c. References AddNodeToRRT(), CS_WD_ERROR_IN_SIMP_EQUATIONS, CS_WD_GENERATE_SIMPLIFIED_POINT, CS_WD_GET_SIMP_JACOBIAN, CS_WD_ORIGINAL_IN_COLLISION, CS_WD_REGENERATE_SOLUTION_POINT, CS_WD_SIMP_INEQUALITIES_HOLD, CT_DELTA, CT_DYNAMIC_GOAL_ERROR, CT_EPSILON, CT_GAMMA, CT_INTEGRATION_TIME, CT_MAX_NODES_RRT, CT_MAX_PLANNING_TIME, CT_N_DYNAMIC_ACTIONS, TDynamicSpace::da, DeleteDynamicSpace(), DeleteJacobian(), DeleteStatistics(), DeleteTrajectory(), DistanceTopology(), TDynamicSpace::domain, Error(), FALSE, GetActionFromID(), GetElapsedTime(), GetParameter(), GetRRTMode(), GetRRTNNInBall(), GetRRTNode(), GetRRTNodeCost(), GetRRTNumNodes(), InitDynamicSpace(), InitStatistics(), TDynamicSpace::ne, NEW, NO_UINT, NumericIntegration(), TDynamicSpace::nv, ONE_TREE, PathStart2GoalInRRT(), PointInBoxTopology(), PointInRRT(), randomDouble(), randomMax(), RRT_VERBOSE, SetRRTNodeCost(), START2GOAL, TDynamicSpace::tp, TRUE, and Warning(). Referenced by main(). ◆ MechEnergy()
This replicates part of the the EnerMo function in the code by Featherstone.
Definition at line 1918 of file dynamics.c. References TDynamicSpace::a_grav, TDynamicSpace::auxSAM1, TDynamicSpace::auxSAM2, TDynamicSpace::auxSAV1, copySAM(), copySAV(), DeleteLinkTransforms(), GeneralDotProduct(), GetConnectionLinkPotentialEnergy(), GetJointBasicTransform(), GetLinkTransformsFromSolutionPoint(), HTransform2SAM(), HTransformCopy(), HTransformProduct(), HTransformXSAV(), TDynamicSpace::IC, TDynamicSpace::IM, IsConnectionSpring(), TDynamicSpace::j, TDynamicSpace::j2x, TDynamicSpace::jID, TDynamicSpace::jSgn, TDynamicSpace::l, TDynamicSpace::lID, MatrixMatrixProduct(), MatrixVectorProduct(), TDynamicSpace::nef, TDynamicSpace::njx, TDynamicSpace::nlHC, NO_UINT, TDynamicSpace::npv, TDynamicSpace::nv, TDynamicSpace::pLink, PrintMatrix(), PrintVector(), rbi2mci(), TDynamicSpace::S, SAMxSAM(), SAMxSAV(), SAVxSAV(), ScaleVector(), sumSAM(), sumSAV(), TRUE, TSAMxSAM(), TDynamicSpace::v, TDynamicSpace::vJ, TDynamicSpace::wo, TDynamicSpace::XJ, TDynamicSpace::Xtree, and TDynamicSpace::Xup. Referenced by main(). ◆ ComputeInverseDynamics()
Computes the input u for the inverse dynamics of a closed kinematic chain.
Definition at line 3270 of file dynamics.c. References TDynamicSpace::A_ID, CT_EPSILON, TDynamicSpace::da, Error(), EvaluatePermutation(), FALSE, GetParameter(), GetPositionJacobian(), HandC(), TDynamicSpace::Jp, TDynamicSpace::lsSize_ID, LSSolve(), TDynamicSpace::mA_ID, MatrixVectorProduct(), TDynamicSpace::Mm, TDynamicSpace::ndxPV, TDynamicSpace::nipe, TDynamicSpace::npv, TDynamicSpace::P, TDynamicSpace::pos, TDynamicSpace::Qa, TDynamicSpace::rhsA_ID, TDynamicSpace::solA_ID, SubMatrixFromMatrix(), SubMatrixFromTMatrix(), and SubtractVector(). Referenced by ConnectDynamicStatesID(), and NextDynamicState(). ◆ NextDynamicState()
Computes next state using the implicit trapezoid method.
Definition at line 3321 of file dynamics.c. References TDynamicSpace::a2j, AccumulateVector(), TDynamicSpace::action, TDynamicSpace::B, BroydenStep(), BroydenUpdateJacobian(), Chart2Manifold(), ComputeAcceleration(), ComputeInverseDynamics(), CT_EPSILON, CT_MAX_NEWTON_ITERATIONS, CT_NEG_LM, TDynamicSpace::da, TDynamicSpace::dof, DynamicStepCtResidue(), DynamicStepResidue(), TDynamicSpace::effort, FALSE, TDynamicSpace::fe, TDynamicSpace::g, GetChartCenter(), GetChartTangentSpace(), GetParameter(), TDynamicSpace::gn, GOAL2START, TDynamicSpace::gy, IdentityMatrix(), INF, TDynamicSpace::J, TDynamicSpace::mB, TDynamicSpace::ndxPV, NextDynamicStateLocalRK4(), TDynamicSpace::nie, TDynamicSpace::nipe, Norm(), TDynamicSpace::npv, TDynamicSpace::nv, PrintMatrix(), PrintTMatrix(), PrintVector(), ResetBroyden(), TDynamicSpace::sJ, SubMatrixFromMatrix(), SubMatrixFromTMatrix(), SumVectorScale(), TMatrixVectorProduct(), TDynamicSpace::tp, TRUE, ValidState(), and TDynamicSpace::xa. Referenced by ConnectDynamicStates(), ConnectDynamicStatesID(), and NewTemptativeSample(). ◆ NextDynamicStateLocalEuler()
Computes next state using the explicit Euler method in local coordinates. The difference with respect NextDynamicStateEuler is that here the final point is foced to be on the manifold. The Euler method is applied in local coordinates the final parameter is projected to the manifold.
Definition at line 3509 of file dynamics.c. References Chart2Manifold(), ComputeAcceleration(), CT_NEG_LM, TDynamicSpace::dof, FALSE, TDynamicSpace::g, GetChartTangentSpace(), GetParameter(), GOAL2START, TDynamicSpace::gy, INF, NextDynamicStateEuler(), TDynamicSpace::nie, Norm(), TDynamicSpace::nv, TDynamicSpace::sJ, SumVectorScale(), TMatrixVectorProduct(), TDynamicSpace::tp, ValidState(), and TDynamicSpace::y. Referenced by NewTemptativeSample(), and NextDynamicStateLocalRK4(). ◆ NextDynamicStateLocalRK4()
Computes next state using the explicit RK4 method in local coordinates. The difference with respect NextDynamicStateRK4 is that here the final point is foced to be on the manifold. The RK4 method is applied in local coordinates the final parameter is projected to the manifold.
Definition at line 3562 of file dynamics.c. References Chart2Manifold(), ComputeAcceleration(), CT_NEG_LM, TDynamicSpace::dof, FALSE, TDynamicSpace::g, GetChartTangentSpace(), GetParameter(), GOAL2START, TDynamicSpace::gy, INF, TDynamicSpace::k1, TDynamicSpace::k2, TDynamicSpace::k3, NextDynamicStateLocalEuler(), NextDynamicStateRK4(), TDynamicSpace::nie, Norm(), TDynamicSpace::nv, TDynamicSpace::sJ, SumVector(), SumVectorScale(), TMatrixVectorProduct(), TDynamicSpace::tp, TRUE, ValidState(), and TDynamicSpace::y. Referenced by NewTemptativeSample(), and NextDynamicState(). ◆ NextDynamicStateEuler()
Computes next state using forward Euler method.
Definition at line 3654 of file dynamics.c. References ComputeAcceleration(), CT_NEG_LM, FALSE, TDynamicSpace::g, GetParameter(), GOAL2START, INF, Norm(), TDynamicSpace::nv, SumVectorScale(), and ValidState(). Referenced by main(), NewTemptativeSample(), and NextDynamicStateLocalEuler(). ◆ NextDynamicStateRK4()
Computes next state using 4th order Runge-Kutta.
Definition at line 3696 of file dynamics.c. References ComputeAcceleration(), CT_NEG_LM, FALSE, TDynamicSpace::g, GetParameter(), GOAL2START, INF, TDynamicSpace::k1, TDynamicSpace::k2, TDynamicSpace::k3, Norm(), TDynamicSpace::nv, SumVector(), SumVectorScale(), TRUE, and ValidState(). Referenced by main(), NewTemptativeSample(), and NextDynamicStateLocalRK4(). ◆ NumericIntegration()
Computes the state after some time using a given numerical procedure to approximte the average acceleration in the given time interval. During the integration we check for possible non-valid dynamic states (this is actually done in the intFunction) and possible collisions with obstacles. In this case, the integration is stopped before compleating the given integration time.
Definition at line 3756 of file dynamics.c. References AddStep2Trajectory(), CS_WD_IN_COLLISION, CT_EPSILON, TDynamicSpace::da, DistanceTopology(), TDynamicSpace::domain, FALSE, GetParameter(), INF, InitTrajectory(), NEW, TDynamicSpace::nv, PointInBoxTopology(), TDynamicSpace::tp, TRUE, and TDynamicSpace::w. Referenced by ApproachState(), kinoEST(), and Simulate(). ◆ Simulate()
Dynamic simulation from a given point applying a given action for the integration time fixed in the paremeter structure using the Euler method
Definition at line 3837 of file dynamics.c. References ActionSpaceDimension(), AddStep2Trajectory(), CS_WD_GENERATE_SIMPLIFIED_POINT, CS_WD_GET_SYSTEM_VARS, CS_WD_INIT_CD, CS_WD_REGENERATE_ORIGINAL_POINT, CS_WD_REGENERATE_SOLUTION_POINT, CT_DELTA, CT_INTEGRATION_TIME, Error(), FALSE, GetParameter(), InitTrajectory(), NEW, NumericIntegration(), TDynamicSpace::nv, START2GOAL, and TDynamicSpace::w. Referenced by main(). ◆ LinearizeDynamics()
Computes the matrices of the linear system and store them in the chart info. Note that the linearization is made around the zero input trajectory.
Definition at line 3921 of file dynamics.c. References TDynamicSpace::action, Chart2Manifold(), ComputeAcceleration(), CT_EPSILON, TDynamicSpace::da, TDynamicSpace::dof, FALSE, TDynamicSpace::fE_LQR, TDynamicSpace::g, GetParameter(), NEW, TDynamicSpace::nie, TDynamicSpace::nv, TDynamicSpace::parallel, PrintMatrix(), PrintVector(), ScaleVector(), SetColumn(), TDynamicSpace::sJ, SubtractVector(), TMatrixVectorProduct(), TDynamicSpace::tp, TDynamicSpace::x0_LQR, TDynamicSpace::x_LQR, and TDynamicSpace::y_LQR. Referenced by UpdateLQRPolicy(). ◆ LQRComputePolicy()
Determines an open loop LQR policy in parameter spac, i.e., find sthe optimal u(t) that connects the initial y0 with the random sample y1 for the linear system of the form y_dot = A*y+B*u+C
Definition at line 4091 of file dynamics.c. References TDynamicSpace::A_LQR, CT_DELTA, CT_TAU, TDynamicSpace::d_LQR, TDynamicSpace::da, dG(), TDynamicSpace::dG_LQR, TDynamicSpace::dof, dr(), TDynamicSpace::dr_LQR, FALSE, TDynamicSpace::G_LQR, TDynamicSpace::Gd, GeneralDotProduct(), GetParameter(), TDynamicSpace::Gnew_LQR, TDynamicSpace::Gtemp_LQR, INF, TDynamicSpace::iR, TDynamicSpace::iRBt, TDynamicSpace::lsSize_LQR, LSSolveCond(), TDynamicSpace::mA_LQR, TDynamicSpace::mAt, PrintMatrix(), PrintVector(), TDynamicSpace::r_LQR, TDynamicSpace::rhsA_LQR, TDynamicSpace::rnew_LQR, TDynamicSpace::rtemp_LQR, TDynamicSpace::solA_LQR, SubMatrixFromTMatrix(), SumVectorScale(), TDynamicSpace::topt, and TRUE. ◆ LQRComputePolicy_t()
Alternative version of LQRComputePolicy where G is computed as an integral in time (not in G itself).
Definition at line 4322 of file dynamics.c. References TDynamicSpace::A_LQR, CT_DELTA, CT_TAU, TDynamicSpace::d0_LQR, TDynamicSpace::d_LQR, TDynamicSpace::da, TDynamicSpace::dG_LQR, dGt(), TDynamicSpace::dof, TDynamicSpace::eA_LQR, FALSE, TDynamicSpace::G_LQR, TDynamicSpace::Gd, GeneralDotProduct(), GetParameter(), INF, TDynamicSpace::iR, TDynamicSpace::iRBt, TDynamicSpace::lsSize_LQR, LSSolveCond(), TDynamicSpace::mA_LQR, TDynamicSpace::mAt, MatrixVectorProduct(), Norm(), PrintMatrix(), PrintVector(), TDynamicSpace::r_LQR, TDynamicSpace::rhsA_LQR, TDynamicSpace::solA_LQR, SubMatrixFromTMatrix(), SubtractVector(), SumVector(), SumVectorScale(), TDynamicSpace::topt, and TRUE. ◆ LQRPolicy()
Determines the optimal action for a given time from the policy computed in LQRComputePolicy.
Definition at line 4548 of file dynamics.c. References TDynamicSpace::a2j, TDynamicSpace::da, TDynamicSpace::eA_LQR, TDynamicSpace::effort, Error(), TDynamicSpace::Gd, TDynamicSpace::iRBt, TDynamicSpace::lsSize_LQR, TDynamicSpace::mAt, MatrixExponential(), MatrixVectorProduct(), TDynamicSpace::rtemp_LQR, and TDynamicSpace::topt. Referenced by NewTemptativeSample(). ◆ SimulateRK4()
Dynamic simulation from a given point applying a given action for the integration time fixed in the paremeter structure using the RK4 method
◆ ActionSpaceDimension()
Returns the dimension of the action space. The action space can be seen as a box in Rn space with n the value returned by this function. Any point in this box is a valid action. The limits of the box are the maximum forces and torques of the actuators.
Definition at line 4602 of file dynamics.c. References TDynamicSpace::da. Referenced by AtlasRRTSimulate(), InitAtlasRRT(), and Simulate(). ◆ GetActionFromID()
Defines an action given an identifier. This mapping can be fixed (the same action is returned given an identifer) or varible (a random action is returned each time the function is used with the same indentifier). The identifier is from 0 to N_DYNAMIC_ACTIONS-1. The size of the action vector is given by ActionSpaceDimension
Definition at line 4607 of file dynamics.c. References TDynamicSpace::a2j, TDynamicSpace::da, TDynamicSpace::effort, FALSE, randomDouble(), and TRUE. Referenced by AddBranchToAtlasDynamicRRT(), ApproachState(), and kinoEST(). ◆ PrintDynamicsDefines()
Prints the defines in chart.h This is used only for debug purposes.
Definition at line 4664 of file dynamics.c. References CUT_AT_LINK, DEBUG_DYNAMICS, DEBUG_HandC, DEBUG_HandC_FJH, DYNAMICS_ONE_ACTION_CONNECT, DYNAMICS_ONE_ACTION_EXTEND, EULER_LQR_COMPUTE_POLICY, EXPLICIT_CRF, EXPLICIT_CRM, HandC_EQ_INV, HandC_FJH, HandC_Thread, MAX_J, PRINT_J, RANDOM_DYNAMIC_ACTION, SATURATE_ACTIONS, START_BROYDEN_ON_MANIFOLD, T2G_METRIC, T2G_METRIC_INSIDE_CONNECT, T2G_METRIC_INSIDE_EXTEND, T2G_METRIC_NN_CONNECT, T2G_METRIC_NN_EXTEND, USE_HTxSAV, and USE_XUPTR. Referenced by PrintAtlasRRTDefines(). ◆ DeleteDynamicSpace()
Destructor. Frees the memory included in a dynamic space strucure.
Definition at line 4693 of file dynamics.c. References TDynamicSpace::A, TDynamicSpace::a2j, TDynamicSpace::a2x, TDynamicSpace::A_ID, TDynamicSpace::A_LQR, TDynamicSpace::action, TDynamicSpace::B, TDynamicSpace::bJ, TDynamicSpace::bJp, TDynamicSpace::cJ, TDynamicSpace::d0_LQR, TDynamicSpace::d_LQR, DeleteBox(), DeleteBroyden(), DeleteHandC(), DeleteHessian(), DeleteJacobian(), DeleteLS(), DeleteNHessian(), DeleteNJacobian(), TDynamicSpace::dG_LQR, TDynamicSpace::dGtemp_LQR, TDynamicSpace::domain, TDynamicSpace::dr_LQR, TDynamicSpace::eA_LQR, TDynamicSpace::effort, TDynamicSpace::fE_LQR, FreeHessianEvaluationAsVectors(), TDynamicSpace::g, TDynamicSpace::G_LQR, TDynamicSpace::Gd, TDynamicSpace::gn, TDynamicSpace::Gnew_LQR, TDynamicSpace::Gtemp_LQR, TDynamicSpace::gy, TDynamicSpace::Hp, TDynamicSpace::Hpv, TDynamicSpace::iR, TDynamicSpace::iRBt, TDynamicSpace::J, TDynamicSpace::j, TDynamicSpace::Jot, TDynamicSpace::Jp, TDynamicSpace::k1, TDynamicSpace::k2, TDynamicSpace::k3, TDynamicSpace::l, TDynamicSpace::mAt, TDynamicSpace::Mm, TDynamicSpace::ndxOE, TDynamicSpace::ndxOV, TDynamicSpace::ndxPE, TDynamicSpace::ndxPV, TDynamicSpace::ndxVE, TDynamicSpace::ndxVV, TDynamicSpace::nHp, TDynamicSpace::nJp, TDynamicSpace::noe, TDynamicSpace::nov, TDynamicSpace::npe, TDynamicSpace::npv, TDynamicSpace::o, TDynamicSpace::oEqs, TDynamicSpace::P, TDynamicSpace::pEqs, TDynamicSpace::pos, TDynamicSpace::pVars, TDynamicSpace::pvEqs, TDynamicSpace::pvVars, TDynamicSpace::r_LQR, TDynamicSpace::rnew_LQR, TDynamicSpace::rtemp_LQR, TDynamicSpace::selEqs, TDynamicSpace::sHp, TDynamicSpace::sJoo, TDynamicSpace::sJop, TDynamicSpace::sJp, TDynamicSpace::tp, TDynamicSpace::vel, TDynamicSpace::x0_LQR, TDynamicSpace::x_LQR, TDynamicSpace::xa, TDynamicSpace::y, and TDynamicSpace::y_LQR. Referenced by DeleteAtlasRRT(), kinobiRRT(), kinoEST(), kinoRRT(), and main(). |
Follow us!