simulation.src.simulation_groundtruth.src.label_camera package

Submodules

simulation.src.simulation_groundtruth.src.label_camera.bounding_box module

Classes:

BoundingBox(class_id, class_description, ...)

Container for a visible object on the camera image.

VisualBoundingBox(bounds, label, color)

Visualizable bounding box with a label and color.

class BoundingBox(class_id: int, class_description: str, world_points: list[Point])[source]

Bases: object

Container for a visible object on the camera image.

Attributes:

class_id

Id of the object's class.

class_description

Readable description of the object's class.

world_points

Object's coordinates in the world.

world_vehicle_tf

Transformation from world to vehicle coordinates.

vehicle_pixel_matrix

Transformation matrix from vehicle coordinates to camera pixels.

vehicle_points

distance

Shortest distance between the car and this object.

angle

Minimum angle between the car's direction and the object.

orientation

Orientation between car and front of the object.

Methods:

set_tfs(vehicle_pixel_matrix)

Update transformations.

get_bounds()

Get the bounds of this box in the camera image.

to_msg()

Create a msg from this object.

class_id: int

Id of the object’s class.

class_description: str

Readable description of the object’s class.

world_points: list[Point]

Object’s coordinates in the world.

world_vehicle_tf = Transform(translation=Vector(0.0, 0.0, 0.0),rotation=Quaternion(np.float64(1.0), np.float64(0.0), np.float64(0.0), np.float64(0.0)))

Transformation from world to vehicle coordinates.

vehicle_pixel_matrix = array([[0., 0., 0.],        [0., 0., 0.]])

Transformation matrix from vehicle coordinates to camera pixels.

This is not a normal Transform, but a numpy matrix because it is not an affine transformation.

set_tfs(vehicle_pixel_matrix: matrix)[source]

Update transformations.

property vehicle_points: list[Vector]
get_bounds() tuple[int, int, int, int][source]

Get the bounds of this box in the camera image.

Returns:

x1, y1, x2, y2

to_msg() LabeledBoundingBox[source]

Create a msg from this object.

property distance

Shortest distance between the car and this object.

Type:

float

property angle

Minimum angle between the car’s direction and the object.

Type:

float

property orientation: float

Orientation between car and front of the object.

Type:

float

class VisualBoundingBox(bounds: tuple[int, int, int, int], label: str, color: tuple[int, int, int])[source]

Bases: object

Visualizable bounding box with a label and color.

Attributes:

bounds

label

color

Methods:

draw(img)

Draw the bounding box into the given image.

bounds: tuple[int, int, int, int]
label: str
color: tuple[int, int, int]
draw(img: ndarray)[source]

Draw the bounding box into the given image.

simulation.src.simulation_groundtruth.src.label_camera.label_speaker module

Classes:

LabelSpeaker(*, section_proxy, lane_proxy[, ...])

Speaker that allows to retrieve visible groundtruth objects and their position.

class LabelSpeaker(*, section_proxy: Callable[[], list[Section]], lane_proxy: Callable[[int], Lane], obstacle_proxy: Callable[[int], list[LabeledPolygon]] = None, surface_marking_proxy: Callable[[int], list[LabeledPolygon]] = None, intersection_proxy: Callable[[int], Any] = None, sign_proxy: Callable[[int], list[LabeledPolygon]] = None)[source]

Bases: Speaker

Speaker that allows to retrieve visible groundtruth objects and their position.

Methods:

listen(msg)

Receive information about current observations and update internal values.

_get_visible_sections()

_extract_bounding_boxes(func)

_get_visible_obstacles()

_get_visible_surface_markings()

_get_visible_signs()

speak(image_size, horizontal_fov)

Create and return all bounding boxes of currently visible objects.

listen(msg: CarState)[source]

Receive information about current observations and update internal values.

_get_visible_sections() list[Section][source]
_extract_bounding_boxes(func)[source]
_get_visible_obstacles() list[BoundingBox][source]
_get_visible_surface_markings() list[BoundingBox][source]
_get_visible_signs() list[BoundingBox][source]
speak(image_size: tuple[int, int], horizontal_fov: float) list[BoundingBox][source]

Create and return all bounding boxes of currently visible objects.

Parameters:
  • image_size – Total size of the image. Width and height.

  • horizontal_fov – Field of view of the camera in horizontal direction.

simulation.src.simulation_groundtruth.src.label_camera.node module

ROS node that connects multiple speakers to ROS topics.

Classes:

LabelCameraNode()

Functions:

main([args])

Console-script entry point for the label camera node.

class LabelCameraNode[source]

Bases: NodeBase

Methods:

start()

Called when activating the node.

stop()

Called when deactivating or shutting down the node.

receive_groundtruth_update(msg)

Receive GroundtruthStatus message.

receive_car_state(msg)

Receive CarState message and update transformations and label speaker.

receive_image(msg)

Receive new camera image and publish corresponding labels.

start()[source]

Called when activating the node.

stop()[source]

Called when deactivating or shutting down the node.

receive_groundtruth_update(msg: GroundtruthStatus)[source]

Receive GroundtruthStatus message.

Parameters:

msg – New GroundtruthStatus message

receive_car_state(msg: CarState)[source]

Receive CarState message and update transformations and label speaker.

receive_image(msg: Image)[source]

Receive new camera image and publish corresponding labels.

main(args=None)[source]

Console-script entry point for the label camera node.

Module contents