carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.11k stars 3.58k forks source link

Change in Server #800

Closed FarzanehJafari closed 5 years ago

FarzanehJafari commented 5 years ago

Hi, I am going to change the server quiet a bit. I would like both of client and server control vehicles with keyboard. What do I do about this problem? Could you help me? Thanks,

FarzanehJafari commented 5 years ago

Hi, I added a parameter to Player_Carla_Measurements and sent to client. Client Could read this data, but after a second, Carla crashed. What do you think about this problem?

nsubiron commented 5 years ago

Hi @FarzanehJafari,

We provide a Python script that allows controlling the player vehicle with the keyboard: manual_control.py, wouldn't that work for you?

FarzanehJafari commented 5 years ago

Hi, this python code woked fo me, but I want driving both with client and sometimes with server sach as change weathers with server. Does it work possible? and Which classes should be change on server side?Another problem is about benchmark driving. python code doesnt work for me and there isnt run_driving_benchmark in directory. Thanks a lot,

Sent from Yahoo Mail for iPhone

On Tuesday, September 25, 2018, 10:35, Néstor Subirón notifications@github.com wrote:

Hi @FarzanehJafari,

We provide a Python script that allows controlling the player vehicle with the keyboard: manual_control.py, wouldn't that work for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

nsubiron commented 5 years ago

Having both inputs simultaneously is a bit tricky since they will interfere with each other, as both inputs are being applied to the vehicle continuously every frame.

Take a look at WheeledVehicleController.cpp, there is where we suppress the input from the simulator window when the client is active.

FarzanehJafari commented 5 years ago

which function of wheeledvehiclecontroller.cpp is doing this work? I dont found it.

Sent from Yahoo Mail for iPhone

On Tuesday, September 25, 2018, 11:41, Néstor Subirón notifications@github.com wrote:

Having both inputs simultaneously is a bit tricky since they will interfere with each other, as both inputs are being applied to the vehicle continuously every frame.

Take a look at WheeledVehicleController.cpp, there is where we suppress the input from the simulator window when the client is active.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

nsubiron commented 5 years ago

The Set*Input() functions at the bottom of the file,

if (bAllowUserInput && !IsAutopilotEnabled()) {
  // set input here.
}

if Carla is running in server mode, bAllowUserInput is false.

FarzanehJafari commented 5 years ago

I set constant value for bAllowUserInput = true, but yet, I couldnt control vehicle with server. 🙁🙁 Whats your suggestion about it? Are there any parameters, I should be changed?

On Tue, Sep 25, 2018 at 2:20 AM Néstor Subirón notifications@github.com wrote:

The Set*Input() functions at the bottom of the file,

if (bAllowUserInput && !IsAutopilotEnabled()) { // set input here. }

if Carla is running in server mode, bAllowUserInput is false.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/carla-simulator/carla/issues/800#issuecomment-424268358, or mute the thread https://github.com/notifications/unsubscribe-auth/Ak0fWh0-i8wqawRoI4bKpYHSfjUC_qdkks5uefVrgaJpZM4W1LUm .

nsubiron commented 5 years ago

As I mention, probably the input coming from the client is overwriting the input from the server, you'd need to find a way of merging both inputs.

FarzanehJafari commented 5 years ago

Which classes can I see this Input functions for server and standalone modes? Thanks a lot for your help.

On Tue, Sep 25, 2018 at 4:44 AM Néstor Subirón notifications@github.com wrote:

As I mention, probably the input coming from the client is overwriting the input from the server, you'd need to find a way of merging both inputs.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/carla-simulator/carla/issues/800#issuecomment-424310376, or mute the thread https://github.com/notifications/unsubscribe-auth/Ak0fWu6kVHDoI21izhOORY3NTfiROoDVks5uehcggaJpZM4W1LUm .

nsubiron commented 5 years ago

Hi @FarzanehJafari, no worries. The input from the keyboard comes from that class, WheeledVehicleController.cpp; and the input from the client-side comes from DataRouter::ApplyVehicleControl in DataRouter.h. But every frame you get control from both sides (including 0.0 if the key is not pressed), so the last one writing is the one that actually applies. The tricky part is how to combine these two so the vehicle control still makes sense.

FarzanehJafari commented 5 years ago

Hi, Thank you very much. I could use from Client and Server for control Vehicle. but, I have another question about add a parameter to measurements and send to client. I add an integer parameter to void FCarlaEncoder::Encode() function and run it. but I have this Error

FarzanehJafari commented 5 years ago

45946081-9929df00-bfa4-11e8-8290-f1c0f0bd427d

nsubiron commented 5 years ago

That's not an error, those are variables optimized by the compiler. If you change the configuration to debug in Visual Studio you'll see those variables.

FarzanehJafari commented 5 years ago

I dont understand exactly? could you explain about it for me with more details? Thanks

On Sun, Sep 30, 2018 at 12:06 AM Néstor Subirón notifications@github.com wrote:

That's not an error, those are variables optimized by the compiler. If you change the configuration to debug in Visual Studio you'll see those variables.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/carla-simulator/carla/issues/800#issuecomment-425699870, or mute the thread https://github.com/notifications/unsubscribe-auth/Ak0fWjHLrBIBDFrFZrUkdIN7NB8Je1XFks5ugG1zgaJpZM4W1LUm .

nsubiron commented 5 years ago

Sorry, those are general programming issues we cannot give support to.

I would recommend reading more about how the compiler optimizes code, and how Visual Studio debugging works, e.g.

Hope those links are a good starting point.

FarzanehJafari commented 5 years ago

Thaks a lot

Sent from Yahoo Mail for iPhone

On Sunday, September 30, 2018, 12:36, Néstor Subirón notifications@github.com wrote:

Sorry, those are general programming issues we cannot give support to.

I would recommend reading more about how the compiler optimizes code, and how Visual Studio debugging works, e.g.

Hope those links are a good starting point.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.