Skip to content
Snippets Groups Projects
Commit 39e615f8 authored by jcarpent's avatar jcarpent
Browse files

[C++] Add forward declaration of typedef Index

parent cda9df34
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,7 @@ SET(${PROJECT_NAME}_MULTIBODY_PARSER_HEADERS
)
SET(${PROJECT_NAME}_MULTIBODY_HEADERS
multibody/fwd.hpp
multibody/constraint.hpp
multibody/force-set.hpp
multibody/joint.hpp
......
//
// Copyright (c) 2016 CNRS
//
// This file is part of Pinocchio
// Pinocchio is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// Pinocchio is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// Pinocchio If not, see
// <http://www.gnu.org/licenses/>.
#ifndef __se3_multibody_fwd_hpp__
#define __se3_multibody_fwd_hpp__
namespace se3
{
typedef std::size_t Index;
typedef Index JointIndex;
typedef Index GeomIndex;
typedef Index FrameIndex;
} // namespace se3
#endif // #ifndef __se3_multibody_fwd_hpp__
......@@ -25,6 +25,7 @@
#include "pinocchio/spatial/motion.hpp"
#include "pinocchio/spatial/inertia.hpp"
#include "pinocchio/spatial/frame.hpp"
#include "pinocchio/multibody/fwd.hpp"
#include "pinocchio/multibody/joint/joint-variant.hpp"
#include "pinocchio/tools/string-generator.hpp"
#include <iostream>
......@@ -40,20 +41,20 @@ namespace se3
{
class Model;
class Data;
class Model
{
public:
typedef std::size_t Index;
typedef Index JointIndex; // For better comprehension of what object we are working with
typedef Index GeomIndex; //
typedef Index FrameIndex; //
typedef Index Index;
typedef JointIndex JointIndex;
typedef GeomIndex GeomIndex;
typedef FrameIndex FrameIndex;
int nq; // Dimension of the configuration representation
int nv; // Dimension of the velocity vector space
int nbody; // Number of bodies (= number of joints + 1)
int nFixBody; // Number of fixed-bodies (= number of fixed-joints)
int nOperationalFrames; // Number of extra frames
int nOperationalFrames; // Number of operational frames
std::vector<Inertia> inertias; // Spatial inertias of the body <i> in the supporting joint frame <i>
std::vector<SE3> jointPlacements; // Placement (SE3) of the input of joint <i> in parent joint output <li>
......
......@@ -20,6 +20,7 @@
#include "pinocchio/spatial/fwd.hpp"
#include "pinocchio/spatial/se3.hpp"
#include "pinocchio/multibody/fwd.hpp"
#include "pinocchio/tools/string-generator.hpp"
#include <Eigen/StdVector>
......@@ -33,8 +34,7 @@ namespace se3
///
struct Frame
{
typedef std::size_t Index;
typedef Index JointIndex;
typedef JointIndex JointIndex;
Frame() : name(random(8)), parent_id(), framePlacement() {} // needed by EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION
......@@ -45,7 +45,7 @@ namespace se3
/// \param[in] parent_id Index of the parent joint in the kinematic tree.
/// \param[in] frame_placement Placement of the frame wrt the parent joint frame.
///
Frame(const std::string & name, const Index parent_id, const SE3 & frame_placement):
Frame(const std::string & name, const JointIndex parent_id, const SE3 & frame_placement):
name(name)
, parent_id(parent_id)
, framePlacement(frame_placement)
......@@ -66,7 +66,7 @@ namespace se3
std::string name;
/// \brief Index of the parent joint.
Index parent_id;
JointIndex parent_id;
/// \brief Placement of the frame wrt the parent joint.
SE3 framePlacement;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment