-
Notifications
You must be signed in to change notification settings - Fork 268
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
Visualization tools for ApplyForceTorque #2051
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]>
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]>
Codecov Report
@@ Coverage Diff @@
## gz-sim7 #2051 +/- ##
===========================================
- Coverage 65.01% 64.97% -0.05%
===========================================
Files 353 356 +3
Lines 28618 28783 +165
===========================================
+ Hits 18606 18701 +95
- Misses 10012 10082 +70
|
@Henrique-BO this is really cool. It would be nice if we could extract the rendering logic out to some common area so it can be shared by other plugins. #1898 seeks to do visualizations but on arbitrary objects. It would be nice to have a consistent visual language between these two PRs. Perhaps if you were to create a new utility class called "Force Visuallization" and make the material configurable, we would be able to reuse this code in #1898. |
Signed-off-by: Henrique-BO <[email protected]>
Signed-off-by: Henrique-BO <[email protected]>
|
||
math::Vector3d startPos; | ||
this->ray->SetFromCamera(this->camera, start); | ||
if (auto v = plane.Intersection( |
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.
nit: use {}
|
||
math::Vector3d endPos; | ||
this->ray->SetFromCamera(this->camera, end); | ||
if (auto v = plane.Intersection( |
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.
nit: use {}
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.
Done in bfbb1bd
Signed-off-by: Henrique-BO <[email protected]>
…m into apply_force_torque_vis
@arjo129 I think that's a great idea. I created a |
Sounds awesome! |
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 wasn't able to get the 3D Scene interaction to work. Can you try it again? Otherwise, just a few minor comments.
Signed-off-by: Henrique-BO <[email protected]>
Changes addressed in b5cafc3. The 3D scene interaction is working on my end, like this: Screencast.2023-08-16.16.31.46.mp4Is this not working for you? |
for (unsigned int i = 0; i < this->scene->NodeCount(); ++i) | ||
{ | ||
auto cam = std::dynamic_pointer_cast<rendering::Camera>( | ||
this->scene->NodeByIndex(i)); |
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.
Camera is registered as a Sensor gz-rendering so you can reduce the search space by using SensorCount
and SensorByIndex
since there's probably only one camera in the scene.
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.
Good point, changed it in d6afb10
Signed-off-by: Henrique-BO <[email protected]>
Ah, I didn't click on the arrow, I thought it would appear with the arrow. I also tried to drag the arrow but that didn't help. I think a helpful message in the GUI card would be good to add. |
Signed-off-by: Henrique-BO <[email protected]>
Good point, I added a message to the GUI in 419b34f |
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.
nice, the tool works well for me
Adds tutorials for the new ApplyForceTorque plugin (including the features added in #2051 and #2056) and for the new MouseDrag plugin. --------- Signed-off-by: Henrique-BO <[email protected]>
🎉 New feature
Requires #2014
Summary
Adds visualization tools to the new ApplyForceTorque GUI plugin. This allows the user to see the force (represented by an arrow) and the torque (represented by a circle) displayed on the scene at their application point before applying them.
When one of the vectors (force or torque) is clicked, a rotation tool (represented by a gizmo) is displayed. This allows the user to freely rotate the selected vector. Still WIP.
TODO:
Test it
Open any test world.
Load the Apply Force Torque plugin from the plugin dropdown.
Select a model or link and specify a force or torque to see its direction on the scene.
Click on the force or torque vector to display the rotation tool, and click and drag the circles to rotate.
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.