Commit 73cc8f7f authored by Jan Koniarik's avatar Jan Koniarik
Browse files

pid update now returns actual output

parent 3d3848bf
Pipeline #102279 passed with stage
in 10 seconds
......@@ -77,12 +77,12 @@ public:
/// Algorithm changes it's internal value output_ to the value that should be set to a
/// 'thing' that controls input_ value. It tries to control the 'thing' so the input
/// eventually converges to 'desired' value
void update( time_type now, float input, float desired )
float update( time_type now, float input, float desired )
{
float t_diff = static_cast< float >( now - last_time_ );
if ( t_diff == 0.f ) {
return;
return output_;
}
float error = desired - input;
......@@ -97,6 +97,8 @@ public:
last_input_ = input;
last_time_ = now;
return output_;
}
float get_output()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment