accelerometer

How to get only horizontal acceleration in accelerometer

淺唱寂寞╮ 提交于 2020-01-25 08:36:05
问题 Is it possible to get acceleration only in horizontal direction irrespective of the placement of the device. I want to calculate acceleration of moving vehicle using android device. There may be cases where device is placed in any orientation. Is there any way by which i can calculate the acceleration of vehicle using accelerometer without calibrating each time? 来源: https://stackoverflow.com/questions/58959443/how-to-get-only-horizontal-acceleration-in-accelerometer

Rotate marker as per user direction on Google Maps V2 Android

假如想象 提交于 2020-01-17 10:18:19
问题 I want to rotate marker as per bearing or sensor value received from Accelerometer to show the user where actually he is moving. I have set marker icon and flat value to true but its not working as required. mCurrentLocationMarker.position(new LatLng( LocationUtils.sLatitude, LocationUtils.sLongitude)); mCurrentLocationMarker.icon(icon); mCurrentLocationMarker.flat(true); mCurrentLocationMarker.rotation(LocationUtils.sBearing); if (currentMarker != null) { currentMarker.setPosition(new LatLng

Mahony's algorithm - Yaw angle becomes unstable when rotating device fast

寵の児 提交于 2020-01-15 12:23:50
问题 I'm newbie in sensor and IMU so my question is probably very basic for others, but it's already puzzled me for days. I'm using Mahony's algorithm to calculate Euler angle of my device; the three angles looks correct when put the device static or move/rotate the device slowly; however, the Yaw angle will become unstable and incorrect if rotating the device fast. Could someone help me solve this issue ? My device uses MPU-9150, I use the 6 parameters method of Mahony algorithm, that is to say,

Accelerometer samplerate

霸气de小男生 提交于 2020-01-15 11:17:34
问题 I'm having some problems with the accelerometer. When I first started develop my game the controls felt very snappy and precise, but when adding more graphical elements the accelerometer feels like it's reacting very late and sometimes not as precise as before. I'm having a framerate of around 40fps. This is where I read the values (as i'm supposed to I guess) - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration; Is this a common and expected

Accelerometer samplerate

老子叫甜甜 提交于 2020-01-15 11:17:33
问题 I'm having some problems with the accelerometer. When I first started develop my game the controls felt very snappy and precise, but when adding more graphical elements the accelerometer feels like it's reacting very late and sometimes not as precise as before. I'm having a framerate of around 40fps. This is where I read the values (as i'm supposed to I guess) - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration; Is this a common and expected

Accelerometer samplerate

a 夏天 提交于 2020-01-15 11:17:30
问题 I'm having some problems with the accelerometer. When I first started develop my game the controls felt very snappy and precise, but when adding more graphical elements the accelerometer feels like it's reacting very late and sometimes not as precise as before. I'm having a framerate of around 40fps. This is where I read the values (as i'm supposed to I guess) - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration; Is this a common and expected

Detecting movement using accelerometer - (Orientation is not changing)?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-15 07:13:14
问题 I understand that we can detect orientation and its changes using accelerometer. Like whether the mobile phone is placed upside down, sideways or whatever. Can we detect movement of the phone (given the phone orientation is not changing)? Like the mobile phone is placed in a car and the car starts to move. In this case the mobile's orientation is not necessarily changing but can I detect this using accelerometer? I am looking this feature in API-8 at the most. 回答1: Yes. Look at LINEAR

Android accelerometer angle calculation

老子叫甜甜 提交于 2020-01-14 20:08:05
问题 Can anyone give any idea to calculate the angle by which a compass needle should be rotated to point in the direction of gravity from accelerometer x, y, z values? 回答1: I think X should be 0 and y should be positive while z is near 0 for the compass to point down towards earth. (Which means the phone is held vertical). In general, from the 0 angle, the compass' angle should be something like float accelerometerMaxRange = 10; // This is NOT right, but it's a good value to work with float

How to properly initialize I2C stm32?

╄→гoц情女王★ 提交于 2020-01-14 15:49:10
问题 I want to get data from ADXL345 accelerometer,but seems that I incorrectly connect it. SCL- PC6(with 10k resistor) SDA- PC7(with 10k resistor) SDO- GND CS - VCC GND - GND 3.3v - VCC Here is my code to initalize: void I2CG_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; I2C_InitTypeDef I2C_InitStructure; RCC_AHBPeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); RCC_AHBPeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); // I2CG clock enable RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2CG, ENABLE); RCC

Detect 360 degrees turn algorithm

孤人 提交于 2020-01-14 10:32:52
问题 I'm successfully detecting 0-360 degrees rotation (roll) of phone around an axis, but now I am having hard times designing an effective algorithm to detect one full turn. My working but I think not elegant and as effective algorithm as I would like is: private boolean detectRoll; private boolean[] checkpointsR = new boolean[4]; private boolean fullRollTurn; public void detectingRoll() { setDetectRoll(true); checkpointsR[0] = true; for (int i = 1; i < 4; i++) { if (roll > 90 * i && roll < 90 *