Ensuring DReyeVR does not give ~empty VehicleControl inputs in order to run external agents #125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running a route scenario using
scenario_runner
with a specified route and agent, in every tick, thescenario_manager.py
gives control input to the ego vehicle.python scenario_runner.py --route srunner/data/route_1.xml srunner/data/no_scenarios.json --agent srunner/autoagents/npc_agent.py
In
_tick_scenario
ofscenario_manager.py
:However, the current implementation in
DReyeVRPawn.cpp
retrieves the Logitech wheel data, and gives an emptyVehicleControl
object if no input from the wheel, or Logitech wheel is disconnected. The problem with this issue is that if no input is given, the implementation flushes empty vehicle controls:In
AEgoVehicle::TickVehicleInputs()
ofEgoInputs.cpp
:Since this function is called in every tick, any other input given by a client is not considered, and thus, validation is required to check if the
VehicleControl
object does not have zero parameter. If so,VehicleControl
must not be applied.Note:
FMath::IsNearlyEqual
is used because even when input from Logitech steering wheel by the user is not given, it still sends very close to zero values.Note: Initial issue I made at CARLA/scenario_sunner.
I am interested in hearing what would be the drawbacks of my approach.