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

fixed the checkJointTypes function for the case of TORQUE control #719

Merged
merged 8 commits into from
Feb 24, 2021

Conversation

AlexAntn
Copy link
Contributor

@AlexAntn AlexAntn commented Feb 24, 2021

This PR fixes issue #718 .

Since we have an array of PidInfo / TrqPidInfo, we can't rely on class inheritance to query the parameters of each PID (an array of Derived is not a kind-of array of Base). As such, we need to check if the PID type is torque and handle it differently.

Copy link
Member

@pattacini pattacini left a comment

Choose a reason for hiding this comment

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

I can see a verbatim copy'n'paste of lots of code lines we could thus refactor and made much more compact.

@pattacini
Copy link
Member

pattacini commented Feb 24, 2021

@AlexAntn we can get away w/ less by refactoring the main routine and make it call 2 sub-routines that implement each the body of the 2 for loops.

In this case, indeed, each subroutine can stick to the generic case of the base class as we don't deal w/ pointers arithmetic inside the subroutines' body.

@AlexAntn
Copy link
Contributor Author

Ìn the last commit to this issue I have refactored the loops in order to reduce duplicated code. I have also changed how we obtain the firstjoint in order to have a single loop.

These changes have been tested directly on the robot and are working (yarprobotinterface started with no issues)

@pattacini
Copy link
Member

LGTM, thanks a lot @AlexAntn 🚀

@pattacini
Copy link
Member

pattacini commented Feb 24, 2021

I'll wait for the CI to complete and then squash and merge the PR.

@Nicogene in the meantime, you may be willing to review it as well.

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.

LGTM

@Nicogene
Copy link
Member

I think we can squash all the commit in just one

@pattacini
Copy link
Member

pattacini commented Feb 24, 2021

I think we can squash all the commit in just one

Don't do that please, otherwise CI will start over from scratch!

I can simply use the corresponding button from the GH GUI, instead, to squash the commits.

@pattacini pattacini merged commit 2b35309 into robotology:master Feb 24, 2021
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.

embobjMotionControl fails to open after adding the consistency check of torque PIDs
3 participants