[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] Retrieve edge shape via TraCI
|
Hi Jakob,
Thank you for your answer.
I am already querying the lanes' shapes (for a different purpose). Just
for the current requirement, the edges' shapes would have been helpful.
So, I guess I'll just go with the lanes or query the net.xml directly.
Best regards,
Alex
On 5/4/22 16:38, Jakob Erdmann wrote:
The function traci.lane.getShape is part of the standard TraCI API
(though I'm not sure if Veins has exposed this yet).
If you really need the original edge reference line, there is some
geometry code in sumo which you could use to compute it from the lane
shape (utils/geom/PositionVector::move2side)
regards,
Jakob
Am Di., 3. Mai 2022 um 13:45 Uhr schrieb Alexander Brummer
<alexander.brummer@xxxxxx <mailto:alexander.brummer@xxxxxx>>:
Hi Jakob,
Thank you for your suggestion.
However, the sumolib is a Python library and thus (usually) only
accessible from Python code, right?
Of course, I could also use any kind of C++ XML parsing library and
parse the net.xml file myself. I would just have preferred a solution
similar to how existing parameters are exchanged between Veins and SUMO.
Best regards,
Alex
On 5/2/22 13:59, Jakob Erdmann wrote:
> Hello,
> you can retrieve static information about an the network via
sumolib:
> https://sumo.dlr.de/docs/Tools/Sumolib.html
<https://sumo.dlr.de/docs/Tools/Sumolib.html>
> <https://sumo.dlr.de/docs/Tools/Sumolib.html
<https://sumo.dlr.de/docs/Tools/Sumolib.html>>
> Relevant calls:
> - edge.getRawShape (shape attribute of the edge)
> l- ane.getShape (lane shapes derived from the former)
>
> The spreadType value currently isn't stored within the edge
objects but
> adding them in
>
https://github.com/eclipse/sumo/blob/f3bf072cbdc794e3c91d7d0eee790482bd219a60/tools/sumolib/net/__init__.py#L644-L673
<https://github.com/eclipse/sumo/blob/f3bf072cbdc794e3c91d7d0eee790482bd219a60/tools/sumolib/net/__init__.py#L644-L673>
>
<https://github.com/eclipse/sumo/blob/f3bf072cbdc794e3c91d7d0eee790482bd219a60/tools/sumolib/net/__init__.py#L644-L673
<https://github.com/eclipse/sumo/blob/f3bf072cbdc794e3c91d7d0eee790482bd219a60/tools/sumolib/net/__init__.py#L644-L673>>
> should be trivial (pull requests welcome).
>
> regards,
> Jakob
>
>
> Am Mo., 2. Mai 2022 um 13:43 Uhr schrieb Alexander Brummer
> <alexander.brummer@xxxxxx <mailto:alexander.brummer@xxxxxx>
<mailto:alexander.brummer@xxxxxx <mailto:alexander.brummer@xxxxxx>>>:
>
> Hi,
>
> I use SUMO in combination with Veins.
> For a new model, I need to retrieve the edges' shapes (and
spread type)
> from Veins (as for example shown in netedit).
>
> Unfortunately, the two parameters do not seem to be available via
> TraCI.
> In fact, they seem to be only present in netedit etc., but
not while
> simulating (I understand that they are probably irrelevant
for the
> simulation itself).
>
> Could you maybe give me a hint about what would be the best
way to get
> these values? I have no problem with extending the code, but
it seems
> like I would have to make (profound) changes at many places.
Therefore,
> I wanted to make sure that I don't overlook an easier solution.
>
> Best regards,
> Alex
>
>
--
Alexander Brummer, M.Sc.
Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU)
Lehrstuhl Informatik 7 - Rechnernetze und Kommunikationssysteme
Mail: alexander.brummer@xxxxxx | Web: https://cs7.tf.fau.de/person/brummer
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature