abhisheknaik96 / MultiAgentTORCS

The multi-agent version of TORCS for developing control algorithms for fully autonomous driving in the cluttered, multi-agent settings of everyday life.
141 stars 32 forks source link

Sensor information of the "player" TORCS agent #1

Closed MehaKaushik closed 6 years ago

MehaKaushik commented 6 years ago

Hey,

Is it possible to extract the sensor data(as mentioned here in section SENSOR ) of the inbuilt "player" agent of TORCS.

abhisheknaik96 commented 6 years ago

The scr_server communicates with the agent over a UDP channel.1 The function drive() in torcs-x.x.x/src/drivers/scr_server/scr_server.cpp receives the action in the form of a string from the agent, which is then parsed into the action action inputs before being applied by the game engine to get the next state.

One way to extract the sensor data would be to get these action inputs via the keyboard, as is done in torcs-x.x.x/src/drivers/human/human.cpp. You can copy-paste that keyboard/joystick input code in place of the UDP-string-parsing in scr_server.cpp in order to manually collect data from the simulator.

Hope that answers your question.

1 SCR-manual (Pages 2-3)

MehaKaushik commented 6 years ago

Yes it does. Thanks.