Cheetah Software
1.0
|
Test dynamics algorithms. More...
#include "Dynamics/Cheetah3.h"
#include "Dynamics/DynamicsSimulator.h"
#include "Dynamics/FloatingBaseModel.h"
#include "Dynamics/Quadruped.h"
#include "Utilities/utilities.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <stdio.h>
Go to the source code of this file.
Functions | |
TEST (Dynamics, cheetah3model) | |
TEST (Dynamics, cheetah3ModelTransforms) | |
TEST (Dynamics, simulatorDynamicsABANoExternalForceCheetah3) | |
TEST (Dynamics, inverseDynamicsNoContacts) | |
TEST (Dynamics, contactJacobians) | |
TEST (Dynamics, simulatorDynamicsWithExternalForceCheetah3) | |
TEST (Dynamics, simulatorFootPosVelCheetah3) | |
Test dynamics algorithms.
Test the dynamics algorithms in DynamicsSimulator and models of Cheetah 3
Test the model of Mini Cheetah
Definition in file test_dynamics.cpp.
TEST | ( | Dynamics | , |
cheetah3model | |||
) |
Generate a model of the Cheetah 3 and check its total mass, tree structure and sum of all spatial inertias (including rotors) Compared against MATLAB model
Definition at line 26 of file test_dynamics.cpp.
References almostEqual(), FloatingBaseModel< T >::check(), fpEqual(), FloatingBaseModel< T >::getBodyInertiaVector(), FloatingBaseModel< T >::getParentVector(), FloatingBaseModel< T >::getRotorInertiaVector(), FloatingBaseModel< T >::totalNonRotorMass(), FloatingBaseModel< T >::totalRotorMass(), and vectorEqual().
TEST | ( | Dynamics | , |
cheetah3ModelTransforms | |||
) |
Test the model transforms
Definition at line 58 of file test_dynamics.cpp.
References FloatingBaseModel< T >::_Xrot, FloatingBaseModel< T >::_Xtree, and almostEqual().
TEST | ( | Dynamics | , |
simulatorDynamicsABANoExternalForceCheetah3 | |||
) |
Run the articulated body algorithm (and forward kinematics) on Cheetah 3 Set a weird body orientation, velocity, q, dq, and tau Checks that quatD, pd, vd, and qdd match MATLAB
Definition at line 83 of file test_dynamics.cpp.
References almostEqual(), FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, ori::coordinateRotation(), FBModelStateDerivative< T >::dBodyPosition, FBModelStateDerivative< T >::dBodyVelocity, DynamicsSimulator< T >::forwardKinematics(), fpEqual(), DynamicsSimulator< T >::getDState(), DynamicsSimulator< T >::getState(), DynamicsSimulator< T >::integrate(), FBModelState< T >::q, FBModelState< T >::qd, FBModelStateDerivative< T >::qdd, ori::rotationMatrixToQuaternion(), DynamicsSimulator< T >::runABA(), and DynamicsSimulator< T >::setState().
TEST | ( | Dynamics | , |
inverseDynamicsNoContacts | |||
) |
Run the RNEA and component H/Cqd/G algorithms on Cheetah 3 Set a weird body orientation, velocity, q, dq, qdd Checks that genForce matches MATLAB, and CRBA/Cqd/G agree the output as well
Definition at line 153 of file test_dynamics.cpp.
References almostEqual(), FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, ori::coordinateRotation(), FBModelStateDerivative< T >::dBodyVelocity, FloatingBaseModel< T >::generalizedCoriolisForce(), FloatingBaseModel< T >::generalizedGravityForce(), FloatingBaseModel< T >::inverseDynamics(), FloatingBaseModel< T >::massMatrix(), FBModelState< T >::q, FBModelState< T >::qd, FBModelStateDerivative< T >::qdd, ori::rotationMatrixToQuaternion(), and FloatingBaseModel< T >::setState().
TEST | ( | Dynamics | , |
contactJacobians | |||
) |
Computes Jacobians and bias forces for contacts Checks that finite differenced contact positions equal velocities and finite differenced contact velocities equal J*nu_dot + Jdot*nu
Definition at line 220 of file test_dynamics.cpp.
References FloatingBaseModel< T >::_Jc, FloatingBaseModel< T >::_Jcdqd, FloatingBaseModel< T >::_pGC, FloatingBaseModel< T >::_vGC, almostEqual(), FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, FloatingBaseModel< T >::contactJacobians(), ori::coordinateRotation(), FBModelStateDerivative< T >::dBodyPosition, FBModelStateDerivative< T >::dBodyVelocity, FBModelState< T >::q, FBModelState< T >::qd, FBModelStateDerivative< T >::qdd, ori::quaternionToRotationMatrix(), ori::quatProduct(), ori::rotationMatrixToQuaternion(), and FloatingBaseModel< T >::setState().
TEST | ( | Dynamics | , |
simulatorDynamicsWithExternalForceCheetah3 | |||
) |
Run the articulated body algorithm (and forward kinematics) on Cheetah 3 Set a weird body orientation, velocity, q, dq, and tau Sets external spatial forces on all bodies Checks that quatD, pd, vd, and qdd match MATLAB
Definition at line 324 of file test_dynamics.cpp.
References almostEqual(), FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, ori::coordinateRotation(), FBModelStateDerivative< T >::dBodyPosition, FBModelStateDerivative< T >::dBodyVelocity, fpEqual(), DynamicsSimulator< T >::getDState(), FBModelState< T >::q, FBModelState< T >::qd, FBModelStateDerivative< T >::qdd, ori::rotationMatrixToQuaternion(), DynamicsSimulator< T >::setAllExternalForces(), DynamicsSimulator< T >::setState(), and DynamicsSimulator< T >::step().
TEST | ( | Dynamics | , |
simulatorFootPosVelCheetah3 | |||
) |
Run the articulated body algorithm (and forward kinematics) on Cheetah 3 Set a weird body orientation, velocity, q, dq, and tau Checks that foot position and velocities match MATLAB
Definition at line 387 of file test_dynamics.cpp.
References FloatingBaseModel< T >::_pGC, FloatingBaseModel< T >::_vGC, almostEqual(), FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, ori::coordinateRotation(), DynamicsSimulator< T >::getModel(), FBModelState< T >::q, FBModelState< T >::qd, ori::rotationMatrixToQuaternion(), DynamicsSimulator< T >::setAllExternalForces(), DynamicsSimulator< T >::setState(), and DynamicsSimulator< T >::step().