-
Notifications
You must be signed in to change notification settings - Fork 152
Provide force-torque sensor data through gz_system to controller_manager - fixes to original PR for Humble #637
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5377b7d
started adding FTS info
SyllogismRXS 7bcf0ef
Providing force torque sensor data to controller_manager
SyllogismRXS 934d8b7
Removed old TODO that was completed
SyllogismRXS ae6740e
Indent spaces fix
SyllogismRXS 0eb49df
Added demo, test and docs for FT sensor for Humble
BartlomiejK2 ba69fd1
Fixed pre-commit issues
BartlomiejK2 81e07ab
Changed world in launch file
BartlomiejK2 7e0c7fd
Fixed error in ft world
BartlomiejK2 5a82f06
Added build for force-torque sensor broadcaster to CI
BartlomiejK2 b73f7a0
Changed order of building packages
BartlomiejK2 68df047
Addef force-torque sensor to package.xml
BartlomiejK2 290a003
Fixed pre-commit in sdf world
BartlomiejK2 e64266c
Removed force-torque sensor build from CI
BartlomiejK2 073cbc7
Fixed couple issues
BartlomiejK2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ install(DIRECTORY | |
| launch | ||
| config | ||
| urdf | ||
| worlds | ||
| DESTINATION share/${PROJECT_NAME}/ | ||
| ) | ||
|
|
||
|
|
||
23 changes: 23 additions & 0 deletions
23
gz_ros2_control_demos/config/cart_controller_ft_sensor.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| controller_manager: | ||
| ros__parameters: | ||
| update_rate: 1000 # Hz | ||
|
|
||
| joint_state_broadcaster: | ||
| type: joint_state_broadcaster/JointStateBroadcaster | ||
|
|
||
| joint_trajectory_controller: | ||
| ros__parameters: | ||
| type: joint_trajectory_controller/JointTrajectoryController | ||
| joints: | ||
| - slider_to_cart | ||
| command_interfaces: | ||
| - position | ||
| state_interfaces: | ||
| - position | ||
| - velocity | ||
|
|
||
| force_torque_sensor_broadcaster: | ||
| ros__parameters: | ||
| type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster | ||
| sensor_name: "force_torque_sensor" | ||
| frame_id: "slider_to_cart" |
140 changes: 140 additions & 0 deletions
140
gz_ros2_control_demos/launch/cart_example_ft_sensor.launch.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| # Copyright 2025 Open Source Robotics Foundation, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from launch import LaunchDescription | ||
| from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
| from launch.actions import RegisterEventHandler | ||
| from launch.event_handlers import OnProcessExit | ||
| from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
| from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution | ||
|
|
||
| from launch_ros.actions import Node | ||
| from launch_ros.substitutions import FindPackageShare | ||
|
|
||
|
|
||
| def generate_launch_description(): | ||
| # Launch Arguments | ||
| use_sim_time = LaunchConfiguration('use_sim_time', default=True) | ||
| gz_args = LaunchConfiguration('gz_args', default='') | ||
|
|
||
| # Get URDF via xacro | ||
| robot_description_content = Command( | ||
| [ | ||
| PathJoinSubstitution([FindExecutable(name='xacro')]), | ||
| ' ', | ||
| PathJoinSubstitution( | ||
| [FindPackageShare('gz_ros2_control_demos'), | ||
| 'urdf', 'test_cart_ft_sensor.xacro.urdf'] | ||
| ), | ||
| ] | ||
| ) | ||
| robot_description = {'robot_description': robot_description_content} | ||
| robot_controllers = PathJoinSubstitution( | ||
| [ | ||
| FindPackageShare('gz_ros2_control_demos'), | ||
| 'config', | ||
| 'cart_controller_ft_sensor.yaml', | ||
| ] | ||
| ) | ||
|
|
||
| gazebo_world = PathJoinSubstitution( | ||
| [ | ||
| FindPackageShare('gz_ros2_control_demos'), | ||
| 'worlds', | ||
| 'empty_ft_sensor.sdf', | ||
| ] | ||
| ) | ||
|
|
||
| node_robot_state_publisher = Node( | ||
| package='robot_state_publisher', | ||
| executable='robot_state_publisher', | ||
| output='screen', | ||
| parameters=[robot_description] | ||
| ) | ||
|
|
||
| gz_spawn_entity = Node( | ||
| package='ros_gz_sim', | ||
| executable='create', | ||
| output='screen', | ||
| arguments=['-topic', 'robot_description', | ||
| '-name', 'cart', '-allow_renaming', 'true'], | ||
| ) | ||
|
|
||
| joint_state_broadcaster_spawner = Node( | ||
| package='controller_manager', | ||
| executable='spawner', | ||
| arguments=['joint_state_broadcaster'], | ||
| ) | ||
| joint_trajectory_controller_spawner = Node( | ||
| package='controller_manager', | ||
| executable='spawner', | ||
| arguments=[ | ||
| 'joint_trajectory_controller', | ||
| '--param-file', | ||
| robot_controllers, | ||
| ], | ||
| ) | ||
| force_torque_sensor_broadcaster = Node( | ||
| package='controller_manager', | ||
| executable='spawner', | ||
| arguments=[ | ||
| 'force_torque_sensor_broadcaster', | ||
| '--param-file', | ||
| robot_controllers, | ||
| ], | ||
| ) | ||
|
|
||
| # Bridge | ||
| bridge = Node( | ||
| package='ros_gz_bridge', | ||
| executable='parameter_bridge', | ||
| arguments=['/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock'], | ||
| output='screen' | ||
| ) | ||
|
|
||
| return LaunchDescription([ | ||
| # Launch gazebo environment | ||
| IncludeLaunchDescription( | ||
| PythonLaunchDescriptionSource( | ||
| [PathJoinSubstitution([FindPackageShare('ros_gz_sim'), | ||
| 'launch', | ||
| 'gz_sim.launch.py'])]), | ||
| launch_arguments=[('gz_args', [gz_args, ' -r -v 4 ', gazebo_world])]), | ||
| RegisterEventHandler( | ||
| event_handler=OnProcessExit( | ||
| target_action=gz_spawn_entity, | ||
| on_exit=[joint_state_broadcaster_spawner], | ||
| ) | ||
| ), | ||
| RegisterEventHandler( | ||
| event_handler=OnProcessExit( | ||
| target_action=joint_state_broadcaster_spawner, | ||
| on_exit=[joint_trajectory_controller_spawner], | ||
| ) | ||
| ), | ||
| RegisterEventHandler( | ||
| event_handler=OnProcessExit( | ||
| target_action=joint_trajectory_controller_spawner, | ||
| on_exit=[force_torque_sensor_broadcaster], | ||
| ) | ||
| ), | ||
| bridge, | ||
| node_robot_state_publisher, | ||
| gz_spawn_entity, | ||
| # Launch Arguments | ||
| DeclareLaunchArgument( | ||
| 'use_sim_time', | ||
| default_value=use_sim_time, | ||
| description='If true, use simulated clock'), | ||
| ]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.