8#include <igl/opengl/glfw/Viewer.h>
12#include "./nlohmann/json.hpp"
26 void initialize(
const std::string& name_id,
const nlohmann::json& json_file,
27 igl::opengl::glfw::Viewer *viewer,
int mesh_idx);
30 void update(
const std::vector<dm::JointState>& state);
This class generates a finger of n links. The number of links and their properties are defined by a j...
void initialize_state(const std::vector< double > &link_lengths, const dm::JointState &origin)
Initialize state.
void initialize(const std::string &name_id, const nlohmann::json &json_file, igl::opengl::glfw::Viewer *viewer, int mesh_idx)
Initialize finger.
int m_viewer_data_lower_idx
Viewer data lower idx see (Hand::m_viewer_data_lower_idx).
std::vector< int > m_frame_ids
The frame ids of the finger.
std::string m_joint_rel_filename
Joint mesh file.
std::vector< dm::JointState > get_state(void)
Get current state of the finger.
std::vector< Eigen::MatrixXd > m_vertices_data_o
Vertices data (original).
double m_joint_scale
Joint scales.
std::vector< Eigen::MatrixXd > m_vertices_data
Vertices data.
std::vector< double > m_link_lengths
The lengths of the finger links.
void load_mesh_files(igl::opengl::glfw::Viewer *viewer)
Load finger mesh files.
std::vector< Eigen::MatrixXd > get_vertices(void)
Get finger vertices.
std::vector< Eigen::Matrix4d > m_global_transform
Global transforamation matrix.
std::string m_bone_rel_filename
Bone (link) mesh file.
void postprocess_meshes(void)
Postproccess meshes.
std::vector< std::string > m_meshes_filenames
Mesh files for joints and bones(links).
std::vector< Eigen::MatrixXi > m_faces_data
Faces data.
void parse_json_file(const nlohmann::json &json_file)
Parses the finger configuration json file.
int m_state_size
State size.
std::vector< dm::JointState > m_state_vec
Finger state.
dm::JointState m_origin
Finger origin.
void update(const std::vector< dm::JointState > &state)
Update state.
void get_mesh_data(igl::opengl::glfw::Viewer *viewer)
Get mesh data.
std::vector< Eigen::Matrix4d > m_local_transform
Local transforamation matrix.
std::string m_name_id
Finger name id.
std::vector< int > get_frame_ids(void)
Get the ids of the finger frames.
void initialize_mesh_containers(void)
Initialize mesh files.
std::vector< double > m_geom_scales
Finger scales.
std::vector< Eigen::MatrixXd > m_vertices_data_oh
Vertices data (original homogeneous).
int m_viewer_data_upper_idx
Viewer data upper idx (see Hand::m_viewer_data_lower_idx).