fix_boundaries
Fix the boundaries of a given raceline.
from_image_to_raceline(point, origin, inc, height, is_y=False)
This function converts image points into coordinates of the 2D space.
It takes in input a point in our image reference frame and it converts it into a point in our raceline reference frame by scaling and shifting it according to the parameters of the yaml file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point |
float
|
the point coordinate |
required |
origin |
list
|
the origin parameter of the yaml file |
required |
inc |
float
|
the resolution parameter of the yaml file |
required |
height |
int
|
the height of the image |
required |
is_y |
boolean
|
if the point is the y coordinate |
False
|
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
the corresponding raceline coordinate |
from_raceline_to_image(point, origin, inc, height, width, is_y=False)
This function converts a point into an usable coordinate for the image.
It takes in input a point in our raceline reference frame ad it converts it into a point our image reference frame by scaling and shifting it according to the parameters of the yaml file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point |
float
|
the point coordinate |
required |
origin |
list
|
the origin parameter of the yaml file |
required |
inc |
float
|
the resolution parameter of the yaml file |
required |
height |
int
|
the height of the image |
required |
width |
float
|
the width of the image |
required |
is_y |
boolean
|
if the point is the y coordinate |
False
|
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
the corresponding image coordinate |
update_borders(raceline_csv, yaml_path, image_path)
This function computes (given a raceline) the correct left and right border.
It achieve this task by using a "line casting" algorithms. More informations can be found in the "fix_boundaries_implementations_details" folder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raceline_csv |
ndarray
|
the raceline data |
required |
yaml_path |
str
|
the path to the corresponding yaml file |
required |
image_path |
str
|
the path to the corresponding raceline image |
required |
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: the updated raceline |