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
- Humble
-
Install
ros2_controlfor Humble (if you have not already) -
Clone
contact_msgsrepo to your workspace:
git clone https://github.com/BartlomiejK2/contact_msgs.git- Clone this repo to your workspace:
git clone https://github.com/KNR-PW/LRT_contact_sensor_broadcaster.git- Install dependencies in workspace:
rosdep install --ignore-src --from-paths . -y -r- Build:
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release...
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
...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)
- Change code.
- Run all launchfile tests.
- Check performance, compliance and other functionality via e.g. plotjugller for
ros2. - Add clear description what changes you've made in pull request.