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 doc page about joint kinematics #1497

Merged
merged 9 commits into from
Jun 2, 2024
Merged

Conversation

christophfroehlich
Copy link
Contributor

@christophfroehlich christophfroehlich commented Apr 22, 2024

I summarized some results of discussions about mimic joints and how I understand that.
Note, this is different than implemented currently with

for (const auto & mimic_joint : info_.mimic_joints)
{
for (auto i = 0u; i < joint_states_.size(); ++i)
{
joint_states_[i][mimic_joint.joint_index] =
mimic_joint.offset +
mimic_joint.multiplier * joint_states_[i][mimic_joint.mimicked_joint_index];
}
}

This came from the time where we defined the mimic joints in the ros2_control tag. IMHO, it does not make sense now using the URDF-specification, where the behavior of the mimic joint changes by switching the command interface from position to velocity, because we use the offset and calculate
velocity = multiplier * other_joint_velocity + offset

Also related to ros-controls/gazebo_ros2_control#297 and ros-controls/gz_ros2_control#276

I also included transmission interfaces, to give an overview what they are and what they aren't (they were not mentioned once in the docs).

@christophfroehlich christophfroehlich added backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. labels Apr 22, 2024
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.67%. Comparing base (765241e) to head (c6d7990).

Current head c6d7990 differs from pull request most recent head 3845eb5

Please upload reports for the commit 3845eb5 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1497       +/-   ##
===========================================
- Coverage   87.70%   62.67%   -25.04%     
===========================================
  Files         102       96        -6     
  Lines        8702    11311     +2609     
  Branches      780     8151     +7371     
===========================================
- Hits         7632     7089      -543     
+ Misses        790      715       -75     
- Partials      280     3507     +3227     
Flag Coverage Δ
unittests 62.67% <ø> (-25.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 77 files with indirect coverage changes

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

I've reviewed the part of mimic joints and left some comments

hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

Some comments about the transmission interface

Thanks for the nice doc

URDF is the default format to describe robot kinematics in ROS. However, only serial kinematic chains are supported, except for the so-called mimic joints.
See the `URDF specification <http://wiki.ros.org/urdf/XML/joint>`__ for more details. For the mimic joints, we can read

This tag is used to specify that the defined joint mimics another existing joint. The value of this joint can be computed as value = multiplier * other_joint_value + offset.
Copy link
Member

Choose a reason for hiding this comment

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

ok 👍


Transmission Interface
#######################
Mechanical transmissions transform effort/flow variables such that their product (power) remains constant. Effort variables for linear and rotational domains are force and torque; while the flow variables are respectively linear velocity and angular velocity.
Copy link
Member

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 I understand this part properly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was copied from here :D

* Mechanical transmissions transform effort/flow variables such that their product (power) remains
* constant. Effort variables for linear and rotational domains are \e force and \e torque; while
* the flow variables are respectively linear velocity and angular velocity.
*
* In robotics it is customary to place transmissions between actuators and joints. This interface
* adheres to this naming to identify the input and output spaces of the transformation. The
* provided interfaces allow bidirectional mappings between actuator and joint spaces for effort,
* velocity and position. Position is not a power variable, but the mappings can be implemented
* using the velocity map plus an integration constant representing the offset between actuator and
* joint zeros.

Any suggestions? Then I'd change that in the docstring, too.

Copy link
Member

Choose a reason for hiding this comment

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

Well if it is like that in the original docs it's fine.
At least for me the product he is talking about is not clear, I see that point of energy conservation, but within the transmission plugin you transform also position and velocity

hardware_interface/doc/joints_userdoc.rst Outdated Show resolved Hide resolved
Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

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

LGTM

@christophfroehlich christophfroehlich merged commit e122f71 into master Jun 2, 2024
5 checks passed
@christophfroehlich christophfroehlich deleted the add_mimic_docs branch June 2, 2024 19:07
mergify bot pushed a commit that referenced this pull request Jun 2, 2024
---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
(cherry picked from commit e122f71)
mergify bot pushed a commit that referenced this pull request Jun 2, 2024
---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
(cherry picked from commit e122f71)
christophfroehlich added a commit that referenced this pull request Jun 2, 2024
---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
(cherry picked from commit e122f71)

Co-authored-by: Christoph Fröhlich <[email protected]>
christophfroehlich added a commit that referenced this pull request Jun 2, 2024
---------

Co-authored-by: Sai Kishor Kothakota <[email protected]>
(cherry picked from commit e122f71)

Co-authored-by: Christoph Fröhlich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants