-
Notifications
You must be signed in to change notification settings - Fork 276
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
Added tutorial for Gazebo joint controller plugin #2263
Added tutorial for Gazebo joint controller plugin #2263
Conversation
Signed-off-by: yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[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.
Hi @yaswanth1701, thank you for writting the tutorial and contribute!
Two main things to review too:
- Please review the text, there are some phrase that I don't fully understand
- Images/gifs are located in your personal repository, for example: https://github.com/yaswanth1701/gz-sim/assets/92177410/5a8b81b2-c96a-44ce-9f15-57e64f2b869b. You should be able to locate these images in this folder https://github.com/gazebosim/gz-sim/tree/ee108441a2821d787fc917a705d01abb4a7d7843/tutorials/files
tutorials/joint_controller.md
Outdated
|
||
\page jointcontrollers Joint Controllers |
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.
\page jointcontrollers Joint Controllers | |
\page jointcontrollers Joint Controllers | |
tutorials/joint_controller.md
Outdated
|
||
This mode let's the user explicitly set the values of PID gains and also bounds for velocity. | ||
|
||
Note: This force mode is for the user who looking to manually tune PID gains for velocity control according to a specific use case (e.g. Custom models). For general testing purposes, velocity mode will give the best results. |
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.
Note: This force mode is for the user who looking to manually tune PID gains for velocity control according to a specific use case (e.g. Custom models). For general testing purposes, velocity mode will give the best results. | |
**Note**: This force mode is for the user who looking to manually tune PID gains for velocity control according to a specific use case (e.g. Custom models). For general testing purposes, velocity mode will give the best results. | |
tutorials/joint_controller.md
Outdated
|
||
Note: This force mode is for the user who looking to manually tune PID gains for velocity control according to a specific use case (e.g. Custom models). For general testing purposes, velocity mode will give the best results. | ||
|
||
Required parameters for both modes can be found [here](https://gazebosim.org/api/gazebo/4.5/classignition_1_1gazebo_1_1systems_1_1JointController.html#:~:text=joint%20is%20actuated.-,System%20Parameters,-%3Cjoint_name%3E%20The). |
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.
Required parameters for both modes can be found [here](https://gazebosim.org/api/gazebo/4.5/classignition_1_1gazebo_1_1systems_1_1JointController.html#:~:text=joint%20is%20actuated.-,System%20Parameters,-%3Cjoint_name%3E%20The). | |
Required parameters for both modes can be found [here](https://gazebosim.org/api/gazebo/7.0/classignition_1_1gazebo_1_1systems_1_1JointController.html#:~:text=joint%20is%20actuated.-,System%20Parameters,-%3Cjoint_name%3E%20The). | |
tutorials/joint_controller.md
Outdated
|
||
Required parameters for both modes can be found [here](https://gazebosim.org/api/gazebo/4.5/classignition_1_1gazebo_1_1systems_1_1JointController.html#:~:text=joint%20is%20actuated.-,System%20Parameters,-%3Cjoint_name%3E%20The). | ||
|
||
In both the modes commanded velocity(cmd_vel) can be published or subscribed at the topic: `/model/<model_name>/joint/<joint_name>/cmd_vel` by default. |
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.
redoo this phrase
tutorials/joint_controller.md
Outdated
|
||
Let's see an example for both modes using a simple model having only one joint. | ||
|
||
For controlling joints one would require adding the Gazebo's joint controller plugin to the existing <model_name>.sdf file. |
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.
For controlling joints one would require adding the Gazebo's joint controller plugin to the existing <model_name>.sdf file. | |
For controlling joints one would require adding the Gazebo's joint controller plugin to the existing `<model_name>.sdf` file. | |
tutorials/joint_controller.md
Outdated
|
||
1) Launching gazebo simulation. | ||
|
||
```xml |
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.
```xml | |
```bash |
tutorials/joint_controller.md
Outdated
1) Launching gazebo simulation. | ||
|
||
```xml | ||
gz sim example2.sdf |
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.
gz sim example2.sdf | |
gz sim -v 4 -r example2.sdf | |
tutorials/joint_controller.md
Outdated
|
||
|
||
<p align="center"> |
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.
<p align="center"> | |
<p align="center"> |
tutorials/joint_controller.md
Outdated
<img src="https://github.com/yaswanth1701/gz-sim/assets/92177410/5a8b81b2-c96a-44ce-9f15-57e64f2b869b" width="800" height="400"> | ||
</p> | ||
|
||
Note: by default velocity and position control are disabled if one want to use these mode, they must specify the PID gains value according to usage. |
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.
Note: by default velocity and position control are disabled if one want to use these mode, they must specify the PID gains value according to usage. | |
**Note**: By default velocity and position control are disabled if one want to use these mode, they must specify the PID gains value according to usage. | |
tutorials/joint_controller.md
Outdated
|
||
4) Checking progress of commanded trajectory. | ||
|
||
```xml |
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.
```xml | |
```bash |
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Hi @ahcorde, thanks a lot for reviewing. I have resolved the comment you gave. I am a bit confused about how to locate images and gifs to this folder https://github.com/gazebosim/gz-sim/tree/ee108441a2821d787fc917a705d01abb4a7d7843/tutorials/files. I have added the image and gif here should I just paste the link of folder's images in joint_controller.md file? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## gz-sim7 #2263 +/- ##
===========================================
- Coverage 64.76% 64.74% -0.03%
===========================================
Files 357 357
Lines 29139 29141 +2
===========================================
- Hits 18872 18866 -6
- Misses 10267 10275 +8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yaswanth <[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 so far! Just a few minor comments. I only skimmed to see where we can use better doxygen syntax. Haven't read the tutorial in depth yet.
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: yaswanth1701 <[email protected]>
Signed-off-by: yaswanth1701 <[email protected]>
Signed-off-by: yaswanth1701 <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: yaswanth1701 <[email protected]>
…th1701/gz-sim into joint_controller_tutorial
Hi @azeey , I have resolved the comment that you gave. Could you please review this further? |
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.
lines < 100
tutorials/joint_controller.md
Outdated
|
||
This would look almost the same as velocity mode if PID gains are tuned properly. | ||
|
||
5) Cheking Joint states. |
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.
5) Cheking Joint states. | |
5) Checking Joint states. | |
tutorials/joint_controller.md
Outdated
@@ -0,0 +1,685 @@ | |||
\page jointcontrollers Joint Controllers | |||
|
|||
Gazebo provides three joint controller plugins. Let's see a detailed description of each of them and example usage to help users to select right joint controller for their usage. |
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.
Enumerate 3 available controllers
Gazebo provides three joint controller plugins. Let's see a detailed description of each of them and example usage to help users to select right joint controller for their usage. | |
Gazebo provides three joint controller plugins. Let's see a detailed description of each of them and example usage to help users to select right joint controller for their usage. | |
tutorials/joint_controller.md
Outdated
This mode lets the user control the desired joint velocity directly. | ||
|
||
2) Force mode: | ||
A user who wants to control joint velocity using a PID controller can use this mode.This mode lets the user explicitly set the values of PID gains and also bounds for velocity. |
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.
shorter lines < 100
``` | ||
|
||
```bash | ||
joint { |
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.
can you indent this output ?
</div> | ||
|
||
```bash | ||
joint { |
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.
indent output
tutorials/joint_controller.md
Outdated
|
||
|
||
## 2) JointPositionController |
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.
## 2) JointPositionController | |
## 2) JointPositionController | |
``` | ||
|
||
```bash | ||
joint { |
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.
indent output
tutorials/joint_controller.md
Outdated
|
||
### Example usage: | ||
|
||
Let’s set up a new model for this example. A two-linked manipulator arm which has a total of two joints to control ( [```joint_trajectory_controller.sdf```](https://github.com/gazebosim/gz-sim/blob/gz-sim7/examples/worlds/joint_trajectory_controller.sdf) is the original example). Name it as `example2.sdf`. |
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.
Let’s set up a new model for this example. A two-linked manipulator arm which has a total of two joints to control ( [```joint_trajectory_controller.sdf```](https://github.com/gazebosim/gz-sim/blob/gz-sim7/examples/worlds/joint_trajectory_controller.sdf) is the original example). Name it as `example2.sdf`. | |
Let’s set up a new model for this example. A two-linked manipulator arm which has a total of two joints to control ([```joint_trajectory_controller.sdf```](https://github.com/gazebosim/gz-sim/blob/gz-sim7/examples/worlds/joint_trajectory_controller.sdf) is the original example). Name it as `example2.sdf`. | |
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Hi @ahcorde I have made the changes can you please review it further? Also, what do you mean by 'lines < 100'? I didn't get it." |
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.
please check failures in CI https://github.com/gazebosim/gz-sim/actions/runs/7330698448/job/19975369073?pr=2263
I think there are spaces at the end of the lines
Signed-off-by: yaswanth1701 <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
…int_controller_tutorial
Hi @ahcorde can I please know why the codecov/project report has failed and how I can resolve it? |
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.
LGTM, I will wait for another pass of @azeey
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! Just a few minor comments. Thanks again for your contribution.
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Signed-off-by: Yaswanth <[email protected]>
Looks like there's a trailing space issue. |
Signed-off-by: yaswanth1701 <[email protected]>
Thanks a lot for reviewing. |
🎉 New feature
Closes #1019
Summary
Added a tutorial for Gazebo's joint controller plugin.
Test it
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.