MCPcopy Create free account
hub / github.com/Simple-Robotics/Simple / MujocoHumanoidFixture

Class MujocoHumanoidFixture

benchmark/mujoco-humanoid.cpp:84–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84struct MujocoHumanoidFixture : benchmark::Fixture
85{
86 void SetUp(benchmark::State &)
87 {
88 ModelHandle model_handle = std::make_shared<Model>();
89 GeometryModelHandle geom_model_handle = std::make_shared<GeometryModel>();
90 Model & model = ::pinocchio::helper::get_ref(model_handle);
91 GeometryModel & geom_model = ::pinocchio::helper::get_ref(geom_model_handle);
92
93 const bool verbose = false;
94 ::pinocchio::mjcf::buildModel(SIMPLE_TEST_DATA_DIR "/mujoco_humanoid.xml", model, verbose);
95 ::pinocchio::mjcf::buildGeom(model, SIMPLE_TEST_DATA_DIR "/mujoco_humanoid.xml", pinocchio::COLLISION, geom_model);
96 addFloorToGeomModel(geom_model);
97
98 // initial state
99 q0 = model.referenceConfigurations["qpos0"];
100 v0 = Eigen::VectorXd::Zero(model.nv);
101 zero_torque = Eigen::VectorXd::Zero(model.nv);
102
103 // add collision pairs
104 addSystemCollisionPairs(model, geom_model, q0);
105
106 sim = std::make_unique<Simulator>(model_handle, geom_model_handle);
107 }
108
109 void TearDown(benchmark::State &)
110 {
111 }
112
113 std::unique_ptr<Simulator> sim;
114 Eigen::VectorXd q0;
115 Eigen::VectorXd v0;
116 Eigen::VectorXd zero_torque;
117};
118
119BENCHMARK_DEFINE_F(MujocoHumanoidFixture, admm)(benchmark::State & st)
120{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected