Skip to content

Commit

Permalink
serious fix to avoid sudden jump in control output when deactiving, m…
Browse files Browse the repository at this point in the history
…oving

the robot with some other controller and activating again
  • Loading branch information
dmronga committed Nov 29, 2023
1 parent c0c0cdc commit dd56f3e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/whole_body_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,14 @@ controller_interface::CallbackReturn WholeBodyController::on_activate(const rclc
command_indices[iface_name].push_back(get_command_idx(joint_name, iface_name));
}
}

//Clear all task references, weights etc. to have to secure initial state
for(const auto &cfg : task_config)
scene->getTask(cfg.name)->reset();

// Also reinit the integrate as it will store the last joint position as a starting point
joint_integrator.reinit();

return CallbackReturn::SUCCESS;
}

Expand Down

0 comments on commit dd56f3e

Please sign in to comment.