필터 지우기
필터 지우기

Integral velocity to get angle

조회 수: 3 (최근 30일)
Dekel Mashiach
Dekel Mashiach 2022년 5월 17일
편집: Torsten 2022년 5월 17일
I'm trying to get the angle from mpu6050... anyone can help?
clear all; clc;
port = 'COM9'; %
board = 'Uno'; %
a = arduino(port,board,'Libraries', 'I2C'); %
fprintf("Connected")
imu = mpu6050(a);
while(1)
velocity = readAngularVelocity(imu);
angle = integral(velocity,time) %need to fix
pause(3)
end
  댓글 수: 3
Dekel Mashiach
Dekel Mashiach 2022년 5월 17일
velocity is an array, and I need to get the angle (he is also an array)
Torsten
Torsten 2022년 5월 17일
편집: Torsten 2022년 5월 17일
Maybe
angle = trapz(time,velocity)
if "angle" is the integral of "velocity" with respect to "time" and "time" is an array of the same size as "velocity".

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 I2C Devices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by