Main Page
Namespaces
Classes
Files
File List
File Members
include
temperature_safety_controller.cpp
Go to the documentation of this file.
1
#include "
temperature_safety_controller.h
"
2
3
namespace
hebiros
{
4
namespace
sim {
5
6
TemperatureSafetyController::TemperatureSafetyController
(
double
max_temp)
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::sim::TemperatureSafetyController::max_pwm_
double max_pwm_
Definition:
temperature_safety_controller.h:17
hebiros::sim::TemperatureSafetyController::limit
double limit(double raw_value)
Definition:
temperature_safety_controller.cpp:23
hebiros::sim::TemperatureSafetyController::update
void update(double measured_temp)
Definition:
temperature_safety_controller.cpp:10
hebiros::sim::TemperatureSafetyController::max_temp_
double max_temp_
Definition:
temperature_safety_controller.h:15
hebiros::sim::TemperatureSafetyController::TemperatureSafetyController
TemperatureSafetyController(double max_temp)
Definition:
temperature_safety_controller.cpp:6
hebiros
temperature_safety_controller.h
hebiros::sim::TemperatureSafetyController::lambda_
double lambda_
Definition:
temperature_safety_controller.h:16
hebiros_gazebo_plugin
Author(s): Xavier Artache
, Matthew Tesch
autogenerated on Thu Sep 3 2020 04:13:55