Skip to content

Commit

Permalink
Merge branch 'multipleEncoders'
Browse files Browse the repository at this point in the history
  • Loading branch information
valegagge committed May 20, 2016
2 parents 443af73 + fea420f commit a1e120e
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

set(icub_firmware_shared_MAJOR_VERSION 0)
set(icub_firmware_shared_MINOR_VERSION 2)
set(icub_firmware_shared_PATCH_VERSION 0)
set(icub_firmware_shared_PATCH_VERSION 1)
set(icub_firmware_shared_VERSION ${icub_firmware_shared_MAJOR_VERSION}.${icub_firmware_shared_MINOR_VERSION}.${icub_firmware_shared_PATCH_VERSION})


Expand Down
29 changes: 21 additions & 8 deletions eth/embobj/plus/comm-v2/icub/EoMotionControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ typedef struct
/** @typedef typedef uinion eOmc_joint_status_ofpid_t
@brief eOmc_joint_status_ofpid_t contains the status of a PID.
**/
typedef union // size is: 4+4+4+0 = 16
typedef union // size is: 20
{
eOmc_status_ofpid_legacy_t legacy;
eOmc_status_ofpid_generic_t generic;
Expand All @@ -755,7 +755,7 @@ typedef struct // size is 4 = 4
/** @typedef typedef struct eOmc_joint_status_measures_t
@brief eOmc_joint_status_measures_t contains the measures of a joint
**/
typedef struct // size is: 4+4+4+2+2+0 = 16
typedef struct // size is: 4+4+4+4 = 16
{
eOmeas_position_t meas_position; /**< the position of the joint */
eOmeas_velocity_t meas_velocity; /**< the velocity of the joint */
Expand All @@ -767,7 +767,7 @@ typedef struct // size is: 4+4+4+2+2+0 = 16
/** @typedef typedef struct eOmc_joint_status_modes_t
@brief eOmc_joint_status_modes_t contains the status modes of a joint
**/
typedef struct
typedef struct //size is 1+1+1+1 = 4
{
eOenum08_t controlmodestatus; /**< use eOmc_controlmode_t. */
eOenum08_t interactionmodestatus; /**< use values from eOmc_interactionmode_t */
Expand Down Expand Up @@ -801,14 +801,27 @@ typedef struct // size is: 4+4+4+4+4+4 = 24
} eOmc_joint_status_target_t; EO_VERIFYsizeof(eOmc_joint_status_target_t, 24);


enum{ eOmc_joint_multienc_maxnum = 3};
//typedef struct //size is 4*3 = 12
//{
// eOmeas_position_t listofenc[eOmc_joint_multiEnc_maxnum];
//} eOmc_joint_multipleEncoders_t;

typedef struct //size is = 12
{
//eOmc_joint_multipleEncoders_t multienc;
eOmeas_position_t multienc[eOmc_joint_multienc_maxnum];
} eOmc_joint_status_additionalInfo_t; EO_VERIFYsizeof(eOmc_joint_status_additionalInfo_t, 12);

/** @typedef typedef struct eOmc_joint_status_t
@brief eOmc_joint_status_t contains the status of a joint
**/
typedef struct // size is: 16+24+4 = 44
typedef struct // size is: 40+24+12 = 44
{
eOmc_joint_status_core_t core;
eOmc_joint_status_target_t target;
} eOmc_joint_status_t; EO_VERIFYsizeof(eOmc_joint_status_t, 64);
eOmc_joint_status_core_t core;
eOmc_joint_status_target_t target;
eOmc_joint_status_additionalInfo_t addinfo;
} eOmc_joint_status_t; EO_VERIFYsizeof(eOmc_joint_status_t, 76);



Expand All @@ -835,7 +848,7 @@ typedef struct // size is 168+40+4+44+0 = 256
eOmc_joint_status_t status; /**< the status of the joint */
eOmc_joint_inputs_t inputs; /**< it contains all the values that a host can send to a joint as inputs */
eOmc_joint_commands_t cmmnds; /**< it contains all the commands that a host can send to a joint */
} eOmc_joint_t; EO_VERIFYsizeof(eOmc_joint_t, 280);
} eOmc_joint_t; EO_VERIFYsizeof(eOmc_joint_t, 292);



Expand Down
25 changes: 14 additions & 11 deletions eth/embobj/plus/comm-v2/protocol/api/EoProtocolMC.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern "C" {
// - declaration of public user-defined types -------------------------------------------------------------------------


enum { eoprot_version_mc_major = 1, eoprot_version_mc_minor = 15 };
enum { eoprot_version_mc_major = 1, eoprot_version_mc_minor = 16 };

enum { eoprot_entities_mc_numberof = eomc_entities_numberof };

Expand All @@ -84,16 +84,17 @@ typedef enum
eoprot_tag_mc_joint_status_core_modes_controlmodestatus = 12,
eoprot_tag_mc_joint_status_core_modes_interactionmodestatus = 13,
eoprot_tag_mc_joint_status_core_modes_ismotiondone = 14,
eoprot_tag_mc_joint_inputs = 15,
eoprot_tag_mc_joint_inputs_externallymeasuredtorque = 16,
eoprot_tag_mc_joint_cmmnds_calibration = 17,
eoprot_tag_mc_joint_cmmnds_setpoint = 18,
eoprot_tag_mc_joint_cmmnds_stoptrajectory = 19,
eoprot_tag_mc_joint_cmmnds_controlmode = 20,
eoprot_tag_mc_joint_cmmnds_interactionmode = 21
eoprot_tag_mc_joint_status_addinfo_multienc = 15,
eoprot_tag_mc_joint_inputs = 16,
eoprot_tag_mc_joint_inputs_externallymeasuredtorque = 17,
eoprot_tag_mc_joint_cmmnds_calibration = 18,
eoprot_tag_mc_joint_cmmnds_setpoint = 19,
eoprot_tag_mc_joint_cmmnds_stoptrajectory = 20,
eoprot_tag_mc_joint_cmmnds_controlmode = 21,
eoprot_tag_mc_joint_cmmnds_interactionmode = 22
} eOprot_tag_mc_joint_t;

enum { eoprot_tags_mc_joint_numberof = 22 }; // it MUST be equal to the number of tags
enum { eoprot_tags_mc_joint_numberof = 23 }; // it MUST be equal to the number of tags


/** @typedef typedef enum eOprot_rwm_mc_joint_t
Expand All @@ -118,6 +119,7 @@ typedef enum
eoprot_rwm_mc_joint_status_core_modes_controlmodestatus = eo_nv_rwmode_RO,
eoprot_rwm_mc_joint_status_core_modes_interactionmodestatus = eo_nv_rwmode_RO,
eoprot_rwm_mc_joint_status_core_modes_ismotiondone = eo_nv_rwmode_RO,
eoprot_rwm_mc_joint_status_addinfo_multienc = eo_nv_rwmode_RO,
eoprot_rwm_mc_joint_inputs = eo_nv_rwmode_RW,
eoprot_rwm_mc_joint_inputs_externallymeasuredtorque = eo_nv_rwmode_RW,
eoprot_rwm_mc_joint_cmmnds_calibration = eo_nv_rwmode_RW,
Expand All @@ -127,7 +129,7 @@ typedef enum
eoprot_rwm_mc_joint_cmmnds_interactionmode = eo_nv_rwmode_RW
} eOprot_rwm_mc_joint_t;

enum { eoprot_rwms_mc_joint_numberof = 22 }; // it MUST be equal to the number of rw modes
enum { eoprot_rwms_mc_joint_numberof = 23 }; // it MUST be equal to the number of rw modes


// - definition of the motor
Expand Down Expand Up @@ -290,7 +292,8 @@ extern void eoprot_fun_UPDT_mc_joint_status_core_modes_interactionmodestatus(con
extern void eoprot_fun_INIT_mc_joint_status_core_modes_ismotiondone(const EOnv* nv);
extern void eoprot_fun_UPDT_mc_joint_status_core_modes_ismotiondone(const EOnv* nv, const eOropdescriptor_t* rd);


extern void eoprot_fun_INIT_mc_joint_status_addinfo_multienc(const EOnv* nv);
extern void eoprot_fun_UPDT_mc_joint_status_addinfo_multienc(const EOnv* nv, const eOropdescriptor_t* rd);

extern void eoprot_fun_INIT_mc_joint_inputs(const EOnv* nv);
extern void eoprot_fun_UPDT_mc_joint_inputs(const EOnv* nv, const eOropdescriptor_t* rd);
Expand Down
8 changes: 8 additions & 0 deletions eth/embobj/plus/comm-v2/protocol/src/EoProtocolMC_fun.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ EO_weak extern void eoprot_fun_INIT_mc_joint_status_core_modes_ismotiondone(cons
EO_weak extern void eoprot_fun_UPDT_mc_joint_status_core_modes_ismotiondone(const EOnv* nv, const eOropdescriptor_t* rd) {}
#endif

#if !defined(OVERRIDE_eoprot_fun_INIT_mc_joint_status_addinfo_multienc)
EO_weak extern void eoprot_fun_INIT_mc_joint_status_addinfo_multienc(const EOnv* nv) {}
#endif

#if !defined(OVERRIDE_eoprot_fun_UPDT_mc_joint_status_addinfo_multienc)
EO_weak extern void eoprot_fun_UPDT_mc_joint_status_addinfo_multienc(const EOnv* nv, const eOropdescriptor_t* rd) {}
#endif

#if !defined(OVERRIDE_eoprot_fun_INIT_mc_joint_inputs)
EO_weak extern void eoprot_fun_INIT_mc_joint_inputs(const EOnv* nv) {}
#endif
Expand Down
17 changes: 17 additions & 0 deletions eth/embobj/plus/comm-v2/protocol/src/EoProtocolMC_rom.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,21 @@ static EOPROT_ROMmap EOnv_rom_t eoprot_mc_rom_descriptor_joint_status_core_modes
#endif
};

static EOPROT_ROMmap EOnv_rom_t eoprot_mc_rom_descriptor_joint_status_addinfo_multienc =
{
EO_INIT(.capacity) sizeof(eoprot_mc_rom_joint_defaultvalue.status.addinfo.multienc),
EO_INIT(.rwmode) eoprot_rwm_mc_joint_status_addinfo_multienc,
EO_INIT(.dummy) 0,
EO_INIT(.resetval) (const void*)eoprot_mc_rom_joint_defaultvalue.status.addinfo.multienc,
#ifdef EOPROT_CFG_OVERRIDE_CALLBACKS_IN_RUNTIME
EO_INIT(.init) NULL,
EO_INIT(.update) NULL
#else
EO_INIT(.init) eoprot_fun_INIT_mc_joint_status_addinfo_multienc,
EO_INIT(.update) eoprot_fun_UPDT_mc_joint_status_addinfo_multienc
#endif
};


static EOPROT_ROMmap EOnv_rom_t eoprot_mc_rom_descriptor_joint_inputs =
{
Expand Down Expand Up @@ -686,6 +701,7 @@ static EOPROT_ROMmap EOnv_rom_t * const s_eoprot_mc_rom_joint_descriptors[] =
&eoprot_mc_rom_descriptor_joint_status_core_modes_controlmodestatus,
&eoprot_mc_rom_descriptor_joint_status_core_modes_interactionmodestatus,
&eoprot_mc_rom_descriptor_joint_status_core_modes_ismotiondone,
&eoprot_mc_rom_descriptor_joint_status_addinfo_multienc,
&eoprot_mc_rom_descriptor_joint_inputs,
&eoprot_mc_rom_descriptor_joint_inputs_externallymeasuredtorque,
&eoprot_mc_rom_descriptor_joint_cmmnds_calibration,
Expand Down Expand Up @@ -780,6 +796,7 @@ static const char * const s_eoprot_mc_strings_tags_joint[] =
"eoprot_tag_mc_joint_status_core_modes_controlmodestatus",
"eoprot_tag_mc_joint_status_core_modes_interactionmodestatus",
"eoprot_tag_mc_joint_status_core_modes_ismotiondone",
"eoprot_tag_mc_joint_status_addinfo_multienc",
"eoprot_tag_mc_joint_inputs",
"eoprot_tag_mc_joint_inputs_externallymeasuredtorque",
"eoprot_tag_mc_joint_cmmnds_calibration",
Expand Down

0 comments on commit a1e120e

Please sign in to comment.