-
Notifications
You must be signed in to change notification settings - Fork 198
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
IMU readings reported wrongly in different Roll/Pitch #198
Comments
Original comment by Hashir Zahir (Bitbucket: hzahir).
|
1 similar comment
Original comment by Hashir Zahir (Bitbucket: hzahir).
|
Original comment by Hashir Zahir (Bitbucket: hzahir). Or is this behavior expected in the sense that the Gazebo ROS IMU plugin does not get its yaw from “true north” or “true east” and hence flipping the IMU upside down inverts the yaw? Also, what would be the recommended way to get the “actual” rpy of the vehicle from the base_link frame. I had applied an inverse transform from base_link to imu_link to the raw readings of the imu, but as mentioned above, they only work when the IMU is rotated about the yaw axis but if its rotated about the pitch axis the inverse transform does not recover the actual vehicle heading. |
Original comment by Hashir Zahir (Bitbucket: hzahir).
|
The RPY values obtained from the gazebo_ros_imu plugin is the transformation from the world2imu frames, meaning it's the rotation matrix from the world to imu frame. However, the actual values that you would want the RPY values to be giving, is the transformation from the base_link2world frame, as that will give you the actual orientation of the ASV. These 2 transformations are the same only if the imu and base_link frames are aligned. Otherwise, you would need to perform an additional step of rotating your quaternion. However, in the event that they are not, you will need another static transform publisher to give you the transformation matrix for the imu2base_link. You may use this function from tf2 to apply the quaternion rotations: |
I believe there may be a workaround if you use a new tag in the |
@bsb808 and I did some tests trying to reproduce your issue but we couldn't. Initial conditions Testing
Converting the quaternion from the
Conclusion Could you double-check on your side please? |
All, Not necessarily on topic for this issue, but we've seen an increase in usage of (or at least reported issues) with this project. I'm curious what project (or projects) folks are working on - are you working on RobotX 2020, VRX 2021 or something else entirely? |
Hi Brian, yes most of our team is utilizing this simulator to speed up development in preparation for RobotX in Dec 2020 (assuming it doesn't get cancelled) since live testing is almost impossible given the current global situation. |
|
Hi, actually we are developing a custom URDF based off your default URDF to better model our real life vehicle. In that URDF, we tried to follow as closely to the example URDF provided using the YAML files. So our IMU link looked something like this:
Perhaps there was something wrong with the way we implemented our IMU plugin? We can confirm using the above joint results in |
This was eventually resolved as we mounted the IMU to rpy = (0,0,0) in our custom urdf instead of the previous (pi,0,0) , which might have caused some unexpected issues. The issue can be closed as we no longer face IMU reading issues. |
Original report (archived issue) by Hashir Zahir (Bitbucket: hzahir).
This is a related issue to Issue 188 (#188), which has already been resolved in pull request 216. However, I notice some strange behavior.
Using revolute joints fixed the issue (mostly) or so I thought as I have discovered a bug. Rotations in yaw for the IMU plugin work perfectly with this new fix (the fixed joint method reports inaccurate readings), however, rotations in pitch or roll result in incorrect readings from the IMU.
For example, using
<xacro:wamv_imu name="imu_wamv" y="-0.2" R="3.14159"/>
where the roll is set to 180 degrees instead of yaw, the raw readings reported by the IMU plugin is (r,p,y) = (0,0, 2.76) when the correct readings are supposed to be (r,p,y) = (0,0,-2.76) (notice the yaw has been flipped/inverted). This does not make sense since physical IMU has been flipped 180 degrees. Setting an arbitary value of rpy in the macro results in even more disastrous readings.Example:
<xacro:wamv_imu name="imu_wamv" y="-0.2" R="1" P="0" Y="0"/>
results in rpy = (1.966, -0.319, -2.928), when the actual reading should have been rpy = (1,0,-2.76).
Can someone help to verify this behavior? And also any ideas on a possible fix? This is more for teams whose real life IMU provide NED data and hence the IMU link is provided with rpy = (3.14,0,0) but unfortunately the plugin doesnt seem to respond well to roll or pitch. Thanks.
The text was updated successfully, but these errors were encountered: