mirror of
https://github.com/eclipse/upm.git
synced 2025-07-05 19:31:15 +03:00
Initial implementation of iAcceleration
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
This commit is contained in:
@ -84,6 +84,14 @@ float *BMI160::getAccelerometer()
|
||||
return values;
|
||||
}
|
||||
|
||||
std::vector<float> BMI160::getAcceleration()
|
||||
{
|
||||
std::vector<float> v(3);
|
||||
|
||||
bmi160_get_accelerometer(m_bmi160, &v[0], &v[1], &v[2]);
|
||||
return v;
|
||||
}
|
||||
|
||||
float *BMI160::getGyroscope()
|
||||
{
|
||||
static float values[3]; // x, y, and then z
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include <string>
|
||||
#include "bmi160.h"
|
||||
|
||||
#include <interfaces/iAcceleration.hpp>
|
||||
|
||||
#define BMI160_I2C_BUS 0
|
||||
#define BMI160_DEFAULT_I2C_ADDR 0x69
|
||||
|
||||
@ -72,7 +74,7 @@ namespace upm {
|
||||
*
|
||||
* @snippet bmi160.cxx Interesting
|
||||
*/
|
||||
class BMI160 {
|
||||
class BMI160: virtual public iAcceleration {
|
||||
public:
|
||||
|
||||
/**
|
||||
@ -142,6 +144,13 @@ namespace upm {
|
||||
*/
|
||||
void getAccelerometer(float *x, float *y, float *z);
|
||||
|
||||
/**
|
||||
* get acceleration values
|
||||
*
|
||||
* @return stl vector of size 3 representing the 3 axis
|
||||
*/
|
||||
virtual std::vector<float> getAcceleration();
|
||||
|
||||
/**
|
||||
* Get the Gyroscope values. This function returns a pointer to 3
|
||||
* floating point values: X, Y, and Z, in that order. The values
|
||||
|
Reference in New Issue
Block a user