Merge pull request #1977 from devbharat/fix_issue_1963

Shifted the set() function for Matrix3x3, Vector2, Vector3, Vector4 to a...
This commit is contained in:
Lorenz Meier
2015-06-15 17:35:40 +02:00
2 changed files with 39 additions and 10 deletions
+15 -9
View File
@@ -126,15 +126,6 @@ public:
memcpy(data, d, sizeof(data));
}
#if defined(__PX4_ROS)
/**
* set data from boost::array
*/
void set(const boost::array<float, 9ul> d) {
set(static_cast<const float*>(d.data()));
}
#endif
/**
* set row from vector
*/
@@ -445,6 +436,21 @@ public:
Matrix(const float *d) : MatrixBase<3, 3>(d) {}
Matrix(const float d[3][3]) : MatrixBase<3, 3>(d) {}
/**
* set data
*/
void set(const float d[9]) {
memcpy(data, d, sizeof(data));
}
#if defined(__PX4_ROS)
/**
* set data from boost::array
*/
void set(const boost::array<float, 9ul> d) {
set(static_cast<const float*>(d.data()));
}
#endif
/**
* set to value
+24 -1
View File
@@ -407,7 +407,14 @@ public:
data[0] = d[0];
data[1] = d[1];
}
#if defined(__PX4_ROS)
/**
* set data from boost::array
*/
void set(const boost::array<float, 2ul> d) {
set(static_cast<const float*>(d.data()));
}
#endif
/**
* set to value
*/
@@ -444,6 +451,14 @@ public:
data[1] = y;
data[2] = z;
}
#if defined(__PX4_ROS)
/**
* set data from boost::array
*/
void set(const boost::array<float, 3ul> d) {
set(static_cast<const float*>(d.data()));
}
#endif
/**
* set data
@@ -494,6 +509,14 @@ public:
data[2] = x2;
data[3] = x3;
}
#if defined(__PX4_ROS)
/**
* set data from boost::array
*/
void set(const boost::array<float, 4ul> d) {
set(static_cast<const float*>(d.data()));
}
#endif
/**
* set data