本文整理汇总了C++中PrismaticJoint::getJointForceTorque方法的典型用法代码示例。如果您正苦于以下问题:C++ PrismaticJoint::getJointForceTorque方法的具体用法?C++ PrismaticJoint::getJointForceTorque怎么用?C++ PrismaticJoint::getJointForceTorque使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrismaticJoint
的用法示例。
在下文中一共展示了PrismaticJoint::getJointForceTorque方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void) {
using namespace mbslib;
MbsCompoundWithBuilder mbs;
mbs.addFixedBase();
mbs.addFork();
PrismaticJoint * pj = mbs.addPrismaticJoint(TVector3(1, 0, 0));
Endpoint * s1End1 = mbs.addEndpoint();
mbs.addFixedTranslation(TVector3(1, 0, 0));
mbs.addFork();
Endpoint * s1Midpoint = mbs.addEndpoint();
mbs.addFixedTranslation(TVector3(1, 0, 0));
RevoluteJoint * rj = mbs.addRevoluteJoint(TVector3(0, 0, 1));
mbs.addFork();
mbs.addFixedTranslation(TVector3(0, 1, 0));
Endpoint * s1End2 = mbs.addEndpoint();
mbs.addRigidLink(TVector3(1, 0, 0), TVector3::Zero(), 1, TMatrix3x3::Zero());
Endpoint * tcp = mbs.addEndpoint();
LinearSpringWithRopeModel springModel(1, 0, 1);
Spring3D * spring = mbs.addSpring(springModel);
(*spring) << s1End1 << s1Midpoint << s1End2;
//mbs.doDirkin();
//spring.resetForce();
//spring.applyForce();
mbs.doRne();
std::cout << s1End1->getCoordinateFrame().r.transpose() << std::endl;
std::cout << s1End2->getCoordinateFrame().r.transpose() << std::endl;
std::cout << tcp->getCoordinateFrame().r.transpose() << std::endl;
std::cout << spring->getSpringForce() << std::endl;
std::cout << pj->getJointForceTorque() << std::endl;
std::cout << rj->getJointForceTorque() << std::endl;
}