-
Notifications
You must be signed in to change notification settings - Fork 9
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
Create a "Robot Sensors" library and add a first "IMU" block #40
Comments
The "RobotSensors" sub-library Note: For creating a tree of sub-libraries in a library, refer to https://www.mathworks.com/help/simulink/ug/adding-libraries-to-the-library-browser.html. Simulink |
Computation of the IMU sensor outputs
The IMU outputs are computed as follows... Gyroscope and Accelerometer measurementsThe IMU twist velocity and acceleration w.r.t. the world, expressed in the world frame, is given by: The same quantities expressed in the sensor frame Only the quantities expressed in the world frame (equations (1) and (2)) have been implemented in #41 . Orientation measurementIt is the orientation of the sensor frame with respect to the world frame, expressed as Euler angles following the same convention used in the iDynTree library, "Roll, Pitch, Yaw", such that the resulting rotation matrix is: In a real IMU, the orientation is estimated from the accelerometer's, gyroscope's and magnetometer's measurements and some sensor fusion algorithm. In the simulatior, we computed the Euler angles directly from the rotation transform We use the method
=> Implemented in #41 . |
Side note on the selectors feeding the "dotJnu" WBT block
robot_NDOF is set from the "IMUsensor" sub-system mask. The
|
CC @traversaro |
As the measured quantity is the proper acceleration, the gravity term was missing from equation (4) in #40 (comment). Thanks @traversaro . |
To be more accurate, and use the notation in traversaro's Thesis in sections 2.4.3 and 4.3.2: (here, I chose as inertial frame the world frame and ... |
... we can then compute the velocity
where
We then get for the acceleration: ... where we can compute the Jacobian (Refer to discussion comments #41 (comment) to #41 (comment) for further details) |
In order to use the simulator in other frameworks, typically within the controller models in
whole-body-controllers
(refer to whole-body-controllers#121, we create aRobotSensors
library and link it to the main library "Matlab Whole-body Simulator" (mwbs_lib.slx
) as a sub-library .The text was updated successfully, but these errors were encountered: