Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iCubGenova09 – Jumps on the estimated yaw angle provided by the robot IMU #1487

Closed
GiulioRomualdi opened this issue Jan 19, 2023 · 16 comments

Comments

@GiulioRomualdi
Copy link
Member

Device name πŸ€–

iCubGenova09

Request/Failure description

I collected the orientation data coming from the robot imu mounted on the FTs and I noticed some jumps on the yaw angle. This may be related to #1485.

Detailed context

We collected the data as follows:

  1. we put the robot on the pole
  2. We collected the data using the multianalogsensor interface

Let us now define ${}^0 R_{imu}$ the orientation coming from the IMU w.r.t. the IMU inertial frame (denoted with 0). Let us now introduce $I$ the inertial frame considered by the kinematics. We would like to compare ${}^I R _ {imu}$ with $\prescript{I}{}{R} _ {expected}$ that is computed by the forward kinematics. ${} ^ I R_{imu}$ is given by $${}^I R_{imu} = {}^I R_{0} {}^0 R _{imu}$$
where ${}^I R _{0}$ is computed using the first readout of the imu as
$${}^I R _{0} = {}^I R _{imu}(0) {}^0 R _{imu}(0)^\top$$

We collected two datasets:

  1. The joints move from the homing configuration to a configuration where all leg joint positions are equal to 0. The associated dataset is called 2023_01_12_13_16_07.mat
  2. I set the leg joints configuration to 0 then I put the hip roll and pitch joints in idle so I can manually move the leg. This experiment (suggested by @traversaro) allows us to have the pitch and roll angle of the IMU in the legs equal to the one on the foot. The associated dataset is called 2023_01_18_16_39_51.mat

Both the datasets can be found here: datasets.zip

What follows are the plots associated with the experiment (1) (dataset 2023_01_12_13_16_07.mat)

r_leg r_foot_front r_foot_rear
rpy rpy rpy
l_leg l_foot_front l_foot_rear
rpy rpy rpy

As you can notice in the left leg the yaw angle jumps several times, as far as I can notice in the following plot (please notice that is the same plot as the l_leg plot in the above table with some labels) the jumps are not due the wrapping of the angle between (-180 +180 or 0 360). On the other hand, the roll angle jumps between +180 to -180 (and this is expected)

Moreover as far as I know at the instant in which the yaw jumps we are not in a gimbal lock situation.

image

Since the strange jumps seem to appear only on the yaw axis we decide to substitute the yaw angle with the one provided by the forward kinematics. So I defined
$${}^I R_{imu, fk} = R_{z}^{fk} R_{y}^{imu} R_{x}^{imu}$$ then I compared ${}^I R _ {imu}$ and ${}^I R_{imu, fk}$ with $\prescript{I}{}{R} _ {expected}$, as you can notice in the following videos when the yaw angle is forced to be the one provided by the forward kinematics the two frames almost coincide.

Videos of the dataset 2023_01_12_13_16_07.mat

IMU IMU w/ yaw correction
r_leg
out.mp4
out.mp4
r_foot_front
out.mp4
out.mp4
r_foot_rear
out.mp4
out.mp4
l_leg
out.mp4
out.mp4

Videos of the dataset 2023_01_18_16_39_51.mat

IMU IMU w/ yaw correction
r_leg
out.mp4
out.mp4
r_foot_front
out.mp4
out.mp4
r_foot_rear
out.mp4
out.mp4

⚠️ I was wondering if this behavior is connected to #1485 given the fact that the magnetometer value is mostly used to detect the yaw.

Additional context

Similarly to #1485 I opened the issue in tech-support but I don't think it is an issue specifically related to the iCubGenova09.

cc @pattacini @traversaro @G-Cervettini

How does it affect you?

No response

@traversaro
Copy link
Member

Apparently the issue is happening just on FT58, and not on FT45 . Did you checked which version of firmware is loaded on these devices?

@traversaro
Copy link
Member

Another thing that I think could be interesting is to plot in the same figure the yaw from the sensor and the one from the kinematics.

@GiulioRomualdi
Copy link
Member Author

Another thing that I think could be interesting is to plot in the same figure the yaw from the sensor and the one from the kinematics.

Hi @traversaro as you suggested I show you the plots of the rpy angle provided by the IK and the rpy extracted by ${} ^ I R_{imu}$
⚠️ ⚠️ As discussed in #1487 (comment) ${}^I R _ {imu}$ is not directly provided by the imu but is given by
$${}^I R_{imu} = {}^I R_{0} {}^0 R _{imu}$$
where ${}^I R _{0}$ gives us the possibility to align the orientation provided by the IMU to the FK orientation at the initial time instant.

Here are the plots, as you can notice the roll and pitch angles of the IMU follow the one evaluated by the FK. On the other hand, there is a mismatch regarding the yaw. In details on the leg imus (FT58), there are some jumps, while on the feet imus (FT45) the signal seems to be smooth but once the $yaw_{FK}$ increases the $yaw_{IMU}$ decreases and vice-versa.

r_leg r_foot_front r_foot_rear
rpy_imu_fk rpy_imu_fk rpy_imu_fk
l_leg l_foot_front l_foot_rear
rpy_imu_fk rpy_imu_fk rpy_imu_fk

@traversaro
Copy link
Member

Thanks, interestingly, also the differences in the yaw of foot sensors are quite strange. How are you going from homogenous matrices to RPY in the case of the forward kinematics?

@traversaro
Copy link
Member

By the way, sorry for the random suggestsions, but if the joints after the leg FT sensor and before the foot are constant, another thing that it would be interested to check is to plot {}^{l_foot_front} R_{l_foot_rear} and {}^{l_foot_front} R_{l_leg} . They should be constant, but if they are not constant something wrong is going on.

@AntonioConsilvio
Copy link
Contributor

Hi @traversaro @GiulioRomualdi, we are organizing to address this issue in early February.

cc @maggia80 @Fabrizio69 @pattacini

@pattacini
Copy link
Member

/remind February 06

@octo-reminder
Copy link

octo-reminder bot commented Jan 24, 2023

⏰ Reminder
Monday, February 6, 2023 10:00 AM (GMT+01:00)

@pattacini pattacini assigned sgiraz and unassigned Fabrizio69 Feb 1, 2023
@octo-reminder
Copy link

octo-reminder bot commented Feb 6, 2023

πŸ”” @pattacini

@pattacini
Copy link
Member

Just planned for this sprint!

@Nicogene
Copy link
Member

Nicogene commented Feb 14, 2023

We noticed similar jumps on yaw also inspecting the eul data with reading from the simulink model

immagine

Looking here it seems that it is due to magnetometer data not reliable, then is is somehow related to #1485

@Nicogene
Copy link
Member

Alongside @mfussi66, we managed to use ft-sensor-simulink for reading imu data from the rfe board. The magnetometer does not stream all zeros, and on the yaw of the Euler angle, we do not have unexpected jumps.

Here is the plot of the Euler angles:

immagine

@sgiraz sgiraz changed the title Jumps on the estimated yaw angle provided by the robot IMU iCubGenova09 – Jumps on the estimated yaw angle provided by the robot IMU Mar 22, 2023
@Nicogene
Copy link
Member

As we supposed fixing the magnetometer has fixed also the jumps in the Euler angles, see the plots above:

Thanks @marcoaccame!

Euler angles

strain2

immagine

mtb4

immagine

cc @GiulioRomualdi

@GiulioRomualdi
Copy link
Member Author

GiulioRomualdi commented Mar 30, 2023

That's wonderful! This activity was pivotal for enabling the usage of the feet imu in the walking infrastructure! Thank you, really!

Cc @G-Cervettini @DanielePucci

@DanielePucci
Copy link

Super cool, thanks @Nicogene @marcoaccame

@Nicogene
Copy link
Member

The fix has been delivered also in terms of binaries:

I think we can close the issue πŸš€

cc @GiulioRomualdi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

8 participants