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

Avoid setting control mode at each control loop iteration #41

Open
traversaro opened this issue Dec 23, 2014 · 7 comments
Open

Avoid setting control mode at each control loop iteration #41

traversaro opened this issue Dec 23, 2014 · 7 comments

Comments

@traversaro
Copy link
Member

cc @francesco-romano

@traversaro
Copy link
Member Author

The problem is that the setTorques block is setting the control mode at each control loop, see https://github.com/robotology-playground/WBI-Toolbox/blob/new_wbi_ID/libraries/wbInterface/src/wbInterface.cpp#L1362 . Setting the control mode is a costly RPC operation, and should be done only once.

A sketch of the cost of every part of the functions is given in this debug output:

Time for set control mode portion of set reference block: 0.031909
Time for multiple joint set control reference: 0.000761 
Time for set reference block: 0.032707

@traversaro
Copy link
Member Author

The reason why this was not a problem back in v0.1 is this issue: robotology-legacy/yarp-wholebodyinterface#9 .
Basically in v0.1 the yarpWbi was sending the rpc command only when the control mode (for the wbi) changed. In v0.2 ( see https://github.com/robotology-playground/yarp-wholebodyinterface/blob/72451957ff31e95df707c80499e3643f5d94f6b9/src/yarpWholeBodyActuators.cpp#L346 ) I changed this behaviour because I felt it was privating the user of the wbi of a feature (setting a given control mode in the underlyng controlboard).

traversaro pushed a commit to robotology-legacy/yarp-wholebodyinterface that referenced this issue Dec 23, 2014
@traversaro
Copy link
Member Author

The same test after robotology-legacy/yarp-wholebodyinterface@6086e55 :

Time for set control mode portion of set reference block: 0.000001
Time for multiple joint set control reference: 0.000707 
Time for set reference block: 0.000719

@traversaro
Copy link
Member Author

Leaving this issue open because in the long term we should try to avoid to redo setControlMode calls at each control loop.

@traversaro traversaro changed the title setTorques block is very slow in the v0.2 Avoid settting control mode at each control loop iteration Jan 13, 2015
@traversaro traversaro changed the title Avoid settting control mode at each control loop iteration Avoid setting control mode at each control loop iteration Jan 13, 2015
@traversaro
Copy link
Member Author

@jeljaik
Copy link
Contributor

jeljaik commented Feb 6, 2015

It isn't completely clear to me if this issue was solved at the yarp-wholeBodyInterface level. I remember @traversaro saying that in v0.2 once it's set future calls for the same control mode are ignored. Am I correct here?

@traversaro
Copy link
Member Author

Yes, that is the behaviour that I have implemented to solve this issue but I really don't like it, but solving this is low priority I guess.

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

No branches or pull requests

2 participants