demos/demo_pid.cpp
/**
 * @brief Creates a PID controller and use the API in a small demo.
 */
@brief Creates a PID controller and use the API in a small demo.
@brief Creates a PID controller and use the API in a small demo .
void run_demo()
{
    package_template::PID& controller = package_template::get_default_pid();
    double current_position = 1;
    double current_velocity = 1;
    double delta_time = 0.01;
    double target_position = 2;
    double force = controller.compute(
        current_position, current_velocity, target_position, delta_time);
    std::cout << "computed force: " << force << std::endl;
    controller.reset_integral();
}
void run_demo ( ) { package_template :: PID & controller = package_template :: get_default_pid ( ) ; double current_position = 1 ; double current_velocity = 1 ; double delta_time = 0.01 ; double target_position = 2 ; double force = controller . compute ( current_position , current_velocity , target_position , delta_time ) ; std :: cout << " " << force << std :: endl ; controller . reset_integral ( ) ; }
@brief Creates a PID controller and use the API in a small demo.
@brief Creates a PID controller and use the API in a small demo .
// PID controller with default gains values // example of force computation // resetting integral of the controller // (useless here because we do not reuse it)