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
Constraint Ball Joint
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Constraint Ball Joint
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.
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Constraint Ball Joint
Hi,
It is possible that you provided the Body instances to the Ball constraint. The first argument to the constraint is a MobilizedBody object.
Regards
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)