Kinematics Animation Multithread
animated_hand.cpp
Go to the documentation of this file.
1#include "../include/animated_hand.h"
2
3// Generate hand angles
4std::vector<Eigen::Vector3d> AnimatedHand::get_hand_angles(const
5 std::vector<double>& joint_angles)
6{
7 // Initialize euler container
8 std::vector<Eigen::Vector3d> euler_vec;
9
10 // Zero all euler angles
11 for (size_t i = 0; i < m_hand_frames_num; i++)
12 {
13 euler_vec.push_back(Eigen::Vector3d(0.0, 0.0, 0.0));
14 }
15
16 // Set euler angles
17 for(size_t i = 0; i < m_hand_map.size(); i++)
18 {
19 // Get hand map i
20 HandMap config_i = m_hand_map.at(i);
21
22 // Define euler vector
23 euler_vec.at(config_i.frame_id)(config_i.rot_type) =
24 config_i.rot_dir * joint_angles.at(i);
25 }
26
27 return euler_vec;
28}
std::vector< HandMap > m_hand_map
Definition: animated_hand.h:39
std::vector< Eigen::Vector3d > get_hand_angles(const std::vector< double > &joint_angles)
int m_hand_frames_num
Definition: animated_hand.h:56