Skip to content

Commit

Permalink
Update icub_firmware_shared_VERSION requirement to higher than 1.37.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MSECode committed Nov 24, 2023
1 parent 025ef68 commit 33224b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
4 changes: 2 additions & 2 deletions conf/iCubFindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ checkandset_dependency(OpenCV)
checkandset_dependency(Qt5)

if(icub_firmware_shared_FOUND AND ICUB_USE_icub_firmware_shared)
if(icub_firmware_shared_VERSION VERSION_LESS 1.37.1)
message(FATAL_ERROR "An old version of icub-firmware-shared has been detected: at least 1.37.1 is required")
if(icub_firmware_shared_VERSION VERSION_LESS 1.37.2)
message(FATAL_ERROR "An old version of icub-firmware-shared has been detected: at least 1.37.2 is required")
endif()
endif()

Expand Down
18 changes: 3 additions & 15 deletions src/libraries/icubmod/embObjMotionControl/embObjMotionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1601,20 +1601,11 @@ bool embObjMotionControl::update(eOprotID32_t id32, double timestamp, void *rxda
if((_temperatureSensorsVector.at(motor)->getType() == motor_temperature_sensor_none))
return true;

eOmc_motor_status_basic_t mc_motor_status_basic = {};
id32 = eoprot_ID_get(eoprot_endpoint_motioncontrol, eoprot_entity_mc_motor, motor, eoprot_tag_mc_motor_status_basic);
eOmc_motor_status_t *mc_motor_status = reinterpret_cast<eOmc_motor_status_t*>(rxdata);

if (!res->getLocalValue(id32, &mc_motor_status_basic))
if((double)mc_motor_status->basic.mot_temperature != temperatureErrorValue_s) //I get a valid value
{
yError() << getBoardInfo() << "getLocalValue() cannot retrieve motor" << motor << "status basic";
return true; //do we need to actually return false here since is eth error
}

//eOmc_motor_status_basic_t *mc_motor_status_basic = reinterpret_cast<eOmc_motor_status_basic_t*>(rxdata);

if((double)mc_motor_status_basic.mot_temperature != temperatureErrorValue_s) //I get a valid value
{
double tmp = _temperatureSensorsVector.at(motor)->convertRawToTempCelsius((double)mc_motor_status_basic.mot_temperature);
double tmp = _temperatureSensorsVector.at(motor)->convertRawToTempCelsius((double)mc_motor_status->basic.mot_temperature);

if (tmp > _temperatureLimits[motor].warningTemperatureLimit)
{
Expand Down Expand Up @@ -1657,8 +1648,6 @@ bool embObjMotionControl::update(eOprotID32_t id32, double timestamp, void *rxda
}
}



return true;
}

Expand Down Expand Up @@ -4816,7 +4805,6 @@ bool embObjMotionControl::getTemperatureRaw(int m, double* val)

if (((double)status.mot_temperature) == temperatureErrorValue_s) //using -5000 as the default value on 2FOC for initializing the temperature. If cannot read from I2C the value cannot be updated
{
yError() << getBoardInfo() << "At timestamp" << yarp::os::Time::now() << "In motor" << m << "cannot read Temperature" << *val << "from I2C. There might be cabling problems, TDB cable might be broken or sensor unreachable";
return false;
}

Expand Down

0 comments on commit 33224b5

Please sign in to comment.