orocos_kinematics_dynamics
orocos_kinematics_dynamics copied to clipboard
Segments are public in a Chain
Why is the member std::vector<Segment> segments public in Chain? Is there a specific reason? One would probably never do it, but this allows to do something like:
chain.segments.push_back(Segment("foo", Joint(), Frame(Vector(1,0,0)));
which I think would not cause any runtime error but cause several troubles in all solvers (since they check consistency of a chain using getNrOfSegments, which in turn uses nrOfSegments).
Wouldn't it be better to set it as private? Otherwise, what about writing a function like update() that updates the variables nrOfJoints and nrOfSegments in case segments are changed externally?
A candidate for a major API refactoring and cleanup (#271)...