Verified Commit 4cfdfa9e authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test/packaging: test cmake export

parent 9ee7f999
cmake_minimum_required(VERSION 2.6)
project(ExtraLib CXX)
find_package(pinocchio REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
set(PINOCCHIO_MODEL_DIR "${PROJECT_SOURCE_DIR}/../../models")
add_definitions('-DPINOCCHIO_MODEL_DIR=\"${PINOCCHIO_MODEL_DIR}\"')
add_executable(run_rnea run_rnea.cpp)
target_link_libraries(run_rnea PUBLIC pinocchio::pinocchio)
if(DEFINED PINOCCHIO_WITH_URDF_SUPPORT)
add_executable(load_urdf load_urdf.cpp)
target_link_libraries(load_urdf PUBLIC pinocchio::pinocchio)
endif(DEFINED PINOCCHIO_WITH_URDF_SUPPORT)
#include <pinocchio/parsers/urdf.hpp>
#include <iostream>
#include <string>
int main(int /*argc*/, char ** /*argv*/)
{
using namespace pinocchio;
const std::string filename = PINOCCHIO_MODEL_DIR + std::string("/simple_humanoid.urdf");
Model model;
pinocchio::urdf::buildModel(filename, JointModelFreeFlyer(), model);
std::cout << "model.nq: " << model.nq << std::endl;
std::cout << "model.nv: " << model.nv << std::endl;
return 0;
}
#include <pinocchio/parsers/sample-models.hpp>
#include <pinocchio/algorithm/rnea.hpp>
#include <pinocchio/algorithm/joint-configuration.hpp>
#include <iostream>
int main(int /*argc*/, char ** /*argv*/)
{
using namespace pinocchio;
Model model;
pinocchio::buildModels::humanoid(model);
Model::VectorXs q = randomConfiguration(model);
Model::VectorXs v = Model::VectorXs::Random(model.nv);
Model::VectorXs a = Model::VectorXs::Random(model.nv);
Data data(model);
rnea(model,data,q,v,a);
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment