diff --git a/doc/treeview.dox b/doc/treeview.dox index be4c17469e381234f3dbc358b0910498022445b1..9a87f00e5138bcad3e6e35a909b7c79a2d57d544 100644 --- a/doc/treeview.dox +++ b/doc/treeview.dox @@ -34,9 +34,9 @@ namespace pinocchio { - \subpage md_doc_maths_se3 */ - /** \page Chapters Chapters - - \subpage md_doc_Chapters_creating-models - - \subpage md_doc_Chapters_crtp + /** \page Usage Usage + - \subpage md_doc_usage_creating-models + - \subpage md_doc_usage_crtp */ // diff --git a/doc/Chapters/creating-models.md b/doc/usage/creating-models.md similarity index 71% rename from doc/Chapters/creating-models.md rename to doc/usage/creating-models.md index 1d82bda9378006169f167b84e8ed53d1c8df3b58..8e55bcbc279e1e3c47c72261320e74d14ab2bc8e 100644 --- a/doc/Chapters/creating-models.md +++ b/doc/usage/creating-models.md @@ -1,8 +1,8 @@ # Creating models <!-- // -// Copyright (c) 2016 CNRS -// Author: Florent Lamiraux, Justin Carpentier, Florian Valenza +// Copyright (c) 2016, 2018 CNRS +// Author: Florent Lamiraux, Justin Carpentier, Florian Valenza, Guilhem Saurel // // This file is part of Pinocchio // Pinocchio is free software: you can redistribute it @@ -32,42 +32,44 @@ but you can also create a Model from scratch and fill it with the Joints you wan ### Format urdf To load an urdf file in C++ code, copy the following lines: -``` +```cpp #include <pinocchio/multibody/model.hpp> #include <pinocchio/multibody/parser/urdf.hpp> -#include <pinocchio/multibody/parser/utils.hpp> -#include <pinocchio/multibody/joint.hpp> bool verbose = false; const std::string filename = "path/to/file/model.urdf"; -se3::JointModelFreeflyer rootJoint; -se3::Model model = se3::urdf::buildModel (filename, rootJoint, verbose); + +se3::Model model +se3::urdf::buildModel (filename, model, verbose); se3::Data data (model); ``` ### Format Python To load a python file in C++ code, copy the following lines: -``` -#include <pinocchio/multibody/model.hpp> -#include <pinocchio/multibody/parser/python.hpp> -#include <pinocchio/multibody/parser/utils.hpp> -#include <pinocchio/multibody/joint.hpp> +```cpp +#include "pinocchio/multibody/model.hpp" +#include "pinocchio/parsers/python.hpp" + +bool verbose = false; +const std::string filename = "path/to/file/model.py"; +const std::string model_name = "python_variable_name_in_filename" -//put here code to load from python +se3::Model model = se3::python::buildModel(filename, model_name, verbose); +se3::Data data (model); ``` ### Format lua To load an lua file in C++ code, copy the following lines: -``` +```cpp #include <pinocchio/multibody/model.hpp> #include <pinocchio/multibody/parser/lua.hpp> -#include <pinocchio/multibody/parser/utils.hpp> -#include <pinocchio/multibody/joint.hpp> +bool verbose = false; bool freeflyer = true; const std::string filename = "path/to/file/model.lua"; -se3::Model model = se3::lua::buildModel (filename, freeflyer); + +se3::Model model = se3::lua::buildModel (filename, freeflyer, verbose); se3::Data data (model); ``` diff --git a/doc/Chapters/crtp.md b/doc/usage/crtp.md similarity index 100% rename from doc/Chapters/crtp.md rename to doc/usage/crtp.md