Repository Summary

Description ros package for logicool g29 steering force feedback control
Checkout URI https://github.com/kuriatsu/ros-g29-force-feedback.git
VCS Type git
VCS Version master
Last Updated 2024-11-27
Dev Status UNKNOWN
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
ros_g29_force_feedback 0.0.0

README

GitHub forks GitHub Repo stars GitHub last commit ros ubuntu

ros-g29-force-feedback

ROS2 package to control force feedback of logitech g29 steering wheel with ros message, written in c++, for human beings all over the world. This is useful for the user interface of autonomous driving, driving simulator like CARLA, LGSVL etc.

examples/carla_control.py

demo_gif

Features

  • Standalone ros package to control steering wheel. (doesn’t depend on the other ros packages like ros-melodic-joy etc.)
  • Two control modes

    • Control mode (config/g29.yaml/auto_centering=false)
      Rotate wheel to the specified angle (position) with specified torque as specified with rostopic.

    • Auto centering mode (config/g29.yaml/auto_centering=true)
      Automatically centering position, without publishing rostopic.

  • ROS1 and ROS2 support. (if you use ROS1, checkout and refer ros1 branch) |ROS version|g29|g923| |:–|:–|:–| |ROS1|–|–| |Kinetic|tested|no| |Melodic|tested|no| |Noetic|tested|no| |ROS2|–|–| |Dashing|no|no| |Foxy|tested|no| |Galactic|tested|no| |Humble|no|no|

Requirement of master branch

  • ubuntu18-22
  • ROS2
  • Logitech G29 Driving Force Racing Wheel (Planning to test with g923)

To check whether your kernel supports force feedback, do as follows

$ cat /boot/config-5.3.0-46-generic | grep CONFIG_LOGIWHEELS_FF
CONFIG_LOGIWHEELS_FF=y

If you cannot get CONFIG_LOGIWHEELS_FF=y, try to find patch or use latest kernel…

Install

  1. create ros2_ws
    mkdir -p ros2_ws/src
    cd /ros2_ws
    colcon build
    
  1. download and build package
    cd /ros2_ws/src
    git clone https://github.com/kuriatsu/ros-g29-force-feedback.git
    cd ../
    colcon build --symlink-install
    

Usage

  1. Get device name
    $ cat /proc/bus/input/devices
    
find **Logitech G29 Driving Force Racing Wheel** and check Handlers (ex. event19)
  1. Change device_name in config/g29.yaml to the device name you obtained in step 1

  2. Launch ros node

    $ source ros2_ws/install/setup.bash
    $ ros2 run ros_g29_force_feedback g29_force_feedback --ros-args --params-file ros2_ws/src/ros_g29_force_feedback/config/g29.yaml 
    
  1. Publish message (It’s better to use tab completion)
    $ ros2 topic pub /ff_target ros_g29_force_feedback/msg/ForceFeedback "{header: {stamp: {sec: 0, nanosec: 0}, frame_id: ''}, position: 0.3, torque: 0.5}"
    
Once the message is published, the wheel rotates to 0.3*<max_angle> (g29: max_angle=450° clockwise, -450° counterclockwise).
Publish rate is not restricted.

Parameter

g29_force_feedback.yaml |parameter|default|description| |:–|:–|:–| |device_name|/dev/input/event19|device name, change the number| |loop_rate|0.1|Loop of retrieving wheel position and uploading control to the wheel| |max_torque|1.0|As for g29, 1.0 = 2.5Nm (min_torque < max_torque < 1.0)| |min_torque|0.2|Less than 0.2 cannot rotate wheel| |brake_torque|0.2|Braking torque to stop at the position (descrived below)| |brake_position|0.1|Brake angle (position-0.1max_angle)| |auto_centering_max_torque|0.3|Max torque for auto centering| |auto_centering_max_position|0.2|Max torque position while auto centering (position±0.2max_angle)| |eps|0.01|Wheel in the range (position-eps to position+eps) is considered as it has reached the position| |auto_centering|false|Anto centering if true|

ros_g29_ff

File truncated at 100 lines see the full file