get position segment in Controller (ComputeControls)
Posted: Sun Jan 08, 2017 3:05 am
Hi,
I want to acces the position of a specific body inside the computeControls function of my controller class.
I tried this as follows
There is something wrong with this code, but I have no idea why is doesn't want to compute the position information.
The code does not run on the line: [getModel().getSimbodyEngine().getPosition(s, body_sel, p1, p2);]. Can anyone help me ?
regards,
Maarten
I want to acces the position of a specific body inside the computeControls function of my controller class.
I tried this as follows
Code: Select all
void COM_MuscleController::computeControls(const SimTK::State& s, SimTK::Vector& controls) const
{
OpenSim::Body body_sel = getModel().getBodySet().get("calcn_l"); // get body
getModel().getMultibodySystem().realize(s, Stage::Velocity); // needed ?
Vec3 p1 = Vec3(0, 0, 0); Vec3 p2 = Vec3(0, 0, 0);
getModel().getSimbodyEngine().getPosition(s, body_sel, p1, p2); // compute position (p2)
};
The code does not run on the line: [getModel().getSimbodyEngine().getPosition(s, body_sel, p1, p2);]. Can anyone help me ?
regards,
Maarten