lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.28k stars 780 forks source link

No input from Steering Wheel #62

Closed ajithkrishnan closed 5 years ago

ajithkrishnan commented 5 years ago

Hi,

This more of a Unity specific issue, but i was unable to find a solution online and was wondering if you guys faced a similar problem. Currently I am trying to control the Jaguar XE in the simulation using a Logitech G920 steering wheel. I see there are already scripts for Steering Wheel Input and for Force Feedback. However i was not able to control the vehicle in the "play mode" using the said wheel.

When I connect the wheel to the system, I receive this error in Unity "Logitech G920 Steering Wheel not recognized". Quite ironic and i did find information online that Unity supports this model.

I was able to finally control the vehicle by adding a few lines to the VehicleInputController.cs script. But i would like to know if there is a cleaner solution, specifically because i would like to have Force Feedback implemented.

Thanks.

martins-mozeiko commented 5 years ago

That is the exact steering wheel model we use in our office. It should in our simulator without any issues, including force feedback.

I receive this error in Unity "Logitech G920 Steering Wheel not recognized". Where do you see this error?

Have you installed Logitech G920 driver? You can get it in "Logitech Gaming Software" download from https://support.logitech.com/en_us/product/g920-driving-force/downloads Unity does not recognize wheel unless its driver is installed.

ajithkrishnan commented 5 years ago

@martins-mozeiko I assume you are running the simulator on Windows/Mac? I am using Ubuntu and there is no official release of a driver which is compatible with Linux. I installed it by following the instructions provided here : http://burning-midnight.blogspot.com/2017/11/logitech-g920-steering-wheel-on-linux.html

Where do you see this error? It's actually a warning . Shows up in the console output in Unity when i plug in the wheel.

martins-mozeiko commented 5 years ago

Right, most of time we use G920 wheel under Windows. You can get G920 wheel working in Unity under Linux if you set up following environment variable before launching binary build or Unity Editor:

export SDL_GAMECONTROLLERCONFIG="030000006d04000062c2000011010000,Logitech G920 Driving Force Racing Wheel,a:b0,b:b1,x:b2,y:b3,back:b7,guide:b10,start:b6,leftshoulder:b9,rightshoulder:b8,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a3,rightx:a2,righty:a1,lefttrigger:b5,righttrigger:b4,platform:Linux,"

If you are insterested creating this value for different wheel, you need to use software such as SDL2 Gamepad Tool or SDL2 ControllerMap from libSDL.

As for force feedback - we do not support it under Linux. It works only under Windows.

ajithkrishnan commented 5 years ago

Thank you. This worked.