simulation.src.simulation_groundtruth.src.label_camera package
Submodules
simulation.src.simulation_groundtruth.src.label_camera.bounding_box module
Classes:
|
Container for a visible object on the camera image. |
|
Visualizable bounding box with a label and color. |
- class BoundingBox(class_id: int, class_description: str, world_points: list[Point])[source]
Bases:
objectContainer for a visible object on the camera image.
Attributes:
Id of the object's class.
Readable description of the object's class.
Object's coordinates in the world.
Transformation from world to vehicle coordinates.
Transformation matrix from vehicle coordinates to camera pixels.
Shortest distance between the car and this object.
Minimum angle between the car's direction and the object.
Orientation between car and front of the object.
Methods:
set_tfs(vehicle_pixel_matrix)Update transformations.
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.
- 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
- 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:
objectVisualizable bounding box with a label and color.
Attributes:
Methods:
draw(img)Draw the bounding box into the given image.
- bounds: tuple[int, int, int, int]
- label: str
- color: tuple[int, int, int]
simulation.src.simulation_groundtruth.src.label_camera.label_speaker module
Classes:
|
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:
SpeakerSpeaker that allows to retrieve visible groundtruth objects and their position.
Methods:
listen(msg)Receive information about current observations and update internal values.
_extract_bounding_boxes(func)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_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:
Functions:
|
Console-script entry point for the label camera node. |
- class LabelCameraNode[source]
Bases:
NodeBaseMethods:
start()Called when activating the node.
stop()Called when deactivating or shutting down the node.
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.
- receive_groundtruth_update(msg: GroundtruthStatus)[source]
Receive GroundtruthStatus message.
- Parameters:
msg – New GroundtruthStatus message