-
Notifications
You must be signed in to change notification settings - Fork 125
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 an example with a passive joint #172
Add an example with a passive joint #172
Conversation
gazebo_ros2_control_demos/launch/pendulum_example_effort.launch.py
Outdated
Show resolved
Hide resolved
gazebo_ros2_control_demos/launch/pendulum_example_position.launch.py
Outdated
Show resolved
Hide resolved
README.md
Outdated
The following example shows a cart with a pendulum arm. This uses the effort command interface for the cart's degree of freedom on the rail, and the physics of the passive joint of the pendulum is solved correctly. | ||
```bash | ||
ros2 launch gazebo_ros2_control_demos pendulum_example_effort.launch.py | ||
ros2 run gazebo_ros2_control_demos example_effort | ||
``` | ||
*Attention*: If the position or velocity command interface is used instead, the motion of the pendulum is not calculated correctly and does not move at all, see the following example. This also holds true if a mimicked joint with position or velocity interface is used. | ||
```bash | ||
ros2 launch gazebo_ros2_control_demos pendulum_example_position.launch.py | ||
ros2 run gazebo_ros2_control_demos example_position | ||
``` |
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.
The following example shows a cart with a pendulum arm. This uses the effort command interface for the cart's degree of freedom on the rail, and the physics of the passive joint of the pendulum is solved correctly. | |
```bash | |
ros2 launch gazebo_ros2_control_demos pendulum_example_effort.launch.py | |
ros2 run gazebo_ros2_control_demos example_effort | |
``` | |
*Attention*: If the position or velocity command interface is used instead, the motion of the pendulum is not calculated correctly and does not move at all, see the following example. This also holds true if a mimicked joint with position or velocity interface is used. | |
```bash | |
ros2 launch gazebo_ros2_control_demos pendulum_example_position.launch.py | |
ros2 run gazebo_ros2_control_demos example_position | |
``` | |
The following example shows a cart with a pendulum arm. This uses the effort command interface for the cart's | |
degree of freedom on the rail, and the physics of the passive joint of the pendulum is solved correctly. | |
```bash | |
ros2 launch gazebo_ros2_control_demos pendulum_example_effort.launch.py | |
ros2 run gazebo_ros2_control_demos example_effort |
Attention: If the position or velocity command interface is used instead, the motion of the pendulum is not
calculated correctly and does not move at all, see the following example. This also holds true if a mimicked joint
with position or velocity interface is used.
ros2 launch gazebo_ros2_control_demos pendulum_example_position.launch.py
ros2 run gazebo_ros2_control_demos example_position
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.
Do I understand correctly that you want to delete the hint with the position interface?
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.
@ahcorde could you please give me an update about what you want me to change here? According to the reactions below, I'd suggest to add the hint with the position interface again.
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Sorry, what is the technical reason for the " If the position or velocity command interface is used instead, the motion of the pendulum is not calculated correctly and does not move at all"? |
I never had a look into the gazebo code, but what I think from a mathematical/physical perspective what happens is: Maybe @ahcorde can verify my guess. |
doc/index.rst
Outdated
|
||
.. note:: | ||
|
||
If the position or velocity command interface is used instead, the motion of the pendulum is not calculated correctly and does not move at all, see the following example. This also holds true if a mimicked joint with position or velocity interface is used. |
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 open an issue about this?
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'm not sure if this is a bug or a feature :D
gazebo_ros2_control_demos/urdf/test_pendulum_position.xacro.urdf
Outdated
Show resolved
Hide resolved
Co-authored-by: Alejandro Hernández Cordero <[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.
the urdfs are different one is using a macro and the other doesn't.
I tested both examples, the effort one is working and I can see the passive joint moving, but the position one the passive joint is static.
Do you mind to take a look ? and reduce diff between the two new URDFs ?
exactly, that is the point I wanted to highlight and have adressed in the docs and opened the issue: it would have saved me some days of debugging of my project ;)
yes I'll have a look why the URDFs are different |
@ahcorde I made both URFDs equal now (inertia was not important for the position case). |
The position joints are working now, can we close this issue #240 ? Do you want to backport this ? |
What do you mean? I don't think that this behavior changed, at least not with this PR. The pendulum does not move if the cart is commanded with position interface?
yes please. the rolling version will die when gazebo classic is not released to noble anymore. |
https://github.com/Mergifyio backport humble iron |
✅ Backports have been created
|
Co-authored-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 7d5ec5d) # Conflicts: # doc/index.rst
Co-authored-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 7d5ec5d) # Conflicts: # doc/index.rst
* Add an example with a passive joint (#172) Co-authored-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 7d5ec5d) # Conflicts: # doc/index.rst * Fixed docs Signed-off-by: Alejandro Hernández Cordero <[email protected]> --------- Signed-off-by: Alejandro Hernández Cordero <[email protected]> Co-authored-by: Christoph Fröhlich <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]>
* Add an example with a passive joint (#172) Co-authored-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 7d5ec5d) # Conflicts: # doc/index.rst * Fixed docs Signed-off-by: Alejandro Hernández Cordero <[email protected]> --------- Signed-off-by: Alejandro Hernández Cordero <[email protected]> Co-authored-by: Christoph Fröhlich <[email protected]> Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Passive joints were always "moving", but as if they were fixed in inertial frame. A movement of the parent link did not effect the respective joint. For demonstration purposes, I change the initial pose to be in the lower equilibrium to make this clearer: |
Adds a demo example with a passive joint: A pendulum hinged on the existing cart example.
I also added a hint that the physics of the passive joint are not rendered correct if position or velocity interface is used.