As per the reviews on the previous patches, submitting a patch with all the changes suggested in the reviews.
Tested on RD-PQ device
Change-Id: I15e79bdd0331c17908cc62fa523bab188cc28295
}
#endif
-#endif
-//! End of a file
-
+#endif /* __SENSOR_GEOMAGNETIC_RV_H__ */
template <typename TYPE>
class euler_angles {
public:
- vect<TYPE,EULER_SIZE> m_ang;
+ vect<TYPE, EULER_SIZE> m_ang;
euler_angles();
euler_angles(const TYPE roll, const TYPE pitch, const TYPE azimuth);
return *this;
}
- for (int p = 0; p < ROW; p++)
- for (int q = 0; q < COL; q++)
- m_mat[p][q] = m.m_mat[p][q];
+ for (int i = 0; i < ROW; i++)
+ for (int j = 0; j < COL; j++)
+ m_mat[i][j] = m.m_mat[i][j];
return *this;
}
m_magnetic.m_data = magnetic.m_data;
if (m_gyro.m_time_stamp != 0 && gyro.m_time_stamp != 0)
- sample_interval_gyro = gyro.m_time_stamp - m_gyro.m_time_stamp;
+ sample_interval_gyro = gyro.m_time_stamp - m_gyro.m_time_stamp;
m_gyro_dt = sample_interval_gyro * US2S;
template <typename T> T mag(T val) {
if (val < 0)
- return val * (T)-1;
+ return val * static_cast<T>(-1);
else
return val;
}
TYPE_SIZE vect<TYPE, SIZE>::vect(void)
{
- for(int i=0;i<SIZE;i++)
+ for (int i = 0; i < SIZE; i++)
m_vec[i] = 0;
}
TYPE_SIZE vect<TYPE, SIZE> vect<TYPE, SIZE>::operator =(const vect<TYPE, SIZE>& v)
{
if (this == &v)
- {
return *this;
- }
+
for (int q = 0; q < SIZE; q++)
m_vec[q] = v.m_vec[q];
- return *this;
+
+ return *this;
}
T_S ostream& operator <<(ostream& dout, vect<T, S>& v)
{
for (int j = 0; j < S; j++)
- {
dout << v.m_vec[j] << "\t";
- }
dout << endl;
matrix<T,R,S> m1;
for (int i = 0; i < R; i++)
- {
for (int j = 0; j < S; j++)
- {
m1.m_mat[i][j] = m.m_mat[i][0] * v.m_vec[j];
- }
- }
return m1;
}