mirror of
https://github.com/eclipse/upm.git
synced 2025-07-27 22:21:16 +03:00
Initial implementation of iAcceleration
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
90524273ec
commit
f992876461
@ -388,6 +388,14 @@ vector<float> BNO055::getAccelerometer()
|
||||
return vector<float>(v, v+3);
|
||||
}
|
||||
|
||||
std::vector<float> BNO055::getAcceleration()
|
||||
{
|
||||
std::vector<float> v(3);
|
||||
|
||||
bno055_get_accelerometer(m_bno055, &v[0], &v[1], &v[2]);
|
||||
return v;
|
||||
}
|
||||
|
||||
void BNO055::getMagnetometer(float *x, float *y, float *z)
|
||||
{
|
||||
bno055_get_magnetometer(m_bno055, x, y, z);
|
||||
|
@ -28,6 +28,8 @@
|
||||
#include <vector>
|
||||
#include "bno055.h"
|
||||
|
||||
#include <interfaces/iAcceleration.hpp>
|
||||
|
||||
namespace upm {
|
||||
|
||||
/**
|
||||
@ -100,7 +102,7 @@ namespace upm {
|
||||
* @snippet bno055.cxx Interesting
|
||||
*/
|
||||
|
||||
class BNO055 {
|
||||
class BNO055: virtual public iAcceleration {
|
||||
|
||||
public:
|
||||
/**
|
||||
@ -420,6 +422,13 @@ namespace upm {
|
||||
*/
|
||||
std::vector<float> getAccelerometer();
|
||||
|
||||
/**
|
||||
* get acceleration values
|
||||
*
|
||||
* @return stl vector of size 3 representing the 3 axis
|
||||
*/
|
||||
virtual std::vector<float> getAcceleration();
|
||||
|
||||
/**
|
||||
* Return uncompensated magnetometer data (non-fusion). In fusion
|
||||
* modes, this data will be of little value. The returned values
|
||||
|
Reference in New Issue
Block a user