temperature_safety_controller.cpp
Go to the documentation of this file.
2 
3 namespace hebiros {
4 namespace sim {
5 
7  : max_temp_(max_temp) {
8 }
9 
10 void TemperatureSafetyController::update(double measured_temp) {
11  if (measured_temp >= max_temp_) {
12  max_pwm_ = 0;
13  return;
14  }
15  float d_val = max_temp_ - measured_temp;
16  float d_pwm = lambda_ / d_val;
17  if (d_pwm > 1.0)
18  max_pwm_ = 0;
19  else
20  max_pwm_ = 1.0 - d_pwm;
21 }
22 
23 double TemperatureSafetyController::limit(double raw_value) {
24  if (raw_value > max_pwm_)
25  return max_pwm_;
26  else if (raw_value < -max_pwm_)
27  return -max_pwm_;
28  return raw_value;
29 }
30 
31 }
32 }


hebiros_gazebo_plugin
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:13:55