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

Runtime configuration of mtb4 / mtb4c boards to manage ergoCub hand (5 fingers + palm) #530

Merged
merged 7 commits into from
Oct 30, 2024

Conversation

simeonedussoni
Copy link
Contributor

@simeonedussoni simeonedussoni commented Oct 29, 2024

In short

as per several discussions with @marcoaccame this PR contains the updated fw for the MTB4/c FW that allows to runtime switch the mapping between conventional and reshuffled mapping allowing to read out the ergoCubhand complete with palm in a back compatible fashion. the configuration is triggered when the MTB4/c receivess skinType = 3 command.

Full description

This PR allows to use the mtb4 / mtb4c board to manage all skin types in our robots.

The configurability of the skin type is done through the parameter SKIN_SET_BRD_CFG.skinType inside the CAN protocol message SKIN_SET_BRD_CFG.

Traditional skin patches

For traditional skin patches nothing changes and we can use the usual values of SKIN_SET_BRD_CFG.skinType plus the configuration of the triangles as usual.

This PR improve the document describing the CAN protocol of the sensor boards by clarifying how the triangles inside a skin patch are mapped to the actual HW in terms of the pair (I2C bus, I2C adr).

The skin patch on the ergoCub hand

On the ergoCub hand we have one triangle for each of the five fingertips and four triangles in the palm.

We also wanted that each fingertip maintains the same I2C address so that we can easily change across the five fingers. That has required two things:

  • add support for a fifth I2C bus on boards mtb4 and mtb4c;
  • define a dedicated mapping of the nine triangles distributed on the five I2C buses that still is in the range ID = [0, 15], so that we can maintain the standard iCub CAN protocol.

We did the former in a previous PR:

We have done the latter in here by:

  • adding an additional value for the SKIN_SET_BRD_CFG.skinType: the Message_SKIN_SET_BRD_CFG::SkinType::ergoHand that is equal to 3.
  • enabling the reading of the 9 triangles in the ergoCub hand from the correct I2C mapping
  • giving external visibility with a simple logical mapping from 0 to 8.

How to use the skin of ergoCub

To use the skin of the ergoCub hand is necessary to:

  • produce the binaries of the mtb4 and mtb4c w/ a PR scheduled soon;
  • perform some changes in the xml files of the robot. That will be matter of a future PR.
    It will be enough:
    • to define a skin type = 3 in the xml file
    • to configure triangles 0 to 8 in the same xml file
    • to have defined a proper mapping file for the SkinGui.

Tests an mergeability

Extensive test we done on a dedicated setup for reading the skin of the palm and also for backwards compatibility w/ the standard patches.

I believe that we can safely merge.

Associated PRs

This PR:

@simeonedussoni simeonedussoni marked this pull request as draft October 29, 2024 11:18
@simeonedussoni
Copy link
Contributor Author

I'm going to improve commented out relics etc and will do one more commit @marcoaccame

@marcoaccame
Copy link
Contributor

I'm going to improve commented out relics etc and will do one more commit @marcoaccame

ok @simeonedussoni thanks. I will write you some hints in the following.

@simeonedussoni
Copy link
Contributor Author

@marcoaccame I thank you for the effort, but it's a llittle confusing for me since I'm already correcting/amending'/improving the items you highlighted, and having the comments distracts me from running smoothly...

@marcoaccame
Copy link
Contributor

ok, I stopped

@simeonedussoni
Copy link
Contributor Author

in commit 8ae1ea4 I implemented all the above and some minor corrections needed from the previous PR with the same board involved.

@simeonedussoni simeonedussoni marked this pull request as ready for review October 29, 2024 17:13
@marcoaccame
Copy link
Contributor

in commit 8ae1ea4 I implemented all the above and some minor corrections needed from the previous PR with the same board involved.

Hi @simeonedussoni, great!

I will add a few changes to this PR and in particular:

  • systematic removal of all tabs inside embot_app_application_theSkin.cpp,
  • removal of an unnecessary bitmask inside some code related to the ems,
  • removed from projects of mtb4 and mtb4c the forcing of using compiler V6.19 because since Added dummy retargeting for the SYS IO functions #510 we can safely use the latest armclang compiler version.

@marcoaccame marcoaccame changed the title Feat/ergo mtb4/c firmware add fifth finger + palm dynamic mapping. Runtime configuration of mtb4 / mtb4c boards to manage ergoCub hand (5 fingers + palm) Oct 30, 2024
…iangles ID of the skin are mapped to the actual I2C hw
@marcoaccame
Copy link
Contributor

in commit 8ae1ea4 I implemented all the above and some minor corrections needed from the previous PR with the same board involved.

Hi @simeonedussoni, great!

I will add a few changes to this PR and in particular:

  • systematic removal of all tabs inside embot_app_application_theSkin.cpp,
  • removal of an unnecessary bitmask inside some code related to the ems,
  • removed from projects of mtb4 and mtb4c the forcing of using compiler V6.19 because since Added dummy retargeting for the SYS IO functions #510 we can safely use the latest armclang compiler version.

I have also improved the document about CAN protocol of the sensor boards to clarify how to use the SKIN_SET_BRD_CFG.skinType and how the triangles are mapped to I2C.

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.

2 participants