Skip to content

Commit

Permalink
Remove inertials2 structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogene committed Nov 28, 2023
1 parent d062aca commit eb253bf
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 112 deletions.
6 changes: 4 additions & 2 deletions conf/iCubFindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ checkandset_dependency(IPOPT)
checkandset_dependency(OpenCV)
checkandset_dependency(Qt5)

set(MINIMUM_REQUIRED_icub_firmware_shared_VERSION 1.37.2)

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 ${MINIMUM_REQUIRED_icub_firmware_shared_VERSION})
message(FATAL_ERROR "An old version of icub-firmware-shared has been detected: at least ${MINIMUM_REQUIRED_icub_firmware_shared_VERSION} is required")
endif()
endif()

Expand Down
1 change: 0 additions & 1 deletion src/libraries/icubmod/embObjLib/IethResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ namespace eth {
iethres_motioncontrol = 3,
iethres_skin = 4,
iethres_analogvirtual = 5,
iethres_analoginertial = 6,
iethres_analogmultienc = 7,
iethres_analoginertial3 = 8,
iethres_temperature = 9,
Expand Down
8 changes: 0 additions & 8 deletions src/libraries/icubmod/embObjLib/diagnosticInfoParsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ void ConfigParser::parseInfo()
} break;

case eoerror_value_CFG_skin_failed_toomanyboards:
case eoerror_value_CFG_inertials_failed_toomanyboards:
case eoerror_value_CFG_inertials3_failed_toomanyboards:
case eoerror_value_CFG_temperatures_failed_toomanyboards:
{
Expand All @@ -276,7 +275,6 @@ void ConfigParser::parseInfo()
} break;

case eoerror_value_CFG_skin_failed_candiscovery:
case eoerror_value_CFG_inertials_failed_candiscovery:
case eoerror_value_CFG_inertials3_failed_candiscovery:
case eoerror_value_CFG_temperatures_failed_candiscovery:
{
Expand Down Expand Up @@ -367,7 +365,6 @@ void ConfigParser::parseInfo()
case eoerror_value_CFG_mc_mc4_failed_mais_verify:
case eoerror_value_CFG_mc_mc4plus_ok:
case eoerror_value_CFG_mc_mc4plus_failed_encoders_verify:
case eoerror_value_CFG_inertials_ok:
case eoerror_value_CFG_comm_cannotloadaregularrop:
case eoerror_value_CFG_mc_mc4plusmais_ok:
case eoerror_value_CFG_mc_mc4plusmais_failed_encoders_verify:
Expand All @@ -377,13 +374,11 @@ void ConfigParser::parseInfo()
case eoerror_value_CFG_strain_not_verified_yet:
case eoerror_value_CFG_mais_not_verified_yet:
case eoerror_value_CFG_skin_not_verified_yet:
case eoerror_value_CFG_inertials_not_verified_yet:
case eoerror_value_CFG_inertials3_not_verified_yet:
case eoerror_value_CFG_encoders_not_verified_yet:
case eoerror_value_CFG_mc_using_onboard_config:
case eoerror_value_CFG_strain_using_onboard_config:
case eoerror_value_CFG_mais_using_onboard_config:
case eoerror_value_CFG_inertials_using_onboard_config:
case eoerror_value_CFG_inertials3_using_onboard_config:
case eoerror_value_CFG_skin_using_onboard_config:
case eoerror_value_CFG_inertials3_ok:
Expand All @@ -396,7 +391,6 @@ void ConfigParser::parseInfo()
case eoerror_value_CFG_mc_mc2pluspsc_ok:
case eoerror_value_CFG_mc_mc2pluspsc_failed_encoders_verify:
case eoerror_value_CFG_mc_mc2pluspsc_failed_candiscovery_of_pscs:
case eoerror_value_CFG_inertials_failed_notsupported:
case eoerror_value_CFG_inertials3_failed_notsupported:
case eoerror_value_CFG_temperatures_failed_notsupported:
case eoerror_value_CFG_mais_failed_notsupported:
Expand Down Expand Up @@ -474,7 +468,6 @@ void ConfigParser::parseInfo()

} break;

case eoerror_value_CFG_inertials_failed_unsupportedsensor:
case eoerror_value_CFG_inertials3_failed_unsupportedsensor:
{
int16_t unsuppsens = m_dnginfo.param16;
Expand All @@ -486,7 +479,6 @@ void ConfigParser::parseInfo()
m_dnginfo.baseInfo.finalMessage.append(str);
} break;

case eoerror_value_CFG_inertials_changed_requestedrate:
case eoerror_value_CFG_inertials3_changed_requestedrate:
case eoerror_value_CFG_temperatures_changed_requestedrate:
case eoerror_value_CFG_psc_changed_requestedrate:
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/icubmod/embObjLib/ethBoards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,6 @@ eth::IethResource* eth::EthBoards::get_interface(eOipv4addr_t ipv4, eOprotID32_t
type = iethres_analogstrain;
else if(eoprot_entity_as_mais == en)
type = iethres_analogmais;
else if(eoprot_entity_as_inertial == en)
type = iethres_analoginertial;
else if(eoprot_entity_as_inertial3 == en)
type = iethres_analoginertial3;
else if(eoprot_entity_as_temperature == en)
Expand Down
5 changes: 0 additions & 5 deletions src/libraries/icubmod/embObjLib/ethManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,6 @@ int TheEthManager::releaseResource2(eth::AbstractEthResource* ethresource, IethR
category = eomn_serv_category_none;
} break;

case iethres_analoginertial:
{
category = eomn_serv_category_inertials;
} break;

case iethres_analoginertial3:
{
category = eomn_serv_category_inertials3;
Expand Down
9 changes: 1 addition & 8 deletions src/libraries/icubmod/embObjLib/hostTransceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,14 +914,7 @@ void HostTransceiver::eoprot_override_as(void)
EO_INIT(.init) NULL,
EO_INIT(.update) eoprot_fun_UPDT_as_mais_status_the15values
},
// inertial
{ // eoprot_tag_as_inertial_status: it gives data from mtb to the device, so that it writes it in the relevant yarp port
EO_INIT(.endpoint) eoprot_endpoint_analogsensors,
EO_INIT(.entity) eoprot_entity_as_inertial,
EO_INIT(.tag) eoprot_tag_as_inertial_status,
EO_INIT(.init) NULL,
EO_INIT(.update) eoprot_fun_UPDT_as_inertial_status
}, // inertial3
// inertial3
{ // eoprot_tag_as_inertial3_status: ...
EO_INIT(.endpoint) eoprot_endpoint_analogsensors,
EO_INIT(.entity) eoprot_entity_as_inertial3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@

static void handle_data_analogarray(const EOnv* nv, const eOropdescriptor_t* rd);

static void handle_data_inertial(const EOnv* nv, const eOropdescriptor_t* rd);

static void handle_data_inertial3(const EOnv* nv, const eOropdescriptor_t* rd);

static void handle_data_temperature(const EOnv* nv, const eOropdescriptor_t* rd);
Expand Down Expand Up @@ -114,14 +112,6 @@ extern void eoprot_fun_UPDT_as_mais_status_the15values(const EOnv* nv, const eOr
}


extern void eoprot_fun_UPDT_as_inertial_status(const EOnv* nv, const eOropdescriptor_t* rd)
{
if(eo_ropcode_sig == rd->ropcode)
{
handle_data_inertial(nv, rd);
}
}

extern void eoprot_fun_UPDT_as_inertial3_status(const EOnv* nv, const eOropdescriptor_t* rd)
{
if(eo_ropcode_sig == rd->ropcode)
Expand Down Expand Up @@ -186,13 +176,6 @@ static void handle_data_analogarray(const EOnv* nv, const eOropdescriptor_t* rd)
}
}

static void handle_data_inertial(const EOnv* nv, const eOropdescriptor_t* rd)
{
eOas_inertial_status_t *inertialstatus = (eOas_inertial_status_t*)rd->data;
feat_manage_analogsensors_data(eo_nv_GetIP(nv), rd->id32, (void *)inertialstatus);
}


static void handle_data_inertial3(const EOnv* nv, const eOropdescriptor_t* rd)
{
eOas_inertial3_status_t *inertial3status = (eOas_inertial3_status_t*)rd->data;
Expand Down
60 changes: 0 additions & 60 deletions src/libraries/icubmod/embObjLib/serviceParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1591,66 +1591,6 @@ bool ServiceParser::parseService(Searchable &config, servConfigFTsensor_t &ftcon
return true;
}

bool ServiceParser::parseService(Searchable &config, servConfigInertials_t &inertialsconfig)
{
if(false == check_analog(config, eomn_serv_AS_inertials))
{
yError() << "ServiceParser::parseService() has received an invalid SERVICE group for inertials";
return false;
}

// now we extract values ... so far we dont make many checks ... we just assume the vector<> are of size 1.
servCanBoard_t themtb_props = as_service.properties.canboards.at(0);

// it must be an mtb
if(eobrd_cantype_mtb != themtb_props.type)
{
yError() << "ServiceParser::parseService() has detected an invalid type of board. it should be a eobrd_mtb but is a:" << eoboards_type2string2(eoboards_cantype2type(themtb_props.type), eobool_false);
return false;
}

inertialsconfig.acquisitionrate = as_service.settings.acquisitionrate;

memset(&inertialsconfig.ethservice.configuration, 0, sizeof(inertialsconfig.ethservice.configuration));

inertialsconfig.ethservice.configuration.type = eomn_serv_AS_inertials;
memcpy(&inertialsconfig.ethservice.configuration.data.as.inertial.mtbversion.protocol, &themtb_props.protocol, sizeof(eObrd_protocolversion_t));
memcpy(&inertialsconfig.ethservice.configuration.data.as.inertial.mtbversion.firmware, &themtb_props.firmware, sizeof(eObrd_firmwareversion_t));

// now, for all the sensors we must fill:
// - inertialsconfig.ethservice.configuration.data.as.inertial.canmap[2] with mask of location of mtb boards... no, i dont do it
// - the vector of ...


inertialsconfig.inertials.resize(0);

EOarray* array = eo_array_New(eOas_inertials_maxnumber, sizeof(eOas_inertial_descriptor_t), &inertialsconfig.ethservice.configuration.data.as.inertial.arrayofsensors);
for(size_t i=0; i<as_service.settings.enabledsensors.size(); i++)
{
servAnalogSensor_t sensor = as_service.settings.enabledsensors.at(i);
eOas_sensor_t type = sensor.type;

if((eoas_accel_mtb_int != type) && (eoas_accel_mtb_ext != type) && (eoas_gyros_mtb_ext != type) && (eoas_gyros_st_l3g4200d != type))
{
yWarning() << "ServiceParser::parseService() has detected a wrong inertial sensor:" << eoas_sensor2string(type) << " ... we drop it";
continue;
}
// if ok, i copy it inside ...

eOas_inertial_descriptor_t des = {};
des.type = type;
memcpy(&des.on, &sensor.location, sizeof(eObrd_location_t));

eo_array_PushBack(array, &des);
inertialsconfig.inertials.push_back(des);
inertialsconfig.id.push_back(sensor.id);
}


return true;
}


bool ServiceParser::parseService(Searchable &config, servConfigImu_t &imuconfig)
{
if(false == check_analog(config, eomn_serv_AS_inertials3))
Expand Down
9 changes: 0 additions & 9 deletions src/libraries/icubmod/embObjLib/serviceParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ typedef struct
std::string frameName;
} servConfigFTsensor_t;

typedef struct
{
eOmn_serv_parameter_t ethservice;
int acquisitionrate;
std::vector<eOas_inertial_descriptor_t> inertials;
std::vector<std::string> id;
} servConfigInertials_t;

typedef struct
{
double accFactor;
Expand Down Expand Up @@ -297,7 +289,6 @@ class ServiceParser
bool parseService(yarp::os::Searchable &config, servConfigMais_t& maisconfig);
bool parseService(yarp::os::Searchable &config, servConfigStrain_t &strainconfig);
bool parseService(yarp::os::Searchable &config, servConfigFTsensor_t &ftconfig);
bool parseService(yarp::os::Searchable &config, servConfigInertials_t &inertialsconfig);
bool parseService(yarp::os::Searchable &config, servConfigImu_t &imuconfig);
bool parseService(yarp::os::Searchable &config, servConfigSkin_t &skinconfig);
bool parseService(yarp::os::Searchable &config, servConfigPSC_t &pscconfig);
Expand Down

0 comments on commit eb253bf

Please sign in to comment.