Skip to content
Snippets Groups Projects
Commit 846dfd02 authored by =Sergi Hernandez Juan's avatar =Sergi Hernandez Juan
Browse files

Solved a problem with the memory aligment of std::vectors with Eiven data structures.

parent f956dd77
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <Eigen/StdVector>
typedef struct{ typedef struct{
double alpha; double alpha;
...@@ -25,12 +26,13 @@ class CDarwinLegKinematics ...@@ -25,12 +26,13 @@ class CDarwinLegKinematics
private: private:
unsigned int num_dof; unsigned int num_dof;
std::vector<std::string> joint_names; std::vector<std::string> joint_names;
std::vector<Eigen::Matrix4d> fwd_kin_transforms; std::vector< Eigen::Matrix4d,Eigen::aligned_allocator<Eigen::Matrix4d> > fwd_kin_transforms;
std::vector<TDHParams> fwd_kin_params; std::vector<TDHParams> fwd_kin_params;
protected: protected:
double angle_norm(double angle); double angle_norm(double angle);
void zero_small_values(Eigen::Matrix4d &matrix,double threshold); void zero_small_values(Eigen::Matrix4d &matrix,double threshold);
public: public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
CDarwinLegKinematics(); CDarwinLegKinematics();
void load_chain(std::string &filename); void load_chain(std::string &filename);
unsigned int get_num_dof(void); unsigned int get_num_dof(void);
......
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