Hello,
I am sorry for the delay in reply. Hopefully the answer below could be useful to people in the future.
Yes, it seems that for static objects, the location is not calculated as part of the simulation. That is perhaps done to save resources as static objects do not need an updated XYZ at every cycle.
One way to obtain the location of static objects is by reading their s-t position from the current TestRun infofile.
These are set here in the GUI but can also be read from the infofile of the testrun. There are access functions to do that, let me know if you need any help to find them.
To then convert an s-t point to a global XYZ position, the CarMaker ROAD API has to be used. There is a very similar example to this one in the Programmer’s Guide, but I have also created one better-suited to this question. The following piece of code executes once and shows how to use the RoadRouteEval function to convert ST to XYZ points from a specific route. This can be called for the starting position of the cones to get their XYZ global coordinates.
In the future, if this is useful, I can add it to the FSAI package for Formula Student.
// Create a new tRoad object and load the road from the current infofile in it
tRoad* ipg_road = RoadNew();
RoadReadInf(ipg_road, SimCore.TestRun.Inf);
tRoadRouteIn rIn;
tRoadRouteOut rOut;
tRoadEval *ipg_road_RE;
// This is a test point used to demonstrate the RoadRouteEval method
rIn.st[0] = 75.00;
rIn.st[1] = -2.25;
ipg_road_RE = RoadNewRoadEval(ipg_road, ROAD_BUMP_ALL, ROAD_OT_MIN, NULL);
RoadEvalSetRouteByName (ipg_road_RE, "ReverseRoute", 1);
RoadRouteEval(ipg_road_RE, "RoadConversion", RIT_ST, &rIn, &rOut);
Log("Location ST: %f, %f\n", rIn.st[0], rIn.st[1]);
Log("Location XY: %f, %f\n", rOut.xyz[0], rOut.xyz[1]);