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 tutorials for ApplyForceTorque and MouseDrag plugins #2083

Merged
merged 10 commits into from
Aug 29, 2023

Conversation

Henrique-BO
Copy link
Contributor

🎉 New feature

Requires #2051, #2056

Summary

Adds tutorials for the new ApplyForceTorque plugin (including the features added in #2051 and #2056) and for the new MouseDrag plugin.

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

@github-actions github-actions bot added the 🌱 garden Ignition Garden label Aug 21, 2023
@Henrique-BO Henrique-BO marked this pull request as ready for review August 21, 2023 20:03
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #2083 (8a65e6e) into gz-sim7 (30eeb62) will decrease coverage by 0.02%.
The diff coverage is n/a.

❗ Current head 8a65e6e differs from pull request most recent head 33e5d79. Consider uploading reports for the commit 33e5d79 to get more accurate results

@@             Coverage Diff             @@
##           gz-sim7    #2083      +/-   ##
===========================================
- Coverage    64.98%   64.97%   -0.02%     
===========================================
  Files          356      356              
  Lines        28783    28783              
===========================================
- Hits         18704    18701       -3     
- Misses       10079    10082       +3     

see 3 files with indirect coverage changes

## Examples

Let's go through an example of applying force and torque to simple models. Open
the `shapes` world with
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the `shapes` world with
the `shapes.sdf` world with:

Comment on lines 18 to 21
![Interface](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/apply_force_torque/Interface.png)


### Apply force to a link
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
![Interface](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/apply_force_torque/Interface.png)
### Apply force to a link
![Interface](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/apply_force_torque/Interface.png)
### Apply force to a link

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in f977a8c

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

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

looks good, some minor comments

@@ -0,0 +1,115 @@
\page apply_force_torque Apply Force and Torque
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you'll need to add a link to this page in https://github.com/gazebosim/gz-sim/blob/gz-sim7/tutorials.md.in


On the dialog, write `10000` on the `X` field under `Force`. Click on the force
vector to make the rotation tool appear. Drag the blue circle to rotate the
force so that it is alligned with the `Y` direction. Notice how the XYZ fields
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
force so that it is alligned with the `Y` direction. Notice how the XYZ fields
force around the `Z` axis so that it is aligned with the `Y` direction. Notice how the XYZ fields

### Force

- **Force X, Y, Z**: Each field specifies how much force will be applied on that
direction, in N. The frame is fixed to the link.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
direction, in N. The frame is fixed to the link.
direction, in Newtons (N). The frame is fixed to the link.

in meters. Here you can edit the X, Y and Z fields to give the force an offset
with respect to the center of mass expressed in the link's frame.

- **Tip**: Right-click the model and choose View -> Center of mass to see its
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Tip**: Right-click the model and choose View -> Center of mass to see its
- **Tip**: Right-click the model and choose `View` -> `Center of Mass` to see its

with respect to the center of mass expressed in the link's frame.

- **Tip**: Right-click the model and choose View -> Center of mass to see its
position. You might want to also make the model transparent for that.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
position. You might want to also make the model transparent for that.
position. You will want to also make the model transparent to see the center of mass visual (`View` -> `Transparent`).

position. You might want to also make the model transparent for that.

- **Apply Force**: Click this to apply only force for one time step. Keep in
mind that time steps are in the order of milliseconds, so relatively large
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mind that time steps are in the order of milliseconds, so relatively large
mind that time steps are typically in the order of milliseconds, so relatively large

### Torque

- **X, Y, Z**: Each field specifies how much torque will be applied about that
axis, in N.m. The frame is fixed to the link.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
axis, in N.m. The frame is fixed to the link.
axis, in Newton-meters (N.m). The frame is fixed to the link.

fields proportionally, maintaining the torque direction.

- **Apply Torque**: Click this to apply only torque for one time step. Keep in
mind that time steps are in the order of milliseconds, so relatively large
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mind that time steps are in the order of milliseconds, so relatively large
mind that time steps are typically in the order of milliseconds, so relatively large

editing the numbers on the XYZ fields.

From the scene, select a vector to enable the rotation tool, then drag the
circles. This changes the direction of the vector, updating the XYZ fields
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
circles. This changes the direction of the vector, updating the XYZ fields
handles. This changes the direction of the vector, updating the XYZ fields

@@ -0,0 +1,66 @@
\page mouse_drag Mouse Drag
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 8a4afa7

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

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

just have a minor suggestion on what section to put the tutorials in, otherwise this looks good to me.

tutorials.md.in Outdated
@@ -51,6 +51,8 @@ Gazebo @GZ_DESIGNATION_CAP@ library and how to use the library effectively.
* \subpage spherical_coordinates "Spherical coordinates": Working with latitude and longitude
* \subpage underwater_vehicles "Underwater Vehicles": Understand how to simulate underwater vehicles.
* \subpage logicalaudiosensor "Logical Audio Sensor": Using the LogicalAudioSensor system to mimic logical audio emission and detection in simulation.
* \subpage apply_force_torque "Apply Force and Torque": Applying forces and/or torques to models during simulation through the GUI.
* \subpage mouse_drag "Mouse Drag": Move models by dragging them in the scene using forces and torques.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these are GUI and rendering features?

Copy link
Contributor Author

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 33e5d79

@azeey azeey added the documentation Improvements or additions to documentation label Aug 25, 2023
Signed-off-by: Henrique-BO <[email protected]>
@azeey azeey added the beta Targeting beta release of upcoming collection label Aug 28, 2023
@azeey azeey merged commit 6f4bcca into gazebosim:gz-sim7 Aug 29, 2023
4 checks passed
@Henrique-BO Henrique-BO deleted the tutorials branch August 29, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Targeting beta release of upcoming collection documentation Improvements or additions to documentation 🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants