Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Inertials2 structures/classes/functions #90

Merged
merged 6 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
cmake_minimum_required(VERSION 3.12)

project(icub_firmware_shared
VERSION 1.37.2)
VERSION 1.37.3)

find_package(YCM 0.11.0 REQUIRED)

Expand Down
86 changes: 6 additions & 80 deletions eth/embobj/plus/comm-v2/icub/EoAnalogSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,14 @@ typedef enum
eoas_entity_strain = 0,
eoas_entity_mais = 1,
eoas_entity_temperature = 2,
eoas_entity_inertial = 3,
eoas_entity_inertial3 = 4,
eoas_entity_psc = 5,
eoas_entity_pos = 6,
eoas_entity_ft = 7,
eoas_entity_battery = 8
eoas_entity_inertial3 = 3,
eoas_entity_psc = 4,
eoas_entity_pos = 5,
eoas_entity_ft = 6,
eoas_entity_battery = 7
} eOas_entity_t;

enum { eoas_entities_numberof = 9 };
enum { eoas_entities_numberof = 8 };


// -- all the possible enum
Expand Down Expand Up @@ -368,79 +367,6 @@ typedef struct // size is: 4+20+4 = 28
eOas_temperature_commands_t cmmnds;
} eOas_temperature_t; EO_VERIFYsizeof(eOas_temperature_t, 28)


// -- the definition of a inertial sensor

typedef enum
{
eoas_inertial_accel_mtb_int = eoas_accel_mtb_int,
eoas_inertial_accel_mtb_ext = eoas_accel_mtb_ext,
eoas_inertial_gyros_mtb_ext = eoas_gyros_mtb_ext,
eoas_inertial_accel_ems_st_lis3x = eoas_accel_st_lis3x,
eoas_inertial_gyros_ems_st_l3g4200d = eoas_gyros_st_l3g4200d,
eoas_inertial_unknown = eoas_unknown,
eoas_inertial_none = eoas_none
} eOas_inertial_type_t;



// this struct describes a single inertial sensor
typedef struct
{
eObrd_location_t on;
uint8_t type; // use relevant entry of eOas_inertial_type_t
} eOas_inertial_descriptor_t; EO_VERIFYsizeof(eOas_inertial_descriptor_t, 2)


// we use this struct to send activate-verify command to the board
enum { eOas_inertials_maxnumber = 48 };
typedef struct
{
eOarray_head_t head;
eOas_inertial_descriptor_t data[eOas_inertials_maxnumber];
} eOas_inertial_arrayof_sensors_t; EO_VERIFYsizeof(eOas_inertial_arrayof_sensors_t, 100)


// this struct describes the data acquired by a single intertial sensor
typedef struct
{
uint64_t timestamp; // the time in usec of reception of this data
uint16_t id; // an id which is shared by transmitter and receiver. it can be a unique number or an index inside the array-of-sensors
int16_t x; /**< x value */
int16_t y; /**< y value */
int16_t z; /**< z value */
} eOas_inertial_data_t; EO_VERIFYsizeof(eOas_inertial_data_t, 16)


typedef struct
{
uint8_t datarate; /**< it specifies the acquisition rate in ms with accepted range [10, 200]. bug: if 250 the mtb emits every 35 */
uint8_t filler[7];
uint64_t enabled; // bitmask of enabled sensors with reference to array-of-sensors
} eOas_inertial_config_t; EO_VERIFYsizeof(eOas_inertial_config_t, 16)


typedef struct
{
eOas_inertial_data_t data; /**< it is the most recent reading of the inertial sensors which are related to this entity */
} eOas_inertial_status_t; EO_VERIFYsizeof(eOas_inertial_status_t, 16)


typedef struct
{
uint8_t enable; /**< use 0 or 1*/
uint8_t filler[7];
} eOas_inertial_commands_t; EO_VERIFYsizeof(eOas_inertial_commands_t, 8)


typedef struct // size is: 16+16+8 = 40
{
eOas_inertial_config_t config;
eOas_inertial_status_t status;
eOas_inertial_commands_t cmmnds;
} eOas_inertial_t; EO_VERIFYsizeof(eOas_inertial_t, 40)


// -- the definition of a inertial3 sensor
// inertial3 sensor contains the new inertial sensors generated by a imu, plus the old ones

Expand Down
9 changes: 0 additions & 9 deletions eth/embobj/plus/comm-v2/icub/EoError.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ const eoerror_valuestring_t eoerror_valuestrings_CFG[] =
{eoerror_value_CFG_encoders_ok, "CFG: EOtheEncoderReader can be correctly configured"," par16&0xf000: number of joint; primary encs: failure mask in par16&0x000f and errorcodes in par64&0x0000ffff; secondary encs: failure mask in par16&0x00f0 and errorcodes in par64&0xffff0000"},
{eoerror_value_CFG_encoders_failed_verify, "CFG: EOtheEncoderReader cannot be configured: verification fails", "par16&0xf000: number of joint; primary encs: failure mask in par16&0x000f and errorcodes in par64&0x0000ffff; secondary encs: failure mask in par16&0x00f0 and errorcodes in par64&0xffff0000"},

{eoerror_value_CFG_inertials_ok, "CFG: EOtheInertial can be correctly configured.", ""},
{eoerror_value_CFG_inertials_failed_toomanyboards, "CFG: EOtheInertial cannot be configured", "In par16: number of requested boards in 0xff00, max number in 0x00ff. In par64: mask of requested boards in 0x00000000ffff0000 (can2) and 0x000000000000ffff (can1)."},
{eoerror_value_CFG_inertials_failed_candiscovery, "CFG: EOtheInertial cannot be configured. CANdiscovery fails", "In par64 from lsb to msb masks of: missing can1, can2, found but incompatible can1, can2"},

{eoerror_value_CFG_comm_cannotloadaregularrop, "CFG: cannot load a regular rop.", ""},

Expand All @@ -280,18 +277,13 @@ const eoerror_valuestring_t eoerror_valuestrings_CFG[] =
{eoerror_value_CFG_strain_not_verified_yet, "CFG: EOtheSTRAIN service was not verified yet, thus it cannot start.", ""},
{eoerror_value_CFG_mais_not_verified_yet, "CFG: EOtheMAIS service was not verified yet, thus it cannot start.", ""},
{eoerror_value_CFG_skin_not_verified_yet, "CFG: EOtheSKIN service was not verified yet, thus it cannot start.", ""},
{eoerror_value_CFG_inertials_not_verified_yet, "CFG: EOtheInertials service was not verified yet, thus it cannot start.", ""},
{eoerror_value_CFG_inertials3_not_verified_yet, "CFG: EOtheInertials3 service was not verified yet, thus it cannot start.", ""},
{eoerror_value_CFG_encoders_not_verified_yet, "CFG: EOtheEncoderReader service was not verified yet, thus it cannot start.", ""},
{eoerror_value_CFG_mc_using_onboard_config, "CFG: EOtheMotionController service is using the local default configuration based on its IP address.", ""},
{eoerror_value_CFG_strain_using_onboard_config, "CFG: EOtheSTRAIN service is using the local default configuration based on its IP address.", ""},
{eoerror_value_CFG_mais_using_onboard_config, "CFG: EOtheMAIS service is using the local default configuration based on its IP address.", ""},
{eoerror_value_CFG_inertials_using_onboard_config, "CFG: EOtheInertials service is using the local default configuration based on its IP address.", ""},
{eoerror_value_CFG_inertials3_using_onboard_config, "CFG: EOtheInertials3 service is using the local default configuration based on its IP address.", ""},
{eoerror_value_CFG_skin_using_onboard_config, "CFG: EOtheSKIN service is using the local default configuration based on its IP address.", ""},

{eoerror_value_CFG_inertials_failed_unsupportedsensor, "CFG: EOtheInertial cannot be configured. some sensors are not supported", "In par16 their number."},
{eoerror_value_CFG_inertials_changed_requestedrate, "CFG: EOtheInertial has changed the requested rate", "In par16 the requested (MSB) and the assigned (LSB)."},

{eoerror_value_CFG_inertials3_failed_unsupportedsensor, "CFG: EOtheInertial3 cannot be configured. some sensors are not supported", "In par16 their number."},
{eoerror_value_CFG_inertials3_changed_requestedrate, "CFG: EOtheInertial3 has changed the requested rate", "In par16 the requested (MSB) and the assigned (LSB)."},
Expand Down Expand Up @@ -320,7 +312,6 @@ const eoerror_valuestring_t eoerror_valuestrings_CFG[] =
{eoerror_value_CFG_mc_mc2pluspsc_failed_encoders_verify, "CFG: EOtheMotionController cannot be configured. verification of encoder fails for mc2pluspsc. see other messages for more details", ""},
{eoerror_value_CFG_mc_mc2pluspsc_failed_candiscovery_of_pscs, "CFG: EOtheMotionController cannot be configured. verification of pscs for mc2pluspsc fails. see other messages for more details", ""},

{eoerror_value_CFG_inertials_failed_notsupported, "CFG: EOtheInertials cannot be configured. This board does not support this service.", ""},
{eoerror_value_CFG_inertials3_failed_notsupported, "CFG: EOtheInertials3 cannot be configured. This board does not support this service.", ""},
{eoerror_value_CFG_temperatures_failed_notsupported, "CFG: EOtheTemperatures cannot be configured. This board does not support this service.", ""},
{eoerror_value_CFG_mais_failed_notsupported, "CFG: EOtheMAIS cannot be configured. This board does not support this service.", ""},
Expand Down
164 changes: 77 additions & 87 deletions eth/embobj/plus/comm-v2/icub/EoError.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,105 +315,95 @@ typedef enum

eoerror_value_CFG_encoders_ok = 21,
eoerror_value_CFG_encoders_failed_verify = 22,

eoerror_value_CFG_inertials_ok = 23,
eoerror_value_CFG_inertials_failed_toomanyboards = 24,
eoerror_value_CFG_inertials_failed_candiscovery = 25,

eoerror_value_CFG_comm_cannotloadaregularrop = 26,

eoerror_value_CFG_mc_mc4plusmais_ok = 27,
eoerror_value_CFG_mc_mc4plusmais_failed_encoders_verify = 28,
eoerror_value_CFG_mc_mc4plusmais_failed_candiscovery_of_mais = 29,

eoerror_value_CFG_services_not_verified_yet = 30,
eoerror_value_CFG_mc_not_verified_yet = 31,
eoerror_value_CFG_strain_not_verified_yet = 32,
eoerror_value_CFG_mais_not_verified_yet = 33,
eoerror_value_CFG_skin_not_verified_yet = 34,
eoerror_value_CFG_inertials_not_verified_yet = 35,
eoerror_value_CFG_inertials3_not_verified_yet = 36,
eoerror_value_CFG_encoders_not_verified_yet = 37,

eoerror_value_CFG_mc_using_onboard_config = 38,
eoerror_value_CFG_strain_using_onboard_config = 39,
eoerror_value_CFG_mais_using_onboard_config = 40,
eoerror_value_CFG_inertials_using_onboard_config = 41,
eoerror_value_CFG_inertials3_using_onboard_config = 42,
eoerror_value_CFG_skin_using_onboard_config = 43,
eoerror_value_CFG_comm_cannotloadaregularrop = 23,

eoerror_value_CFG_inertials_failed_unsupportedsensor= 44,
eoerror_value_CFG_inertials_changed_requestedrate = 45,

eoerror_value_CFG_inertials3_failed_unsupportedsensor= 46,
eoerror_value_CFG_inertials3_changed_requestedrate = 47,
eoerror_value_CFG_mc_mc4plusmais_ok = 24,
eoerror_value_CFG_mc_mc4plusmais_failed_encoders_verify = 25,
eoerror_value_CFG_mc_mc4plusmais_failed_candiscovery_of_mais = 26,

eoerror_value_CFG_services_not_verified_yet = 27,
eoerror_value_CFG_mc_not_verified_yet = 28,
eoerror_value_CFG_strain_not_verified_yet = 29,
eoerror_value_CFG_mais_not_verified_yet = 30,
eoerror_value_CFG_skin_not_verified_yet = 31,
eoerror_value_CFG_inertials3_not_verified_yet = 32,
eoerror_value_CFG_encoders_not_verified_yet = 33,

eoerror_value_CFG_mc_using_onboard_config = 34,
eoerror_value_CFG_strain_using_onboard_config = 35,
eoerror_value_CFG_mais_using_onboard_config = 36,
eoerror_value_CFG_inertials3_using_onboard_config = 37,
eoerror_value_CFG_skin_using_onboard_config = 38,

eoerror_value_CFG_inertials3_failed_unsupportedsensor= 39,
eoerror_value_CFG_inertials3_changed_requestedrate = 40,

eoerror_value_CFG_inertials3_ok = 48,
eoerror_value_CFG_inertials3_failed_toomanyboards = 49,
eoerror_value_CFG_inertials3_failed_candiscovery = 50,
eoerror_value_CFG_inertials3_failed_generic = 51,
eoerror_value_CFG_inertials3_ok = 41,
eoerror_value_CFG_inertials3_failed_toomanyboards = 42,
eoerror_value_CFG_inertials3_failed_candiscovery = 43,
eoerror_value_CFG_inertials3_failed_generic = 44,

eoerror_value_CFG_temperatures_not_verified_yet = 52,
eoerror_value_CFG_temperatures_ok = 53,
eoerror_value_CFG_temperatures_failed_toomanyboards = 54,
eoerror_value_CFG_temperatures_failed_candiscovery = 55,
eoerror_value_CFG_temperatures_failed_generic = 56,
eoerror_value_CFG_temperatures_changed_requestedrate = 57,
eoerror_value_CFG_temperatures_using_onboard_config = 58,
eoerror_value_CFG_temperatures_not_verified_yet = 45,
eoerror_value_CFG_temperatures_ok = 46,
eoerror_value_CFG_temperatures_failed_toomanyboards = 47,
eoerror_value_CFG_temperatures_failed_candiscovery = 48,
eoerror_value_CFG_temperatures_failed_generic = 49,
eoerror_value_CFG_temperatures_changed_requestedrate = 50,
eoerror_value_CFG_temperatures_using_onboard_config = 51,

eoerror_value_CFG_psc_ok = 59,
eoerror_value_CFG_psc_failed_candiscovery = 60,
eoerror_value_CFG_psc_failed_verify_because_active = 61,
eoerror_value_CFG_psc_not_verified_yet = 62,
eoerror_value_CFG_psc_using_onboard_config = 63,
eoerror_value_CFG_psc_changed_requestedrate = 64,
eoerror_value_CFG_psc_ok = 52,
eoerror_value_CFG_psc_failed_candiscovery = 53,
eoerror_value_CFG_psc_failed_verify_because_active = 54,
eoerror_value_CFG_psc_not_verified_yet = 55,
eoerror_value_CFG_psc_using_onboard_config = 56,
eoerror_value_CFG_psc_changed_requestedrate = 57,


eoerror_value_CFG_mc_mc2pluspsc_ok = 65,
eoerror_value_CFG_mc_mc2pluspsc_failed_encoders_verify = 66,
eoerror_value_CFG_mc_mc2pluspsc_failed_candiscovery_of_pscs = 67,
eoerror_value_CFG_mc_mc2pluspsc_ok = 58,
eoerror_value_CFG_mc_mc2pluspsc_failed_encoders_verify = 59,
eoerror_value_CFG_mc_mc2pluspsc_failed_candiscovery_of_pscs = 60,

eoerror_value_CFG_inertials_failed_notsupported = 68,
eoerror_value_CFG_inertials3_failed_notsupported = 69,
eoerror_value_CFG_temperatures_failed_notsupported = 70,
eoerror_value_CFG_mais_failed_notsupported = 71,
eoerror_value_CFG_strain_failed_notsupported = 72,
eoerror_value_CFG_skin_failed_notsupported = 73,
eoerror_value_CFG_psc_failed_notsupported = 74,
eoerror_value_CFG_mc_failed_notsupported = 75,
eoerror_value_CFG_encoders_failed_notsupported = 76,
eoerror_value_CFG_inertials3_failed_notsupported = 61,
eoerror_value_CFG_temperatures_failed_notsupported = 62,
eoerror_value_CFG_mais_failed_notsupported = 63,
eoerror_value_CFG_strain_failed_notsupported = 64,
eoerror_value_CFG_skin_failed_notsupported = 65,
eoerror_value_CFG_psc_failed_notsupported = 66,
eoerror_value_CFG_mc_failed_notsupported = 67,
eoerror_value_CFG_encoders_failed_notsupported = 68,

eoerror_value_CFG_pos_ok = 77,
eoerror_value_CFG_pos_failed_candiscovery = 78,
eoerror_value_CFG_pos_failed_verify_because_active = 79,
eoerror_value_CFG_pos_not_verified_yet = 80,
eoerror_value_CFG_pos_using_onboard_config = 81,
eoerror_value_CFG_pos_changed_requestedrate = 82,
eoerror_value_CFG_pos_failed_notsupported = 83,
eoerror_value_CFG_pos_ok = 69,
eoerror_value_CFG_pos_failed_candiscovery = 70,
eoerror_value_CFG_pos_failed_verify_because_active = 71,
eoerror_value_CFG_pos_not_verified_yet = 72,
eoerror_value_CFG_pos_using_onboard_config = 73,
eoerror_value_CFG_pos_changed_requestedrate = 74,
eoerror_value_CFG_pos_failed_notsupported = 75,

eoerror_value_CFG_mc_mc4plusfaps_ok = 84,
eoerror_value_CFG_mc_mc4plusfaps_failed_encoders_verify = 85,
eoerror_value_CFG_mc_mc4plusfaps_failed_candiscovery = 86,

eoerror_value_CFG_mc_mc4pluspmc_ok = 87,
eoerror_value_CFG_mc_mc4pluspmc_failed_encoders_verify = 88,
eoerror_value_CFG_mc_mc4pluspmc_failed_candiscovery_of_pmc = 89,

eoerror_value_CFG_ft_ok = 90,
eoerror_value_CFG_ft_failed_candiscovery = 91,
eoerror_value_CFG_ft_not_verified_yet = 92,
eoerror_value_CFG_ft_using_onboard_config = 93,
eoerror_value_CFG_ft_failed_notsupported = 94,
eoerror_value_CFG_ft_failed_fullscales = 95,

eoerror_value_CFG_bat_ok = 96,
eoerror_value_CFG_bat_failed_candiscovery = 97,
eoerror_value_CFG_bat_not_verified_yet = 98,
eoerror_value_CFG_bat_using_onboard_config = 99,
eoerror_value_CFG_bat_failed_notsupported = 100,
eoerror_value_CFG_mc_mc4plusfaps_ok = 76,
eoerror_value_CFG_mc_mc4plusfaps_failed_encoders_verify = 77,
eoerror_value_CFG_mc_mc4plusfaps_failed_candiscovery = 78,

eoerror_value_CFG_mc_mc4pluspmc_ok = 79,
eoerror_value_CFG_mc_mc4pluspmc_failed_encoders_verify = 80,
eoerror_value_CFG_mc_mc4pluspmc_failed_candiscovery_of_pmc = 81,

eoerror_value_CFG_ft_ok = 82,
eoerror_value_CFG_ft_failed_candiscovery = 83,
eoerror_value_CFG_ft_not_verified_yet = 84,
eoerror_value_CFG_ft_using_onboard_config = 85,
eoerror_value_CFG_ft_failed_notsupported = 86,
eoerror_value_CFG_ft_failed_fullscales = 87,

eoerror_value_CFG_bat_ok = 88,
eoerror_value_CFG_bat_failed_candiscovery = 89,
eoerror_value_CFG_bat_not_verified_yet = 90,
eoerror_value_CFG_bat_using_onboard_config = 91,
eoerror_value_CFG_bat_failed_notsupported = 92,
} eOerror_value_CFG_t;

enum { eoerror_value_CFG_numberof = 101 };
enum { eoerror_value_CFG_numberof = 93 };


/** @typedef typedef enum eOerror_value_ETHMON_t
Expand Down
2 changes: 0 additions & 2 deletions eth/embobj/plus/comm-v2/icub/EoManagement.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ static const char * s_mn_servicetype_strings[] =
"eomn_serv_MC_mc4plusmais",
"eomn_serv_AS_mais",
"eomn_serv_AS_strain",
"eomn_serv_AS_inertials",
"eomn_serv_SK_skin",
"eomn_serv_AS_inertials3",
"eomn_serv_AS_temperature",
Expand All @@ -99,7 +98,6 @@ static const char * s_mn_servicecategory_strings[] =
"eomn_serv_category_mc",
"eomn_serv_category_strain"
"eomn_serv_category_mais",
"eomn_serv_category_inertials",
"eomn_serv_category_skin",
"eomn_serv_category_inertials3",
"eomn_serv_category_temperatures",
Expand Down
Loading