sumo icon indicating copy to clipboard operation
sumo copied to clipboard

C# TraCI not working in sumo 1.13.0

Open Taeng-ioio opened this issue 3 years ago • 10 comments

Add your issue description here.

If possible, upload an example that shows your problem.

SUMO-version: sumo 1.13.0 operating system: ubuntu 20.04

I was using the code provided by the https://github.com/CodingConnected/CodingConnected.Traci site in the sumo 1.12.0 version.

After installing version 1.13.0 on a new computer, it does not work properly. sumoclient.SubscribeContextData("0", 50); It works well when you annotate the above code, but the above code stops the simulation with the "NullReferenceException: Object reference not set to an instance of an object" error at ControlCommands.cs 69 line tmp

I would appreciate it if you could help me with this.

Taeng-ioio avatar May 18 '22 06:05 Taeng-ioio

It works well when you annotate the above code

Do you mean, "when you remove this line of code by turning it into a comment" ?

namdre avatar May 18 '22 07:05 namdre

  • can you check whether TracCI.NET-Usage-example is working with 1.13?
  • can you explain where the method SubscribeContextData comes from? It doesn't appear to exist in the linked repo

namdre avatar May 18 '22 07:05 namdre

"when you remove this line of code by turning it into a comment" Yes. it is.

  • can you check whether TracCI.NET-Usage-example is working with 1.13? It works, but in that example, if you enter the C key, you will do "to make context subscription", which will stop the simulation.

The code does not stop immediately where the corresponding SubscriptionContext code returns, but it will subsequently stop at "CodingConnected.TraCI.NET/Commands/ControlCommands.cs line 69".

  • can you explain where the method SubscribeContextData comes from? It doesn't appear to exist in the linked repo It is in "CodingConnected.Traci/CodingConnected.TraCI.NET/Commands/TraCIContextSubscribableCommand.cs"

Taeng-ioio avatar May 18 '22 13:05 Taeng-ioio

* can you explain where the method SubscribeContextData comes from? It doesn't appear to exist in the linked repo
  It is in "CodingConnected.Traci/CodingConnected.TraCI.NET/Commands/TraCIContextSubscribableCommand.cs"

I can only find SubscribeContext but not SubscribeContextData in that file. Is this the one you mean?

https://github.com/CodingConnected/CodingConnected.Traci/blob/56fe20c626cc098620b4f5b671320352ba33ca50/CodingConnected.TraCI.NET/Commands/TraCIContextSubscribableCommand.cs#L52

@behrisch @schwamborn did anything change in the way we return context subscriptions in 1.13.0?

namdre avatar May 18 '22 14:05 namdre

@namdre not that I know of. @Taeng-ioio Can you confirm it works on the same machine with sumo 1.12.0?

schwamborn avatar May 18 '22 15:05 schwamborn

Well there was #8388 but I don't think this is the reason here. I would also like to know what SubscribeContextData does

behrisch avatar May 21 '22 05:05 behrisch

@namdre Whoops, I'm sorry. As you said, SubscriptionContext is correct, not SubscriptionContextData.

@schwamborn Normal operation on 1.12.0. It works on the project I created, and it works fine on the TraCI.NET-Usage-example.

I'll leave you a working screen

Below is a screen that works normally at 1.12.0. sumo_1 12 0

Below is a screen that does not work with 1.13.0. sumo_1_13

Taeng-ioio avatar May 23 '22 01:05 Taeng-ioio

To explain a little bit more about the operation, After running in 1.12.0, press "to make context subscription" through the "C" button and enter vehicle number 0 to get the relevant vehicle information.

Taeng-ioio avatar May 23 '22 01:05 Taeng-ioio

@Taeng-ioio Is there any information on how to build this for Linux?

behrisch avatar Jun 19 '22 19:06 behrisch

@namdre @behrisch Perhaps I could help on that.

bcoueraud87 avatar Jul 13 '22 12:07 bcoueraud87

@Taeng-ioio Feel free to add more comments if you have more information. For now I think we should rather continue here: #11712

behrisch avatar Oct 06 '22 14:10 behrisch