From: Jakob E. <nam...@go...> - 2013-07-25 13:36:13
|
Hello, the command needs to be "getvariable_plus 0xab 0x82 0 <compound> 2 0x01 8100,00 1500,00 0x04" All traci commands have the form [getVariable, domain, variable, targetId, ...] This even holds for simulation variables where the targetId is discarded. regards, Jakob 2013/7/23 Micky Sung <msu...@gm...>: > Hi again, > > I've tried using the format suggested, but it throws up and error of invalid > position. I though that this might be from my client but I tried the same > with the Windows build of the TraciTestClient.exe and in the definition file > I tried: > > "getvariable_plus 0xab 0x82 <compound> 2 0x01 8100,00 1500,00 0x04" - this > throws up the error of "## Unknown data type: 2", to try and solve this I > put the corresponding data types in front of the values, but then that would > throw up the error of "Error: Answered with error to command 171: Position > conversion requires a compound object." > > Thank you very much for your help in this matter, > Micky Sung > > > On 23 July 2013 11:09, Jakob Erdmann <nam...@go...> wrote: >> >> Hello, >> <compound> 2 0x01 8100,00 1500,00 0x04 >> should work. (see >> >> https://sourceforge.net/apps/mediawiki/sumo/index.php?title=TraCI/Protocol#Position_Representations) >> regards, >> Jakob >> >> 2013/7/22 Micky Sung <msu...@gm...>: >> > To: Jakob, >> > >> > Ah, of course! Thank you very much for pointing that out, I had not >> > noticed >> > that API. Is it the Position Conversion (0x82) command in the Get >> > Simulation >> > Variable? >> > >> > I am currently trying that now, but I am having trouble entering in the >> > correct Position representation into the string that I enter into >> > client. I >> > am assigning "<compound> 2 8100,00 1500,00 0x01 0x04" into the >> > std::string& >> > objID given that 8100,00 and 1500,00 is the X and Y coordinates from the >> > simulation and I am wanting the positionRoadMap conversion back. Would >> > it be >> > possible for you to let me know what is the correct format I need for >> > the >> > Position representation as I am stuck on that currently. >> > >> > Kind regards, >> > Micky Sung >> > >> > >> > On 22 July 2013 08:20, Jakob Erdmann <nam...@go...> wrote: >> >> >> >> Hello, >> >> You will have to update the route all the time but that should be no >> >> problem. >> >> there is a traci call which transforms geo-coordinates into (lane,pos) >> >> coordinates but the simulation will not let vehicles drive off-road >> >> without some c++ hacking. >> >> regards, >> >> Jakob >> >> >> >> 2013/7/19 Micky Sung <msu...@gm...>: >> >> > To: Everybody, >> >> > >> >> > I have a predicament using SUMO, I am wanting to control a vehicle >> >> > in >> >> > the >> >> > simulation using the implemented commands such as "Change Vehicle >> >> > State >> >> > - >> >> > Move To" or "Change Vehicle State - Reroute" so that I can possibly >> >> > integrate it with some form of user interactive program (for example, >> >> > a >> >> > driving "game") to allow user's to drive a SUMO vehicle. >> >> > >> >> > My scenario is this: >> >> > ---------------------------- >> >> > I have a simulation running and I have a client connected to the >> >> > simulation using the TraCI interface. >> >> > Through this interface I am able to add a vehicle into the >> >> > simulation >> >> > by >> >> > assigning it a route already defined within the simulation (i.e. >> >> > route >> >> > !1000) along with a speed. This new vehicle will continues along this >> >> > route >> >> > until the end like a standard vehicle. >> >> > >> >> > What I am wanting to do: >> >> > ------------------------------------ >> >> > After inserting this vehicle, I want to be able to control this >> >> > vehicle's >> >> > speed and positioning. I am able to do this already with the speed >> >> > using >> >> > "Change Vehicle State - Speed" with no problem. I am also wanting to >> >> > control the vehicle's positioning directly, so, for example I could >> >> > make >> >> > a >> >> > vehicle turn left and right regardless of the original route and lane >> >> > or >> >> > edge. >> >> > >> >> > Problems: >> >> > -------------- >> >> > However, I am having problems with changing the position of the >> >> > vehicle >> >> > due >> >> > to the fact that I would need the Lane ID or Edge ID or the Route ID. >> >> > However, because I am wanting to try and make this more game-like, I >> >> > would >> >> > like to try and change the vehicle's position given only the >> >> > positioning >> >> > data (i.e GPS or the Cartesian values used in SUMO - I can use the >> >> > Proj4's >> >> > transformation formula to change the values back and forth with no >> >> > problem). >> >> > >> >> > So, one possible solution that I had thought of would be to use the >> >> > position to get the nearest Edge/Lane and then I could add that to >> >> > the >> >> > route as a bit of a work around. But my only worry with that is that >> >> > I >> >> > would not be able to give it a position outside of any known >> >> > route/edge/lane. >> >> > >> >> > Regards, >> >> > Micky Sung >> >> > >> >> > >> >> > ------------------------------------------------------------------------------ >> >> > See everything from the browser to the database with AppDynamics >> >> > Get end-to-end visibility with application monitoring from >> >> > AppDynamics >> >> > Isolate bottlenecks and diagnose root cause in seconds. >> >> > Start your free trial of AppDynamics Pro today! >> >> > >> >> > >> >> > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk >> >> > _______________________________________________ >> >> > sumo-user mailing list >> >> > sum...@li... >> >> > https://lists.sourceforge.net/lists/listinfo/sumo-user >> > >> > > > |