HARPLab / DReyeVR

VR driving 🚙 + eye tracking 👀 simulator based on CARLA for driving interaction research
https://arxiv.org/abs/2201.01931
MIT License
149 stars 40 forks source link

I can not use LogitechWheel in DReyeVR project #72

Closed unrealtz closed 1 year ago

unrealtz commented 1 year ago

I have install DReyeVR from "https://github.com/HARPLab/DReyeVR/blob/main/Docs/Install.md" instructor. I use "Logitech G923 Racing Wheel & Pedals" and add it to the project by running the following lines:

# (optional) install LogitechWheelPlugin
git clone https://github.com/HARPLab/LogitechWheelPlugin
mv LogitechWheelPlugin/LogitechWheelPlugin Unreal/CarlaUE4/Plugins/ # install to carla

cd carla
make PythonAPI  # build the PythonAPI (and LibCarla) again
make launch     # launch in editor
make package    # create an optimized package
make check      # run Carla unit tests

I set the following flag to true ////////////////////////////////////////////////////////////// // Edit these variables to enable/disable features of DReyeVR bool UseSRanipalPlugin = false; bool UseLogitechPlugin = true; ... ////////////////////////////////////////////////////////////// but when running the following command LogitechWheel is not activate and I can run the car just by keyboard:

# on Windows x64 Visual C++ Toolset
cd \PATH\TO\CARLA\Build\UE4Carla\0.9.13-dirty\WindowsNoEditor\
CarlaUE4.exe
GustavoSilvera commented 1 year ago

Did you set the UseLogitechPlugin flag to true before you make package again? You'll need to rebuild in order to add this functionality.

unrealtz commented 1 year ago

thank you, I have solved the problem by installing "Logitech G HUB". I have another question, can I add "manual gear shift" to the car or it should be "Automatic gear"?

best regards

GustavoSilvera commented 1 year ago

We have only programmed it to be in automatic gear.

zoughi commented 1 year ago

hi, dear I have a question, I would be appreciate if you answer me. we run your DReyeVR project correctly using "Logitech G HUB". currently, we use the button on the wheel for driving (D) and Reversing (R). how can we use "Logitech G Driving Force Shifter" for driving (D) and Reversing (R)?

best regards

GustavoSilvera commented 1 year ago

You'll first need to figure out what the shifter inputs correspond to in the UE4 Logitech plugin, I currently don't know of a great way to do this than enabling (in configs) the debugging/logging system and brute-force trying all the inputs until finding a match.

Then you'll want to map them to these inputs. but rather than PressReverse and ReleaseReverse you'll probably want a function that directly sets the target gear to some setting (D, N, P, R, etc.) using SetTargetGear like in EgoInputs.cpp.

// example
EgoVehicle->GetVehicleMovementComponent()->SetTargetGear(NewGear, true);