joint_dispatcher
JointSelection.hpp
Go to the documentation of this file.
1 #ifndef JOINT_DISPATCHER_JOINT_SELECTION_HPP
2 #define JOINT_DISPATCHER_JOINT_SELECTION_HPP
3 
4 #include <vector>
5 #include <string>
6 #include <base/samples/Joints.hpp>
7 
8 namespace joint_dispatcher
9 {
13  {
14  std::vector<int> byIndex;
15  std::vector<std::string> byName;
16 
17  size_t size() const { return byIndex.size(); }
18 
19  void resolveNames(base::samples::Joints const& sample)
20  {
21  if (!byName.empty())
22  {
23  byIndex.resize(byName.size());
24  for (size_t i = 0; i < byName.size(); ++i)
25  byIndex[i] = sample.mapNameToIndex(byName[i]);
26  }
27  }
28  };
29 }
30 
31 #endif
32 
std::vector< std::string > byName
Definition: JointSelection.hpp:15
size_t size() const
Definition: JointSelection.hpp:17
Definition: Dispatcher.hpp:8
Definition: JointSelection.hpp:12
void resolveNames(base::samples::Joints const &sample)
Definition: JointSelection.hpp:19
std::vector< int > byIndex
Definition: JointSelection.hpp:14