kitcar_utils.camera package

Submodules

kitcar_utils.camera.camera_specs module

Classes:

CameraSpecs(focal_length_x, focal_length_y, ...)

Camera specifications usually defined in kitcar-ros.

class CameraSpecs(focal_length_x: float, focal_length_y: float, optical_center_x: float, optical_center_y: float, r11: float, r12: float, r13: float, r21: float, r22: float, r23: float, r31: float, r32: float, r33: float, t1: float, t2: float, t3: float, capture_size: ~typing.Dict[str, float] = <factory>, capture_format: str = 'R8G8B8', clip: ~typing.Dict[str, float] = <factory>, output_size: ~typing.Dict[str, float] = <factory>, update_rate: float = 60, image_topic: str = '/simulation/sensors/raw/camera', info_topic: str = '/simulation/sensors/camera/info')[source]

Bases: InitOptions

Camera specifications usually defined in kitcar-ros.

With this class, the real calibration is used to create the simulated camera model.

This way the camera specifications and calibration are very similar. The calibrations are still not exactly the same and therefore a separate calibration file is loaded!

There are, however, some nuances:

  • Instead of considering the complete calibration matrix, only the pitch angle is used to rotate the camera model around the y axis in simulation.

  • The real camera crops the image before publishing the image. This is reflected in the different capture_size and output_size.

Attributes:

focal_length_x

focal_length_y

optical_center_x

optical_center_y

r11

r12

r13

r21

r22

r23

r31

r32

r33

t1

t2

t3

capture_size

capture_format

clip

output_size

update_rate

image_topic

info_topic

R

Rotation matrix of the camera.

t

Translation vector from vehicle to camera.

M

Matrix M.

A

Matrix A.

P

Matrix P.

H

Matrix H.

t_vehicle

Translation vector to the camera in vehicle coordinates.

xyz

Translation vector to the camera in vehicle coordinates.

rpy

Vector of roll, pitch, yaw angles of the camera's pose.

horizontal_fov

Methods:

simplify()

Create a simplified calibration from the real one.

save(file_path[, simplify, remove_clip, ...])

Save to file.

focal_length_x: float
focal_length_y: float
optical_center_x: float
optical_center_y: float
r11: float
r12: float
r13: float
r21: float
r22: float
r23: float
r31: float
r32: float
r33: float
t1: float
t2: float
t3: float
capture_size: Dict[str, float]
capture_format: str = 'R8G8B8'
clip: Dict[str, float]
output_size: Dict[str, float]
update_rate: float = 60
image_topic: str = '/simulation/sensors/raw/camera'
info_topic: str = '/simulation/sensors/camera/info'
property R: matrix

Rotation matrix of the camera.

Type:

np.matrix

property t: matrix

Translation vector from vehicle to camera.

In camera coordinates.

Type:

np.ndarray

property M: matrix

Matrix M.

Transformation matrix from vehicle coordinates to camera coordinates.

Type:

np.matrix

property A: matrix

Matrix A.

Transformation matrix from camera coordinates to pixels.

Type:

np.matrix

property P: matrix

Matrix P.

Transformation matrix from vehicle coordinates to pixels.

Type:

np.matrix

property H: matrix

Matrix H.

Transformation matrix from ground vehicle coordinates to pixels.

Type:

np.matrix

property t_vehicle: ndarray

Translation vector to the camera in vehicle coordinates.

Type:

np.ndarray

property xyz: Vector

Translation vector to the camera in vehicle coordinates.

Type:

Vector

property rpy: Vector

Vector of roll, pitch, yaw angles of the camera’s pose.

Type:

Vector

property horizontal_fov: float
simplify()[source]

Create a simplified calibration from the real one.

save(file_path: str, simplify=True, remove_clip=True, remove_sizes=True)[source]

Save to file.

Parameters:
  • file_path – Path to file.

  • simplify – Simplify the car specs before saving.

  • remove_clip – Don’t save clip.

  • remove_sizes – Don’t save capture and output_size.

Module contents