Skip to content

Repository files navigation

contact_sensors_broadcaster

Introduction

This project provides a ros2_control ControllerInterface used to publish contact_msgs/Contacts.msg messages for every contact sensor, using one state interface for every sensor, where interface values are defined as:

0.0 - no contact between contact sensor and unknown object (false)

1.0 - contact between contact sensor and unknown object (true)

For example check out our fork of gz_ros2_control.

Broadcaster publishes message with contact states on topic defined as:

contact_sensor_broadcaster/contact_states

ROS 2 version

  • Humble

Dependencies (all for Humble)

Installation

  1. Install ros2_control for Humble (if you have not already)

  2. Clone contact_msgs repo to your workspace:

git clone https://github.com/BartlomiejK2/contact_msgs.git
  1. Clone this repo to your workspace:
git clone https://github.com/KNR-PW/LRT_contact_sensor_broadcaster.git
  1. Install dependencies in workspace:
rosdep install --ignore-src --from-paths . -y -r
  1. Build:
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

Controller parameters (example):

...
contact_sensors_broadcaster:
      type: contact_sensors_broadcaster/ContactSensorsBroadcaster
...
contact_sensors_broadcaster:
  ros__parameters:
    frame_ids:
    - contact_sensor_1
    - contact_sensor_2
    sensor_names:
    - arm_contact_sensor
    - foot_contact_sensor
  interface_postfix: "contact"
  publish_with_change: true
...

frame_ids - name of frames, where contact sensor is defined

sensor_names - Name of contact sensors

interface_postfix - Optional, name of the contact state interface. Default: contact.

publish_with_change - Optional, publish message only when one of contact states changes. Default: false

⚠️ IMPORTANT: SENSOR NAMES HAVE TO BE SAME AS IN ros2_control TAG AND gazebo reference TAG FOR THIS SENSORS (example)

Troubleshooting/New functionality

Add new Issue. I will try my best to answer. You can also contribute to project via pull requests.

Contributing

  1. Change code.
  2. Run all launchfile tests.
  3. Check performance, compliance and other functionality via e.g. plotjugller for ros2.
  4. Add clear description what changes you've made in pull request.

About

Controller to publish state of contact sensors.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages