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.
-
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
-
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). -
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.
-
- 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...
-
confirm your device name
$ cat /proc/bus/input/devices
find Logitech G29 Driving Force Racing Wheel and check Handlers (ex. event19)
-
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) -
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
-
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.
- create catkin_ws
cd /path/to/any/dir mkdir -p catkin_ws/src cd /catkin_ws/src catkin_init_workspace
- download package
cd /catkin_ws/src git clone https://github.com/kuriatsu/g29-force-feedback.git cd ../ catkin_make
- Fork it (https://github.com/kuriatsu/g29-force-feedback.git)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request