humoto
tag.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
5  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
6 
7  @brief
8 */
9 
10 #pragma once
11 
12 namespace humoto
13 {
14  namespace rbdl
15  {
16  typedef std::size_t LinkId;
17 
18 
19  /**
20  * @brief Tag base class
21  */
23  {
24  protected:
25  ~TagBase() {};
26  };
27 
28 
29  /**
30  * @brief Link tag
31  */
32  class HUMOTO_LOCAL TagLink : public TagBase
33  {
34  public:
35  LinkId link_id_;
36 
37 
38  public:
39  explicit TagLink(const LinkId & link_id)
40  {
41  link_id_ = link_id;
42  }
43  };
44  typedef boost::shared_ptr<const TagLink> TagLinkPtr;
45 
46 
47 
48  /**
49  * @brief Link point tag
50  */
51  class HUMOTO_LOCAL TagPoint : public TagBase
52  {
53  public:
54  LinkId link_id_;
55  etools::Vector3 local_position_;
56 
57 
58  public:
59  TagPoint( const LinkId & link_id,
60  const etools::Vector3 & local_position)
61  {
62  link_id_ = link_id;
63  local_position_ = local_position;
64  }
65  };
66  typedef boost::shared_ptr<const TagPoint> TagPointPtr;
67 
68 
69  /**
70  * @brief CoM tag
71  */
72  class HUMOTO_LOCAL TagCoM : public TagBase
73  {
74  public:
76  {
77  }
78  };
79  typedef boost::shared_ptr<const TagCoM> TagCoMPtr;
80 
81 
82  /**
83  * @brief Partial CoM tag (subset of links)
84  */
86  {
87  public:
88  std::vector<LinkId> link_ids_;
89  double mass_;
90 
91  public:
92  TagPartialCoM(const std::vector<LinkId> & link_ids,
93  const double mass)
94  {
95  link_ids_ = link_ids;
96  mass_ = mass;
97  }
98  };
99  typedef boost::shared_ptr<const TagPartialCoM> TagPartialCoMPtr;
100  }
101 }
boost::shared_ptr< const TagLink > TagLinkPtr
Definition: tag.h:44
boost::shared_ptr< const TagPartialCoM > TagPartialCoMPtr
Definition: tag.h:99
etools::Vector3 local_position_
Definition: tag.h:55
std::vector< LinkId > link_ids_
Definition: tag.h:88
#define HUMOTO_LOCAL
Definition: export_import.h:26
TagPartialCoM(const std::vector< LinkId > &link_ids, const double mass)
Definition: tag.h:92
std::size_t LinkId
Definition: tag.h:16
boost::shared_ptr< const TagCoM > TagCoMPtr
Definition: tag.h:79
Link point tag.
Definition: tag.h:51
LinkId link_id_
Definition: tag.h:54
Partial CoM tag (subset of links)
Definition: tag.h:85
The root namespace of HuMoTo.
Definition: config.h:12
Tag base class.
Definition: tag.h:22
TagPoint(const LinkId &link_id, const etools::Vector3 &local_position)
Definition: tag.h:59
CoM tag.
Definition: tag.h:72
boost::shared_ptr< const TagPoint > TagPointPtr
Definition: tag.h:66