Page 1 of 1

Looking for an alternative function to addInStationForce in Matlab API.

Posted: Wed Sep 19, 2018 2:00 pm
by echowangw
Hi all,

I am using the calcResidualForceIgnoringConstraints function in Matlab API to get the joint torques, what I want to do is including the ExpressionBasedBushingForces as part of the appliedBodyForces.

However, the forces I got from getRecordValues seemed to be applied at Bushing frames (in the global frame), not at body origins. As far as I know, in C++ API, addInStationForce function can be used to transform the bushing forces to body origin. Does anybody happen to know a similar function in Matlab API can solve my problem?

Thank you and kind regards,
Wei

Re: Looking for an alternative function to addInStationForce in Matlab API.

Posted: Thu Sep 20, 2018 5:44 am
by clnsmith
I don't know all the details about what you are trying to do, but to transform a vector I think you can do the following in MATLAB:

Frame has a method "findTransformBetween", you could use this to get the Transform between ground and your body Frame.

Then Transform has the following methods you can use to convert the force vector and application point:
xformBaseVecToFrame or xformFrameVecToBase
shiftBaseStationToFrame or shiftFrameStationToBase

Re: Looking for an alternative function to addInStationForce in Matlab API.

Posted: Thu Sep 20, 2018 1:15 pm
by echowangw
Hi Colin,

Thanks for your quick reply! Good to know the method of transform, and I have solved my problem now. :D