Hi Jakob,
I checked your hints from the last mail:
·
The error appears regardless of whether I call polygon.getShape() immediately after TraCIAPI::connect() or after setting up some subscriptions.
·
I am using the following code
[…]
const std::vector<std::string> polygon_ids = polygon.getIDList();
for(std::size_t i=0; i < polygon_ids.size(); i++)
{
const std::string id =
polygon_ids.at(i);
const std::string type = polygon.getType(id);
const TraCIPositionVector shape = polygon.getShape(id);
const TraCIColor color = polygon.getColor(id);
Polygon p(id, type, shape, color);
}
[…]
and the error only occurs, if polygon.getShape(id) is called. The error does not occur when I comment polygon.getShape()
out.
I also tried to comment *only* polygon.getType() out, since I had assumed that its invocation might could have caused the problem, but the error persisted.
So from my point of view, I assume that the problem is directly linked to the polygon.getShape()
function.
I would appreciate any ideas.
Best regards,
Marc
Von:
sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx]
Im Auftrag von Jakob Erdmann
Gesendet: Freitag, 12. Oktober 2018 11:59
An: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Polygon coordinates via TraCI
- Can you reproduce the error when polygon.getShape() is the only traci call (after initialization)?
- Can you retrieve other polygon values without error?
Am Fr., 12. Okt. 2018 um 10:28 Uhr schrieb Marc Zofka <zofka@xxxxxx>:
Hi,
we are working with SUMO-GUI v.032 and the TraCI C++ code from v0.32.
Best regards,
Marc
Von:
sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx]
Im Auftrag von Jakob Erdmann
Gesendet: Freitag, 12. Oktober 2018 09:00
An: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Polygon coordinates via TraCI
shape retrieval is working in our currents tests. The error might be caused by mixing client version 1.0.0+ with sumo version 0.32.0 (there was a protocol change in 1.0.0)
Am Do., 11. Okt. 2018 um 08:59 Uhr schrieb Marc Zofka <zofka@xxxxxx>:
Dear Sumo-Users,
we tried to access the polygon information within the C++ TraCI, as proposed in a former
issue (see below):
[…]
const std::string id =
polygon_ids.at(i);
const std::string type = polygon.getType(id);
const TraCIPositionVector shape = polygon.getShape(id);
[…]
Unfortunately, we obtain the following error in the SUMO-GUI (v0.32)
Error: Storage::writeUnsignedByte(): Invalid value, not in [0, 255]
Quitting (on error).
when we execute the polygon.getShape() method (see above), which is defined in TraCIAPI.cpp
as follows:
// ---------------------------------------------------------------------------
// TraCIAPI::PolygonScope-methods
// ---------------------------------------------------------------------------
[…]
TraCIPositionVector
TraCIAPI::PolygonScope::getShape(const std::string& polygonID) const {
return myParent.getPolygon(CMD_GET_POLYGON_VARIABLE, VAR_SHAPE, polygonID);
}
[…]
Can you recommend how we could solve that issue?
Regards,
Marc
Von:
sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx]
Im Auftrag von Jakob Erdmann
Gesendet: Mittwoch, 12. September 2018 12:44
An: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Polygon coordinates via TraCI
2018-09-12 12:42 GMT+02:00 Thomas Thorn <thorn@xxxxxx>:
Hello everybody,
I am new to sumo. I use sumo 0.32 and was wondering if it is possible to get the coordinates of a polygon via TraCI.
Best regards,
Thomas
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user