Setup constant gravity vector for imusensor object of Sensor Fusion and Tracking Toolbox
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Jan Piosik
il 22 Nov 2020
Risposto: Brian Fanous
il 23 Nov 2020
I want to create an output of an imu sensor from my data set of acceleration and angular velocity. For this I'm using the "imusensor" object of the Sensor Fusion and Tracking Toolbox to include the gravity in the acceleration data set. My problem is, that the gravity vector always points in the direction of the z-axis even if the sensor rotates due to the angular velocity. So ist there a way to set up the gravity vector, so that it does not rotate with the sensor and does not always points in the direction of the z-axis?
In the example below the gravity vector always points in the direction of the z-axis, even if there is a constant angular velocity
IMU_test = imuSensor;
acc_test=zeros(100,3);
gyr_test=zeros(100,3);
gyro_test(:,1) = 1;
[accelReadings, gyroReadings] = IMU_test(acc_test,gyr_test)
0 Commenti
Risposta accettata
Brian Fanous
il 23 Nov 2020
Hi Jan
The syntax you are using on the final line assumes the IMU always has its (body) coordinate system aligned with the global coordinate system. Supply a final input argument to alter the orientation of our IMU relative to the global coordinate system.
[accelReadings, gyroReadings = IMU_test(acc_test, gyr_test, quaternion([30 40 50], ‘eulerd’, ‘ZYX’, ‘frame’); % IMU at a 30deg yaw, 40 deg pitch, 50 deg roll relative to NED.
Brian
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Sensor Models in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!