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

Update diagnostic to make it more general #998

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

MSECode
Copy link
Contributor

@MSECode MSECode commented Dec 2, 2024

Make for abs encoders (at joint) are more general
Moroever, now we show the abs encoder type too in the diagnostic message, solving the issue: robotology/icub-firmware#533
Related to:

@MSECode MSECode marked this pull request as draft December 2, 2024 16:08
@MSECode MSECode requested a review from valegagge December 2, 2024 16:08
@MSECode MSECode self-assigned this Dec 2, 2024
@pattacini
Copy link
Member

Hi @MSECode

Remember to manage versioning.

CMakeLists.txt Outdated Show resolved Hide resolved
@MSECode MSECode force-pushed the feature/fixDiagnosticAEA branch from cc08c6e to 7a15add Compare December 3, 2024 10:35
The default value is the empty string
It returns false in case of error and the encoderTypeName string is filled with "ERROR"
*/
virtual bool getEncoderTypeName(uint32_t jomoId, eOmc_position_t pos, std::string &encoderTypeName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @MSECode, the class IethResource was created just to hold methods common to every EthResource, so it it should not contain a method that is related only to the MC device and not to for instance the SKIN device.

If you want something that is meaningful to MC device only you should use embObjMotionControl directly.

The way we use IethResource allows to easily transform IethResource* into its parent device.

The lines 44 and 45 tell briefly how to do that for the case of embObjSkin. I will show you in the next comment how to do that for the case of embObjMotionControl .

So, in here this code should be removed.

@@ -75,6 +75,12 @@ bool IethResource::getEntityName(uint32_t entityId, std::string &entityName)
return true;
}

bool IethResource::getEncoderTypeName(uint32_t jomoId, eOmc_position_t pos, std::string &encoderTypeName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as from previous comment this code should be removed.

@@ -447,6 +447,7 @@ class yarp::dev::embObjMotionControl: public DeviceDriver,
virtual eth::iethresType_t type();
virtual bool update(eOprotID32_t id32, double timestamp, void *rxdata);
virtual bool getEntityName(uint32_t entityId, std::string &entityName);
virtual bool getEncoderTypeName(uint32_t jomoId, eOmc_position_t pos, std::string &encoderTypeName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as from previous comments the virtual keyword should be removed

@MSECode MSECode force-pushed the feature/fixDiagnosticAEA branch from c415131 to 82f6f37 Compare December 5, 2024 15:43
Copy link
Contributor

@marcoaccame marcoaccame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you have achieved the correct result in the log everything is fine by me

Copy link
Member

@Nicogene Nicogene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions for resolving the CI failure

cc @marcoaccame

@@ -94,7 +94,8 @@ add_library(${PROJECT_NAME} ${embobj_source} ${embobj_header})

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../motionControlLib
${PATH_TO_CALLBACK}/embObjAnalog/usrcbk/
../skinLib)
../skinLib
../embObjMotionControl)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI failure is due to the fact that here we are adding embObjMotionControl as build dependency of embObjLib, but embObjMotionControl depends from embObjLib, creating a circular dependency we should avoid.

return false;
}

if(embObjMotionControl *emc = dynamic_cast<embObjMotionControl*>(m_MC_ethRes); emc != nullptr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid circular dependency I would:

  • add getEncoderTypeName in the IEthResource with a default implementation
  • Implement (marking it override) getEncorderTypeName in embObjMotionControl
  • Change this code in order to directly invoke m_MC_ethRes->getEncoderTypeName without the need of the dynamic_cast

Make for abs encoders (at joint) are more general
Moroever, now we show the abs encoder type too in the diagnostic message
Aligned with icub-firmware-shared 1.41.1
@MSECode MSECode force-pushed the feature/fixDiagnosticAEA branch from be15947 to 1885e14 Compare December 13, 2024 09:35
@MSECode MSECode requested a review from Nicogene December 13, 2024 10:13
@pattacini
Copy link
Member

The CI is now happy.
cc @Nicogene @valegagge @marcoaccame

@pattacini
Copy link
Member

Awaiting the final approval of @marcoaccame and @valegagge before merging.

@pattacini
Copy link
Member

/remind December 16, please let's proceed asap with this.

Copy link

octo-reminder bot commented Dec 14, 2024

Reminder
Monday, December 16, 2024 10:00 AM (GMT+01:00)

, please let's proceed asap with this.

Copy link
Member

@valegagge valegagge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pattacini
Copy link
Member

pattacini commented Dec 16, 2024

Great! Let me merge it then as we need to address this failure:

Also, #989 will have to be rebased on top of this because of versioning.

Tip

Further requests can be integrated later on, possibly.

@pattacini pattacini merged commit 8da1a41 into robotology:devel Dec 16, 2024
4 checks passed
Copy link

octo-reminder bot commented Dec 16, 2024

🔔 @pattacini

, please let's proceed asap with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants