-
Notifications
You must be signed in to change notification settings - Fork 277
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
Apply Force and Torque GUI plugin #2014
Conversation
Signed-off-by: Henrique-BO <[email protected]>
Signed-off-by: Henrique-BO <[email protected]>
Signed-off-by: Henrique-BO <[email protected]>
Signed-off-by: Henrique-BO <[email protected]>
Signed-off-by: Henrique-BO <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!! I haven't tested it yet, but wanted to give it a first pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor documentation related feedback. Which plugin is needed in order to apply the force?
ApplyForceTorque.ApplyAll() | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Knit: New line at end of file.
/// \brief Publish wrench to "/world/apply_link_wrench/wrench" topic. | ||
/// | ||
/// ## Configuration | ||
/// This plugin doesn't accept any custom configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Knit: Might be worth mentioning which plugin provides the /world/apply_link_wrench/wrench
topic.
gzerr << "World not found" << std::endl; | ||
return false; | ||
}); | ||
auto topic = transport::TopicUtils::AsValidTopic( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if topic is valid. it should return an empty string if the function fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried it out, works as expected
Thanks for the feedback. I addressed the requested changes in 6fbbfc0. |
Codecov Report
@@ Coverage Diff @@
## gz-sim7 #2014 +/- ##
===========================================
- Coverage 65.00% 64.98% -0.03%
===========================================
Files 354 354
Lines 28667 28667
===========================================
- Hits 18636 18630 -6
- Misses 10031 10037 +6 |
@osrf-jenkins run tests please |
|
||
#include <string> | ||
|
||
#include <gz/gui/Application.hh> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alphabetize headers
{ | ||
this->dataPtr->changedEntity = false; | ||
|
||
this->dataPtr->modelName = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this->dataPtr->modelName = ""; | |
this->dataPtr->modelName{""}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works, since this is an assignment, not an initialization. I get a compilation error if I try this.
Signed-off-by: Henrique-BO <[email protected]>
Changes addressed in ca1c904. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked gazebo-classic once more and it looks like the force/torque is applied in the body fixed frame. I don't want to block this PR on that. Maybe we can add that later, but I think we should indicate that the force/torque is applied in the world frame in the GUI.
Signed-off-by: Henrique-BO <[email protected]>
You're right, I hadn't noticed that. I changed the application to the body fixed frame and added an indication to the GUI, so it's more consistent with Gazebo-Classic. |
Signed-off-by: Henrique-BO <[email protected]>
🎉 New feature
Partially addresses #306
Summary
Adds a new ApplyForceTorque GUI plugin, essentially implementing the Apply Force and Torque interface that we have in Gazebo Classic.
This allows users to apply a specified force and torque to a chosen link in a model upon pressing a button. The implementation takes advantage of the existing ApplyLinkWrench system, sending the wrenches to the
/world/<world_name>/wrench
topic. The ApplyLinkWrench system is automatically loaded once this plugin is loaded.However, a current limitation is that applying the force with an offset from the link origin is not supported, since it is not implemented in ApplyLinkWrench.
Test it
Open any test world.
Load the Apply Force Torque plugin from the plugin dropdown.
On the interface, input the desired force and torque. The model is selected from the scene, and the specific link is specified through a dropdown on the interface. Buttons are available to apply either just a force, just a torque or both at the same time.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.