Skip to content

Conversation

BartlomiejK2
Copy link
Contributor

This PR is a fixed version of #273 by Kevin DeMarco , unfortunately the author of original PR has not made any changes since 2024, so I've made this one in order to finally have hardware interface for ForceTroque sensor. I've tried to preserve the authorship and committer-ship of the commits made by the first PR submitter.

@BartlomiejK2 BartlomiejK2 requested a review from ahcorde as a code owner June 15, 2025 16:18
@BartlomiejK2
Copy link
Contributor Author

Can this PR be also backported to humble?

@christophfroehlich
Copy link
Contributor

Can this PR be also backported to humble?

we can try ;)

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

In principle, LGTM.

Could you please have a look and add this to one of the examples, where [a test exist tests? At least we have a smoke test then and see if the system is launched successfully. Maybe here, or as followup PR, we can test if the interfaces were exported successfully and data is received.

@BartlomiejK2
Copy link
Contributor Author

Hi @christophfroehlich, I've successfully run ForceTorque sensor on test position_test.py and tested that interfaces are exported and send data to ForceTorqueSensorBroadcaster on Humble. Unfortunately this tests require custom gazebo sdf world to include gz::sim::systems::ForceTorque in it. Should I add in this PR all my changes to test_cart_position.xacro.urdf or create seperate gazebo sdf world, urdf, yaml and launch files for force torque sensor tests?

@christophfroehlich
Copy link
Contributor

I suggest adding a separate demo launch file, and moving also the IMU from example_velocity to it (can be done in a separate PR, as you like). Please update also the docs with necessary changes for using the new sensor, maybe by adding a new subsection here. Thanks!

@BartlomiejK2
Copy link
Contributor Author

Hi @christophfroehlich , I've added files for force torque sensor tests. Unfortunately, I cannot test it on my own setup due to different ROS2 version.

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

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

Thanks for adding docs and test, I added some requests and further questions

</gazebo>

<gazebo>
<!-- Joint state publisher -->
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
<!-- Joint state publisher -->

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've left it because it is in every cart test.

Comment on lines 7 to 9

force_torque_sensor_broadcaster:
type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster
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_torque_sensor_broadcaster:
type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster

doc/index.rst Outdated
<topic>force_torque_sensor</topic>
</sensor>

It is important to add this as `reference` sensor in the ``<gazebo>`` tag in your URDF file.
Copy link
Contributor

Choose a reason for hiding this comment

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

please explain. Do you mean the ros2_control tag, i.e.

   <sensor name="force_torque_sensor" type="force_torque">
      <state_interface name="force.x"/>
      <state_interface name="force.y"/>
      <state_interface name="force.z"/>
      <state_interface name="torque.x"/>
      <state_interface name="torque.y"/>
      <state_interface name="torque.z"/>
    </sensor>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added this comment as it is not directly URDF sensor but SDF, so I've wanted to clarify that is should be defined in <gazebo> tag in URDF like this:

<gazebo reference="slider_to_cart">
    <sensor name="force_torque_sensor" type="force_torque">
        <update_rate>10.0</update_rate>
        <always_on>true</always_on>
        <visualize>true</visualize>
        <topic>force_torque_sensor</topic>
    </sensor>
</gazebo>

Copy link
Contributor

Choose a reason for hiding this comment

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

do we really need this?
The plugin can also be added to a gazebo tag in the urdf, see here.

If it is really needed, please remove the comment section from this file and add a reference where got this file from.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For ROS2 Humble it is advised to add IMU and Force-Torque plugins to world .sdf file, explained in this issue. I'm not sure if it was changed in newer versions. There is also explanation why IMU plugin works in URDF file and Force-Torque not.

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde merged commit a678ab9 into ros-controls:rolling Jul 1, 2025
4 of 6 checks passed
@ahcorde
Copy link
Collaborator

ahcorde commented Jul 2, 2025

https://github.com/Mergifyio backport kilted jazzy humble

Copy link
Contributor

mergify bot commented Jul 2, 2025

mergify bot pushed a commit that referenced this pull request Jul 2, 2025
…ger - fixes to original PR (#610)

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Co-authored-by: Kevin DeMarco <kevin@kevindemarco.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit a678ab9)
mergify bot pushed a commit that referenced this pull request Jul 2, 2025
…ger - fixes to original PR (#610)

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Co-authored-by: Kevin DeMarco <kevin@kevindemarco.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit a678ab9)
mergify bot pushed a commit that referenced this pull request Jul 2, 2025
…ger - fixes to original PR (#610)

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Co-authored-by: Kevin DeMarco <kevin@kevindemarco.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit a678ab9)

# Conflicts:
#	gz_ros2_control/src/gz_system.cpp
ahcorde added a commit that referenced this pull request Jul 2, 2025
…ger - fixes to original PR (backport #610) (#623)

* Provide force-torque sensor data through gz_system to controller_manager - fixes to original PR  (#610)

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Co-authored-by: Kevin DeMarco <kevin@kevindemarco.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit a678ab9)
ahcorde added a commit that referenced this pull request Jul 2, 2025
…ger - fixes to original PR (backport #610) (#624)

* Provide force-torque sensor data through gz_system to controller_manager - fixes to original PR  (#610)

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
Co-authored-by: Kevin DeMarco <kevin@kevindemarco.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit a678ab9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants