Simulate Accelerometer (Forward Kinematics)
Posted: Thu Sep 07, 2023 11:31 am
Hello,
I am trying to simulate an IMU attached to a model and get the angular velocity and linear acceleration measurements.
I set up a very simple model with a single pin joint connecting the ground to a body.
I added an offset frame to the body to simulate the IMU.
I can use to set the joint velocity and then call to simulate the joint rotating at a specified velocity and I do get the correct expected
However the acceleration is not being computed and I cannot figure out how to set the acceleration of the pin joint.
How can I set the acceleration of a joint and compute the linear acceleration of any frame in the model in ground?
My end goal is to use full body motion capture data (joint positions, velocities, and accelerations) to simulate gyroscope and accelerometer measurements for an attached IMU.
I am trying to simulate an IMU attached to a model and get the angular velocity and linear acceleration measurements.
I set up a very simple model with a single pin joint connecting the ground to a body.
I added an offset frame to the body to simulate the IMU.
I can use
Code: Select all
model.setStateVariableValue(state,'/jointset/shoulder/shoulder_coord_0/speed',10)
Code: Select all
model.realizeVelocity(state)
Code: Select all
imu_frame_offset.getAngularVelocityInGround(state) : outputs [0 0 10]
Code: Select all
arm.realizeAcceleration(state)
print(imu_frame_offset.getAccelerationInGround(state)) : outputs [~[-nan(ind),-nan(ind),-nan(ind)],~[-nan(ind),-nan(ind),-nan(ind)]]
My end goal is to use full body motion capture data (joint positions, velocities, and accelerations) to simulate gyroscope and accelerometer measurements for an attached IMU.