Skip to content

ros package for logicool g29 steering force feedback control

License

Notifications You must be signed in to change notification settings

lym-ay/ros-g29-force-feedback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ros-g29-force-feedback

Overview

Ros package to control force feedback of logitech g29 steering wheel from 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.

logitech g29

Features

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

  • We can control angle of logitech g29 steering wheel with throwing ros message.

  • Two control modes

    1. PID control mode
      Rotate wheel to the specified angle with PID control.(I controller is now deprecated). This mode can rotate wheel to the specified angle with your hands off, so this mode is useful for the user interface of autonomous driving system. Control force can be specified (max force for PID control, the bigger, the more move rapidly).

    2. Constant force mode
      Rotate wheel to the specified angle with specified constant force. This mode make it easier to control vehicle manually in the driving simulator. If you use with your hands off and rotate force over 0.3, the wheel travels right and left.

Demo

demo_gif

Requirement

  • ubuntu
  • ros melodic
  • Logitech G29 Driving Force Racing Wheel

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...

Usage

  1. confirm your device name

    $ cat /proc/bus/input/devices

    find Logitech G29 Driving Force Racing Wheel and check Handlers (ex. event19)

  2. change parameters in g29_force_feedback.yaml

    parameter default description
    device_name /dev/input/event19 device name, change the number
    mode 0 control mode 0: PID control, 1: Constant force
    Kp 1 P value of PID contol
    Ki 0.0 I value of PID contol (Deprecated)
    Kd 0.1 D value of PID contol
    offset 0.01 affordable radian(offset * 2.5π) of control
    max_force 1.0 max force
    min_force 0.2 0.25 is best! less than 0.2 cannot turn the wheel (in my case)
    pub_rate 0.1 event update rate (0.1=10Hz)
  3. run ros node

    $ source /path/to/catkin_ws/devel/setup.bash
    $ rosparam load /path/to/catkin_ws/src/g29_force_feedback/g29_force_feedback.yaml
    $ rosrun g29-force-feedback node
  4. Throw message (It's better to use tab completion)

    $ rostopic pub /ff_target g29-force-feedback/ForceFeedback "header:
      seq: 0
      stamp:
        secs: 0
        nsecs: 0
      frame_id: ''
    angle: 0.3
    force: 0.6"

    Once the message is thrown, the wheel rotates to 0.3*2.5π with 0.6 rotation power with PID control. Publish rate is not restricted.

Install

  1. create catkin_ws
    cd /path/to/any/dir
    mkdir -p catkin_ws/src
    cd /catkin_ws/src
    catkin_init_workspace
  2. download package
    cd /catkin_ws/src
    git clone https://github.com/kuriatsu/g29-force-feedback.git
    cd ../
    catkin_make

Contribution

  1. Fork it (https://github.com/kuriatsu/g29-force-feedback.git)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Licence

MIT

Author

kuriatsu

About

ros package for logicool g29 steering force feedback control

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 80.8%
  • CMake 12.5%
  • Python 6.7%