Skip to content

Commit

Permalink
Fix overriding of converted temperature value
Browse files Browse the repository at this point in the history
  • Loading branch information
MSECode committed Nov 7, 2023
1 parent a3e68cb commit 64b9880
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4756,7 +4756,7 @@ bool embObjMotionControl::getTemperatureRaw(int m, double* val)
*val = (double) status.mot_temperature ;
if (_foc_based_info[m].temperatureSensorType != motor_temperature_sensor_none)
{
_temperatureSensorsVector.at(m)->convertRawToTempCelsius(*val);
*val = _temperatureSensorsVector.at(m)->convertRawToTempCelsius(*val);
}
}
else
Expand Down
8 changes: 4 additions & 4 deletions src/libraries/icubmod/embObjMotionControl/eomcParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ class TemperatureSensorPT100 : public ITemperatureSensor

TemperatureSensorPT100()
{
_r_1 = 4700.0;
_r_2 = 4700.0;
_r_3 = 100.0;
_r_1 = 4700;
_r_2 = 4700;
_r_3 = 100;

_ptc_offset = 100.0;
_ptc_gradient = 0.3851;
Expand Down Expand Up @@ -151,7 +151,7 @@ class TemperatureSensorPT100 : public ITemperatureSensor
res = (tmp * (_r_1*_r_2 + _r_1*_r_3 + _ptc_offset*_r_2 + _ptc_offset*_r_3) / den) + ((_r_3*_r_1 - _r_2*_ptc_offset) / den);


yDebug("Converted temperature to Celsius degree value:%f", temperature);
yDebug("Converted temperature to Celsius degree value:%f", res);
return res;
}

Expand Down

0 comments on commit 64b9880

Please sign in to comment.