常见问题

Need technical support?

Read distance to points detected by the line-sensor in C-code

Question

How can I read the distance to the lines of the roadmarkings detected by the line-sensor in the C-code?

Solution

Disclaimer:
Since CarMaker 12.0 we have introduced a new reworked "Ground Truth Sensor" model, which offers improved access to road marking / line information. Please consider using this new model!

The distances to the lines can be accessed using the c-code interface of the LineSensor.
The syntax would for example look like this:

LineSensor->RLines.L[0].ds[0][0]

Which looks complicated but actually just means the following:
RLines - lines to the right of the vehicle
L[0] - the nearest line detected (to the right)
ds[0] - distance from line sensor to the first detected Point P0 on the line (P0 is always the intersection point of the sensor FOV and the line, see attached picture)
[0] - the last [0] means the distance in x-direction. Y-direction would be [1]

Please be aware, that the distance is calculated from the mounting point of the line sensor, so the results will depend on the sensors position.
You can use the User.c file in your src-folder to create your own UAQs for the line distances. That way you will be able to also display the distance in IPG Control.

Need technical support?
  • Date: 01.08.2023
  • Product: CarMaker
  • Version: 11.1
  • Component: Sensor Models
  • Language: English

Tags

Line-Sensor
sensors
C-code