Go to the documentation of this file.
5 #ifndef __pinocchio_benchmark_model_fixture_hpp__
6 #define __pinocchio_benchmark_model_fixture_hpp__
14 #include <boost/optional.hpp>
15 #include <boost/none.hpp>
17 #include <benchmark/benchmark.h>
44 const Eigen::VectorXd qmax(Eigen::VectorXd::Ones(
model.
nq));
46 v = Eigen::VectorXd::Random(
model.
nv);
47 a = Eigen::VectorXd::Random(
model.
nv);
76 std::cout <<
"--" << std::endl;
93 for (
int i = 1;
i < argc; ++
i)
95 if (std::strcmp(argv[
i],
"--no-ff") == 0)
99 else if (std::strcmp(argv[
i],
"--model") == 0)
103 args.model_filename = argv[
i + 1];
110 <<
": error: unrecognized command-line flag: --model should be followed by an urdf path"
117 std::cerr << argv[0] <<
": error: unrecognized command-line flag: " << argv[
i] << std::endl;
126 #define PINOCCHIO_BENCHMARK_MAIN_WITH_SETUP(GLOBAL_SETUP) \
127 pinocchio::Model ModelFixture::MODEL; \
128 int main(int argc, char ** argv) \
130 char arg0_default[] = "benchmark"; \
131 char * args_default = arg0_default; \
135 argv = &args_default; \
137 ::benchmark::Initialize(&argc, argv); \
141 auto extra_args = parseExtraArgs(argc, argv); \
146 GLOBAL_SETUP(*extra_args); \
148 ::benchmark ::RunSpecifiedBenchmarks(); \
149 ::benchmark ::Shutdown(); \
152 int main(int, char **)
155 #define PINOCCHIO_BENCHMARK_MAIN() PINOCCHIO_BENCHMARK_MAIN_WITH_SETUP(ModelFixture::GlobalSetUp)
157 #endif // #ifndef __pinocchio_benchmark_model_fixture_hpp__
void TearDown(benchmark::State &)
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true, bool mimic=false)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
std::string name
Model name.
boost::optional< ExtraArgs > parseExtraArgs(int argc, char **argv)
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
void SetUp(benchmark::State &)
static void GlobalSetUp(const ExtraArgs &extra_args)
DataTpl< context::Scalar, context::Options > Data
static pinocchio::Model MODEL
int nv
Dimension of the velocity vector space.
PINOCCHIO_SCALAR_TYPE Scalar
int nq
Dimension of the configuration vector representation.
#define PINOCCHIO_MODEL_DIR
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModel(const std::string &filename, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, const std::string &rootJointName, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false, const bool mimic=false)
Build the model from a URDF file with a particular joint as root of the model tree inside the model g...
pinocchio
Author(s):
autogenerated on Wed May 28 2025 02:41:21