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 - They are changed dynamically through topic.
-
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 not be specified (max force can be specified with rosparam). -
Constant force mode
Rotate wheel to the specified angle with specified constant force (up to max force specified with rosparam). 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. So it's better to use PID mode if you wanna use this with your hands off.
-
- 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...
- create catkin_ws
cd /path/to/any/dir mkdir -p catkin_ws/src cd /catkin_ws/src catkin_init_workspace
- download and build package
cd /catkin_ws/src git clone https://github.com/kuriatsu/ros-g29-force-feedback.git g29_force_feedback cd ../ catkin_make
-
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 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.0 pid_mode: true"
Once the message is thrown, the wheel rotates to 0.3*2.5π with PID control (the bigger the gap between current angle and specified angle is, the bigger the rotation force is.). Publish rate is not restricted. The value is ignored if you set pid_mode.
- 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
PID-Constant mode can be changed dynamically!! Removed mode selection from rosparam. Rotation force is ignored when PID mode. (max force can be specified with rosparam (not dynamic))