Page 1 of 1
Constraint Ball Joint
Posted: Wed Nov 07, 2018 10:18 am
by mlaudu
In the C++ code of ExampleClosedTopologyMechanism of Simbody, a ball constraint was defined using the form: "Constraint::Ball(linker1, Vec3(linkerHalfDims[0],0,0), rocker1, Vec3(0,-rockerHalfDims[1],0));" When I used the same form in my code as: SimTK::Constraint::Ball(parent_body, loc_p, child_body, loc_c); results in error: "Incomplete type is not allowed". Could anyone explain to me why it works in that scenario and not in my case? Thanks.
Musa
Re: Constraint Ball Joint
Posted: Wed Nov 07, 2018 2:38 pm
by sherm
An incomplete type error can arise from a missing header file in the complaining compilation unit. It would likely help also to know which of the many objects in that statement the compiler is complaining about.
Re: Constraint Ball Joint
Posted: Mon Nov 12, 2018 1:06 am
by mitkof6
Hi,
It is possible that you provided the Body instances to the Ball constraint. The first argument to the constraint is a MobilizedBody object.
Code: Select all
Ball (MobilizedBody &parent, const Transform &X_PF, const Body &bodyInfo, const Transform &X_BM, Direction=Forward)
Regards