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

Limitations of externalWrench plugin #417

Closed
3 tasks done
yeshasvitirupachuri opened this issue Mar 27, 2019 · 6 comments
Closed
3 tasks done

Limitations of externalWrench plugin #417

yeshasvitirupachuri opened this issue Mar 27, 2019 · 6 comments

Comments

@yeshasvitirupachuri
Copy link
Member

yeshasvitirupachuri commented Mar 27, 2019

externalWrench plugin has a couple of shortcomings:

  • There is no error message if the link is not discovered. It only acknowledges if the command format is correctly used i.e Response: "[ACK] Correct command format" is shown. The expected command format is [link] [force] [torque] [duration]. Any string used in place of [link] will give the correct command response instead of giving an error that the link is not discovered.

  • Secondly, the [link] string is expected to be a full scoped link name of the model spawned in gazebo e.e iCub::l_hand. But if the model is spawned with a higher levels of scope like iCub::iCub::l_hand the external wrench plugin doesn't have any effect. This behaviour is checked on both @lrapetti machine and my machine. Some of the recent worlds in icub-gazebo-wholebody repo like icub_standup_world uses include tag for including the model in the world file. This is the reason for the addition scope of iCub resulting in the final link scope name as iCub::iCub::l_hand. So, it is better to have the command format as [model] [link] [force] [torque] [duration] and the user has to specify the first model name in the scope e.g iCub and the link name l_hand. This kinda functionality is already present in the linkattacher plugin.

  • Finally, the plugin can be used to genereate only one instance of the external wrench and currently it is not possible to use multiple external wrenches. Previously a PR Multiple External Wrenches in Gazebo #293 was opened to add the functionality of multiple external wrenches. We can update the externalWrench to have this additional feature.

@traversaro Please let me know your comments

@traversaro
Copy link
Member

I agree with all remarks.

@yeshasvitirupachuri
Copy link
Member Author

After a bit of thought, I realized the [model] is not necessary for the command as externalWrench is actually a model plugin. So, we can simply find the correct link using [link] name provided in the comment.

Also, it is a bit tricky to set the error message through rpc reply but this can be shown on the gazebo running terminal. These changes are fixed in https://github.com/Yeshasvitvs/gazebo-yarp-plugins/commit/fb4b0e26d2907f8c56d320386819bfff8ef7db6d

@yeshasvitirupachuri
Copy link
Member Author

yeshasvitirupachuri commented Mar 28, 2019

I added the multiple wrench functionality https://github.com/Yeshasvitvs/gazebo-yarp-plugins/commit/36e2801fe97a7528845039250105327ba910c831 and tested with different models:

The model launched through a world that has robot link names spawned as iCub::iCub::r_hand

ezgif com-video-to-gif (1)

The model that is manually spawned in gazebo with the link names as iCub::l_hand

ezgif com-video-to-gif (2)

Users can stick with the old way using either a full scoped link name in their command or simply the link name. As long as the link is discoverable in the model the wrench is applied as per the command. If the link is not discovered in the model, the following error is shown on gazebo running terminal:

Screenshot from 2019-03-28 14-38-44

A big change now is that, the previous functinality is if a user gives two wrench commands consequtively and if the duration of the first one is not yet complete before the second command. The first one is dropped and the second wrench command is applied. @traversaro I am not certain if this kinda functionality should still remain. In that case we need to have an additional option to set the functionality of the externalWrench plugin to be set in a single wrench or multiple wrench mode. what do you think ?

@yeshasvitirupachuri
Copy link
Member Author

I added the option set the operation mode https://github.com/Yeshasvitvs/gazebo-yarp-plugins/commit/22c7f0cce2c91f519030e944af94fb4c46e67b37 to be either single or multiple wrench mode. The default mode is single as before. A small test showing the switch between single and multiple operation modes is shown below:

ezgif com-video-to-gif (3)

@yeshasvitirupachuri
Copy link
Member Author

I updated the logic to clear all the wrenches when the operation mode is set. Also, updated the rpc message handling. Users will see the message on the rpc terminal in case if the requested link is not present in the model. f796908

ezgif com-video-to-gif (4)

@yeshasvitirupachuri
Copy link
Member Author

A PR #418 is open addressing this issue.

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

No branches or pull requests

2 participants