Simulate Accelerometer (Forward Kinematics)

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Vladimir Joukov
Posts: 1
Joined: Mon Aug 22, 2022 8:47 am

Simulate Accelerometer (Forward Kinematics)

Post by Vladimir Joukov » 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

Code: Select all

model.setStateVariableValue(state,'/jointset/shoulder/shoulder_coord_0/speed',10)
to set the joint velocity and then call

Code: Select all

model.realizeVelocity(state)
to simulate the joint rotating at a specified velocity and I do get the correct expected

Code: Select all

imu_frame_offset.getAngularVelocityInGround(state) : outputs [0 0 10]
However the acceleration is not being computed and I cannot figure out how to set the acceleration of the pin joint.

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)]]
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.

Tags:

POST REPLY