Cheetah Software
1.0
|
#include "Dynamics/DynamicsSimulator.h"
#include "Dynamics/FloatingBaseModel.h"
#include "Dynamics/MiniCheetah.h"
#include "Dynamics/Quadruped.h"
#include "Utilities/utilities.h"
#include <iostream>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "Utilities/Utilities_print.h"
Go to the source code of this file.
Functions | |
TEST (MiniCheetah, miniCheetahModel1) | |
TEST (MiniCheetah, miniCheetahModel2) | |
TEST (MiniCheetah, simulatorDynamicsDoesntCrashMiniCheetah) | |
TEST (MiniCheetah, simulatorDynamicsABANoExternalForceMiniCheetah) | |
TEST (MiniCheetah, simulatorDynamicsWithExternalForceMiniCheetah) | |
TEST (MiniCheetah, simulatorFootPosVelMiniCheetah) | |
TEST (MiniCheetah, hipLocationConvention) | |
TEST (MiniCheetah, ContactPositionVelocity) | |
TEST (MiniCheetah, InertiaProperty) | |
TEST | ( | MiniCheetah | , |
miniCheetahModel1 | |||
) |
Test the total mass, tree, and spatial inertia sum
Definition at line 25 of file test_mini_cheetah_model.cpp.
References almostEqual(), fpEqual(), FloatingBaseModel< T >::getBodyInertiaVector(), FloatingBaseModel< T >::getParentVector(), FloatingBaseModel< T >::getRotorInertiaVector(), FloatingBaseModel< T >::totalNonRotorMass(), FloatingBaseModel< T >::totalRotorMass(), and vectorEqual().
TEST | ( | MiniCheetah | , |
miniCheetahModel2 | |||
) |
Test the model transforms
Definition at line 65 of file test_mini_cheetah_model.cpp.
References FloatingBaseModel< T >::_Xrot, FloatingBaseModel< T >::_Xtree, and almostEqual().
TEST | ( | MiniCheetah | , |
simulatorDynamicsDoesntCrashMiniCheetah | |||
) |
Creates a cheetah model and runs forward kinematics and ABA Doesn't test anyting - this is just to make sure it doesn't crash
Definition at line 90 of file test_mini_cheetah_model.cpp.
References DynamicsSimulator< T >::forwardKinematics(), and DynamicsSimulator< T >::runABA().
TEST | ( | MiniCheetah | , |
simulatorDynamicsABANoExternalForceMiniCheetah | |||
) |
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 103 of file test_mini_cheetah_model.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(), FBModelState< T >::q, FBModelState< T >::qd, FBModelStateDerivative< T >::qdd, ori::rotationMatrixToQuaternion(), DynamicsSimulator< T >::runABA(), and DynamicsSimulator< T >::setState().
TEST | ( | MiniCheetah | , |
simulatorDynamicsWithExternalForceMiniCheetah | |||
) |
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 159 of file test_mini_cheetah_model.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 | ( | MiniCheetah | , |
simulatorFootPosVelMiniCheetah | |||
) |
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 222 of file test_mini_cheetah_model.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().
TEST | ( | MiniCheetah | , |
hipLocationConvention | |||
) |
Check that the hip location convention is correct
Definition at line 274 of file test_mini_cheetah_model.cpp.
References almostEqual().
TEST | ( | MiniCheetah | , |
ContactPositionVelocity | |||
) |
Definition at line 296 of file test_mini_cheetah_model.cpp.
References FloatingBaseModel< T >::_pGC, almostEqual(), FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, ori::coordinateRotation(), linkID::FL_abd, FloatingBaseModel< T >::forwardKinematics(), linkID::FR_abd, linkID::HL_abd, linkID::HR_abd, FBModelState< T >::q, FBModelState< T >::qd, ori::rotationMatrixToQuaternion(), and FloatingBaseModel< T >::setState().
TEST | ( | MiniCheetah | , |
InertiaProperty | |||
) |
Definition at line 368 of file test_mini_cheetah_model.cpp.
References FBModelState< T >::bodyOrientation, FBModelState< T >::bodyPosition, FBModelState< T >::bodyVelocity, FloatingBaseModel< T >::getMassMatrix(), FloatingBaseModel< T >::massMatrix(), FBModelState< T >::q, FBModelState< T >::qd, ori::rpyToQuat(), and FloatingBaseModel< T >::setState().