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

Add Haptic Glove Module #72

Merged
merged 158 commits into from
Jan 18, 2022
Merged

Add Haptic Glove Module #72

merged 158 commits into from
Jan 18, 2022

Conversation

kouroshD
Copy link
Collaborator

@kouroshD kouroshD commented Oct 7, 2021

  • I still have to add README file to the module
  • I have to fix the configuration files
  • I have to check the possible changes outside the scope of this PR on other modules and remove those changes if are unnecessary
  • After the latest changes, I have to run the code with the robot.

@kouroshD kouroshD force-pushed the hapticGlove_PR branch 2 times, most recently from 10c2474 to 4bc993f Compare November 2, 2021 16:24
@kouroshD kouroshD force-pushed the hapticGlove_PR branch 2 times, most recently from 139ae79 to 37029ee Compare November 29, 2021 19:06
@kouroshD kouroshD marked this pull request as ready for review December 6, 2021 17:56
@kouroshD
Copy link
Collaborator Author

kouroshD commented Dec 6, 2021

The PR is ready to be reviewed, except the points mentioned in the first comment.

@kouroshD kouroshD force-pushed the hapticGlove_PR branch 9 times, most recently from cbc64d2 to ba407e7 Compare December 15, 2021 16:12
@kouroshD
Copy link
Collaborator Author

kouroshD commented Dec 15, 2021

I have tested many times during these days the code, and I applied bug fixes as well as updates on the configuration file. All the features are implemented. The only remaining point is the ReadMe documentation, that I may do it later. In any case, the PR is ready to be reviewed. I have also updated the CI, so that has dependency into wearables as well. Now, in fact, it compiles haptic glove module in all OS.

@kouroshD kouroshD mentioned this pull request Dec 15, 2021
Copy link
Collaborator

@S-Dafarra S-Dafarra left a comment

Choose a reason for hiding this comment

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

Some preliminary feedback

modules/HapticGlove_module/CMakeLists.txt Outdated Show resolved Hide resolved
modules/HapticGlove_module/CMakeLists.txt Outdated Show resolved Hide resolved
modules/HapticGlove_module/CMakeLists.txt Outdated Show resolved Hide resolved
modules/HapticGlove_module/CMakeLists.txt Outdated Show resolved Hide resolved
modules/Utils/src/Utils.cpp Outdated Show resolved Hide resolved
@traversaro
Copy link
Member

Given the size of the PR, if @S-Dafarra is already reviewing it I would remove myself from the reviewers. If there is any specific point on which you need my input @kouroshD feel free to point it out, thanks!

Copy link
Collaborator

@S-Dafarra S-Dafarra left a comment

Choose a reason for hiding this comment

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

I mostly skimmed through the code. Most of the comments are simply suggestions

modules/HapticGlove_module/src/GloveControlHelper.cpp Outdated Show resolved Hide resolved
modules/HapticGlove_module/src/GloveControlHelper.cpp Outdated Show resolved Hide resolved
modules/HapticGlove_module/src/LinearRegression.cpp Outdated Show resolved Hide resolved
modules/HapticGlove_module/src/MotorEstimation.cpp Outdated Show resolved Hide resolved
modules/HapticGlove_module/src/RobotInterface.cpp Outdated Show resolved Hide resolved
modules/HapticGlove_module/src/RobotMotorsEstimation.cpp Outdated Show resolved Hide resolved
@kouroshD
Copy link
Collaborator Author

With this fc89789, I have modified the writeStrict option of the remotecontrolboard from true to false.

@kouroshD
Copy link
Collaborator Author

another thing is that in the RemoteControlBoard the default carrier is set to udp as in https://github.com/robotology/yarp/blob/ce6f008c86ba58a652b04b6bffdc2b46e9b157e2/src/devices/RemoteControlBoard/RemoteControlBoard.cpp#L247-L250 and https://github.com/robotology/yarp/blob/ce6f008c86ba58a652b04b6bffdc2b46e9b157e2/src/devices/RemoteControlBoard/RemoteControlBoard.cpp#L307. And I remember, I could run the HapticGloveModule some months ago from the operator side as well, however with some difficulties. In any case, now we are running it the robot head.

@kouroshD
Copy link
Collaborator Author

@S-Dafarra let me know if the responses are OK, if it needs further declarations/modifications.

@S-Dafarra
Copy link
Collaborator

@S-Dafarra let me know if the responses are OK, if it needs further declarations/modifications.

I think it is OK to me! I would just suggest opening an issue to remove hardcoded numbers when setting a haptic feedback

@kouroshD
Copy link
Collaborator Author

Before merging, I ran once the code in order to be sure it is running after changing the requested code changes, and I found a bug indeed related to those changes: remoteControlBoardsOpts.put("writeStrict", "off"); in e246257 .
Here is the video:

leftHandREtargetingForPR-2022-01-17_15.24.06.mp4

@S-Dafarra
Copy link
Collaborator

S-Dafarra commented Jan 17, 2022

I guess you can also remove that line. By default it should be off

@kouroshD
Copy link
Collaborator Author

I guess you can also remove that line. By default it should be off

It is not. Look at here:

https://github.com/robotology/yarp/blob/165a46c6e034fc27b90cc0bd80b35419679b22c3/src/devices/RemoteControlBoard/RemoteControlBoard.h#L96-L97

@S-Dafarra
Copy link
Collaborator

I guess you can also remove that line. By default it should be off

It is not. Look at here:

https://github.com/robotology/yarp/blob/165a46c6e034fc27b90cc0bd80b35419679b22c3/src/devices/RemoteControlBoard/RemoteControlBoard.h#L96-L97

Ah nice catch. It seems that it enables it when writing to multiple joints. I guess this is to make sure that the commands sent to all the joints is coherent in time 🤔 .

@traversaro
Copy link
Member

I guess you can also remove that line. By default it should be off

It is not. Look at here:
https://github.com/robotology/yarp/blob/165a46c6e034fc27b90cc0bd80b35419679b22c3/src/devices/RemoteControlBoard/RemoteControlBoard.h#L96-L97

Ah nice catch. It seems that it enables it when writing to multiple joints. I guess this is to make sure that the commands sent to all the joints is coherent in time 🤔 .

Yes, writeStrict is necessary for all the commands that require multiple messages for different joints, otherwise tipically the last one would be the only one considered.

@S-Dafarra
Copy link
Collaborator

So then, maybe it is worth leaving it with the default behavior 🤔

@kouroshD
Copy link
Collaborator Author

Yes, writeStrict is necessary for all the commands that require multiple messages for different joints, otherwise tipically the last one would be the only one considered.

@traversaro What do you mean by requiring multiple messages for different joints? Can you give an example?

@traversaro
Copy link
Member

Yes, writeStrict is necessary for all the commands that require multiple messages for different joints, otherwise tipically the last one would be the only one considered.

@traversaro What do you mean by requiring multiple messages for different joints? Can you give an example?

Let's say that for some reason you are sending velocity reference joint-by-joint with: https://github.com/robotology/yarp/blob/165a46c6e034fc27b90cc0bd80b35419679b22c3/src/devices/RemoteControlBoard/RemoteControlBoard.cpp#L1914 . In that case, if you do not have writeStrict, only the last command will be considered.

@kouroshD
Copy link
Collaborator Author

Yes, writeStrict is necessary for all the commands that require multiple messages for different joints, otherwise tipically the last one would be the only one considered.

@traversaro What do you mean by requiring multiple messages for different joints? Can you give an example?

Let's say that for some reason you are sending velocity reference joint-by-joint with: https://github.com/robotology/yarp/blob/165a46c6e034fc27b90cc0bd80b35419679b22c3/src/devices/RemoteControlBoard/RemoteControlBoard.cpp#L1914 . In that case, if you do not have writeStrict, only the last command will be considered.

As I see in that snippet, it sends the joint i reference value with false write strict option. I am not seeing any part that is discarding other commands! booh! I can put it back in our code in default option, what is your suggestion? When I tried yesterday with off option, I did not see any strange behavior. In any case, in our code, we are always send vector of joint values not a single joint!

@kouroshD
Copy link
Collaborator Author

kouroshD commented Jan 18, 2022

@S-Dafarra @traversaro If you do not have other comments or suggestion, I will merge the PR. Thanks. I will keep the history of PR as it is.

@traversaro
Copy link
Member

@S-Dafarra @traversaro If you do not have other comments or suggestion, I will merge the PR. Thanks. I will keep the history of PR as it is.

Sure on my side, see #72 (comment) !

@S-Dafarra
Copy link
Collaborator

@S-Dafarra @traversaro If you do not have other comments or suggestion, I will merge the PR. Thanks. I will keep the history of PR as it is.

GO also for me!

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.

3 participants