Using imufilter to estimate/plot orientation of avatar
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I am using a mpu9250 sensor and I read out acceleration and gyroscope data wearing this sensor on the hip.
I placed the sensor on the front hip with the axis orientation (if you are looking behind the person- you would be the user) :
- positive x axis shows up
- positive y axis shows right
- positive z axIs show to front (away from you)
It means that if my x axis shows up I know that my avatar (sticky figure) is standing since I have 1G (9.81m/s²) on the x axis.
I used the imufilter of Matlab to fuse acceleration and gyroscope values that gives out a quaternion. My problem is that the IMUfilter is using a reference frame with NED or ENU convention so it means i.e. if I would use NED ( x = shows north, y = shows east, z shows down) It means that I need to map my coordinate system of the sensor to it. (axis orientation of the sensor to it). If I am not rotating it to the coordinate system of matlab the avat is lying (see Imufilter1). So I am applying rotation matrix multiplaction around y axis of 90 degree and then rotation matrix around x axis to -90degree (clockwise rotation) to map the x axis up in the coordinate system of Matlab but the avatar lies again on the ground by on the stomach (see ImuFilter2). What I am doing wrong? Can you maybe explain me how to do it correectly because I tried everything but I think that I am doing something wrong with the NED reference system, since even my movements are wrong.
Can you help me to understand how to adapt the sensor's orientation to the fix coordinate system.
0 Kommentare
Antworten (1)
William Rose
am 11 Aug. 2023
@Matlab_Go, I'm just noticing this quesiton.
Remap your sensor data as follows:
Sensor +X (up) becomes NewSensor -Z (up).
Sensor +Y (right, which we'll call east) becomes NewSensor +Y (east)
Sensor +Z (forward, which we''ll call north) becomes NewSensor +X (north).
NewSensor data is your data, as if it were recorded with a sensor which is, as rest in the default position, aligned with the NED axes.
If your data is the Nx6 array, Sensor=[ax ay ax wx wy wz], where ax, ..., wz are Nx1 vectors, then you could do the following:
R=[0 0 1 0 0 0;
0 1 0 0 0 0;
-1 0 0 0 0 0;
0 0 0 0 0 1;
0 0 0 0 1 0;
0 0 0 -1 0 0];
% NewSensor=(R*Sensor')';
Let's test this. Assume the subject is facing north, and the actual accelerations are 9.8 downward (in the -X direction, in your sensor), +2 forward (north, +Z in your sensor), and +1 to the right (east, +Y in your sensor). Assume the angular velocities are zero. Then we have
Sensor=[-9.8, 1, 2, 0, 0, 0]; % your sensor's measurements
NewSensor=(R*Sensor')'; % what an NED sensor would have measured
disp(NewSensor)
Looks good. The accelerations in NewSensor have been mapped into the NED coordinate system. You can do a similar test to show that the angular velocities also get remapped correctly.
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!