Skip to content
Snippets Groups Projects
Commit b22b6a95 authored by Martin Karlsson's avatar Martin Karlsson
Browse files

comment update

parent 131bc28c
Branches
No related tags found
No related merge requests found
......@@ -87,34 +87,36 @@ void* handler_thread(void *arg) {
//------------------------------------------------------------------
/* Is called when trajectory is received from orca/robot. */
void handle_trajectory(coupling_yaFromRobot* v, void* context) {
// This cuntion is called once per sample.
// Actual configuration.
mat ya(1,dof);
for (int i = 0; i < dof; ++i) {
ya(i) = v->a[i];
}
// Time derivative of actual configuration.
mat yad(1,dof);
for (int i = dof; i < 2*dof; ++i) {
yad(i-dof) = v->a[i];
}
// Save trajectory (depending on mode)
mtx.lock();
record_ya(ya, dmpVec, dt, sparse_dt, takeEvery, RECORD_DMP, PLAY_DMP);
mtx.unlock();
// Execute DMP. Yields reference acceleration given the state.
mtx.lock();
state2yardd(ya,yad,yardd, PLAY_DMP, DMP_NBR, dmpVec, yclog, ycddlog, ya_minus_yc, yad_minus_ycd, e_norm_log, xlog, yc_minus_g, zlog);
mtx.unlock();
// Just for logging purposes.
mtx.lock();
write_norms_to_file(ya_minus_yc, yad_minus_ycd, e_norm_log, xlog, yc_minus_g, zlog, PLAY_DMP);
mtx.unlock();
}
//-------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment