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

force_torque_sensor_broadcaster values are not available #30

Closed
jaronski opened this issue Jun 3, 2024 · 4 comments
Closed

force_torque_sensor_broadcaster values are not available #30

jaronski opened this issue Jun 3, 2024 · 4 comments

Comments

@jaronski
Copy link

jaronski commented Jun 3, 2024

i tried to look into the force torque sensor simulation.
i couldn't find the ur_controller/force_torque_sensor_broadcaster as stated in the config.yaml
i downloaded the description and driver pkg from universal robots.

Is there a functional launch example where the force torque sensor broadcaster is utilized and actually publishes the values of the force_torque_sensor from ignition gazebo fortress to ros2 as a geometric wrench msg?

Thanks for any help with the error:
[ign-1] [ERROR] [1717421068.852962020] [controller_manager]: Can't activate controller 'ftsensor_broadcaster': State interface with key 'ft_sensor/force.x' does not exist

i am using the force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster and not the ur_controller/... as i didn't find it in the repos

controller_manager:
  ros_parameters:
  update_rate: 100
  publish_rate: 100
  use_sim_time: True
  ftsensor_broadcaster:
      type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster

/ftsensor_broadcaster:
  ros__parameters:
    interface_names:
      force:
        x: ft_sensor/force.x
        y: ft_sensor/force.y
        z: ft_sensor/force.z 
      torque:
        x: ft_torque_sensor/torque.x
        y: ft_torque_sensor/torque.y
        z: ft_torque_sensor/torque.z
    
    frame_id: ft_sensor_link
    topic_name: ft_data

here is the part of the relevant urdf description:

    <joint name="ft_sensor_joint" type="fixed">
      <parent link="link_6_clean"/>
      <child link="ft_sensor_link"/>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <gazebo>
        <provideFeedback>true</provideFeedback>
      </gazebo>
    </joint>

    <ros2_control name="force_torque_sensor" type="sensor">
    <hardware>
      <plugin>force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster</plugin>
    </hardware>
    
    <sensor name="ft_sensor">
      <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"/>
      <param name="frame_id">sensor_frame</param>
    </sensor>
  </ros2_control>

Thanks for any hints or tips

@VinDp
Copy link
Collaborator

VinDp commented Jun 5, 2024

Hi @jaronski,
to our current knowledge, gazebo ignition still doesn't provide that kind of information from the simulation. If you have any sources saying the opposite, then feel free to reopen.

@VinDp VinDp closed this as completed Jun 5, 2024
@jaronski
Copy link
Author

@VinDp
thanks for your response. As far as i can tell there is a force torque sensor in the ignition fortress (gazebo) version. gazebosim/gz-sensors#25. The "workaround" is to add the ftsensor inside of the "world.sdf" that i launch.

<!-- FT Plugin -->
    <plugin filename="ignition-gazebo-forcetorque-system" name="ignition::gazebo::systems::ForceTorque">
      <sensor name="tcp_fts_sensor"/>
    </plugin>

I am able to get values from the sensor inside ignition with ign topic -e -t /topic_name (in my case a very long name)
when launching ros_gz_bridge parameter_bridge i am also able to see the values in a ros2 topic.

so as i looked into your repos, i have seen that in your config.yaml you defined a ur_controller/force_torque_sensor_broadcaster which i couldn't find an implementation so this is why i asked here.

I also tried to setup my environment to work with gazebo classic ros2_control and ros2 humble and the "old" ft sensor but also no success.

I also tried to debug the force_torque_sensor_broadcaster but i couldn't find the part where the urdf is checked for the defined state_interfaces always resulting in the error:

[ign-1] [ERROR] [1717421068.852962020] [controller_manager]: Can't activate controller 'ftsensor_broadcaster': State interface with key 'ft_sensor/force.x' does not exist

@fmauch
Copy link
Collaborator

fmauch commented Jun 10, 2024

@jaronski thanks for providing the insight. For this to work as the rest of this simulation it would have to be integrated into gz_ros2_control. As far as I can see, however, only IMU sensors are supported in gz_ros2_control.

Only then it would be possible to inject this into the ros2_control ecosystem with the ftsensor_broadcaster. See https://github.com/ros-controls/gz_ros2_control/issues/170 as the related upstream issue.

@jaronski
Copy link
Author

thanks @fmauch for your fast response. I didn't check the gz_ros2_control implementation :( i could have saved a lot of time
anyway thanks for providing the feedback

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

No branches or pull requests

3 participants