Jetracer Navigation package#

class ROS_Stack.jetracer_speedway_navigation.src.object_detection.ObjectDetection(model_ia_path: str)[source]#

Bases: Thread

Class to subscribe a topic to take image and by means of IA extract the lane and lines segmentation. Them process the segmentation, to extract the desired point to go the robot

publish_command(result_objects: dict) None[source]#
Void to publish a dictionary, with:
  • Key: name of object detection (see object_process.py to now possible detections)

  • Value: for each key is a list with centroid of all object detections.

Only publish car and stop sign info. TODO for the rest of detections.

Parameters:

result_objects (dict) – Dictionary with all objects detections

run() None[source]#

Main void

ROS_Stack.jetracer_speedway_navigation.src.object_detection.signal_handler(signal, frame) None[source]#
class ROS_Stack.jetracer_speedway_navigation.src.publish_goalPoint.ProcessImage(model_ia_path: str)[source]#

Bases: Thread

Class to subscribe a topic to take image and by means of IA extract the lane and lines segmentation. Them process the segmentation, to extract the desired point to go the robot

publish_point(desired_point: utils.Point) None[source]#

Void to publish desired point in Points format. The topic to publish is “jetracer_vels”

Parameters:

angle_deg (float) – Angle

run() None[source]#

Main void

ROS_Stack.jetracer_speedway_navigation.src.publish_goalPoint.signal_handler(signal, frame) None[source]#
class ROS_Stack.jetracer_speedway_navigation.src.security_stop.SecurityStop[source]#

Bases: Thread

publish_warning(ranges: list) None[source]#
run() None[source]#

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

ROS_Stack.jetracer_speedway_navigation.src.security_stop.signal_handler(signal, frame)[source]#
class ROS_Stack.jetracer_speedway_navigation.src.utils.image_process.Features_Detection[source]#

Bases: object

Class to extract the goal point in the image Errors:

  • 1: No detection

  • 2: Other error

process(result: list) Point[source]#
Function to get the desired point (this point will be a point in the center of the lane).
For get the point use different methods. Methods implement:
RIGHT CORNER – MIDDLE LINE -> Detect right corner line and middle line. Return the center point of both masks’ centroids
RIGHT LANE -> Detect right lane. Return the centroid of lane mask
RIGHT CORNER -> Detect right corner line. Return the mask’s centroid adding right offset (to center in the lane)
MIDDLE LINE -> Detect middle line. Return the mask’s centroid adding mid offset (to center in the lane)
TODO: Methods to implement:
lane_middle_right -> Detections of right Lane, middle Line and right corner Line
lane_right -> Detections of right Lane and right corner Line
lane_middle -> Detections of right Lane and middle Line
Parameters:

result (list) – Result of the prediction

Raises:

ValueError – Possible value error - 1: No detections

Returns:

Return the point in the middle of right lane

Return type:

Point

run(result: list) Point[source]#
class ROS_Stack.jetracer_speedway_navigation.src.utils.utils.Point(x: int, y: int)[source]#

Bases: object

displace(x: int = 0, y: int = 0) Point[source]#

Function to displace “m” px and “n” px in (x, y)

Parameters:
  • x (int, optional) – Displacement in the x axi. Defaults to 0.

  • y (int, optional) – Displacement in the y axi. Defaults to 0.

Returns:

Return the self point displaced

Return type:

Point

is_right_than(other_point: Point) bool[source]#

Function to know is self point is in a more to the right position than other point

Parameters:

other_point (Point) – Other point to compare

Returns:

Return True or False if self point is more to the right than other point

Return type:

bool

middle_2_point(other_point: Point) Point[source]#

Function to take the middle point between self point and other point

Parameters:

other_point (Point) – The other point

Returns:

Return the new point that is between the middle of both points

Return type:

Point

zero() bool[source]#

Function to check if 0,0 point

Returns:

Return True if 0,0 point and False in the other cases

Return type:

bool

class ROS_Stack.jetracer_speedway_navigation.src.utils.object_process.ObjectProcessing[source]#

Bases: object

Class to extract the goal point in the image Errors:

  • 1: No detection

  • 2: Other error

process(result: list) dict[source]#
run(result: list) dict[source]#