How to Get the Parameters of User-defined Markers with C-Code
I added a User-defined Marker with different parameters to my road. How can I read these values in C-Code?
Reading the user-defined marker is possible with the attached C-Code example. The code snippet is added in the User_TestRun_Start_atEnd() function.
There are different types of markers like Driver speed or DrivMan command. In case of User-defined markers, each "Marker name" stands for a new marker type. All new user-defined marker types are saved in the Road-InfoFile. This information is important to understand the mask, which is used in the RoadGetAllMarkerByObjId() function. Each digit of the mask stands for a marker type according to the list in the picture below. Choosing a value of 1 for a single digit means, that this marker type will be taken into account, else this type will be ignored. For more information, please refere to the RoadAPI description of CarMaker.
After adding the User.c example to the src folder of your project directory and recompiling the CarMaker executable, you have to choose the corresponding executable in the CarMaker Main GUI > Application > Configuration/Status. Finally, open the attached TestRun and start te simulation. Information about the markers will be logged in Sessions Log.
- Date: 28.02.2022
- Product: CarMaker
- Version: 10.2
- Component: C-Code Interface
- Language: English