simulation.src.gazebo_simulation.src.car_model.camera_specs module

Summary

Classes:

CameraSpecs

Camera specifications usually defined in kitcar-ros.

Reference

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: Dict[str, float] = <factory>, capture_format: str = 'L8', clip: Dict[str, float] = <factory>, output_size: Dict[str, float] = <factory>, update_rate: float = 60, image_topic: str = '/simulation/sensors/raw/camera', info_topic: str = '/simulation/sensors/camera/info')[source]

Bases: simulation.utils.basics.init_options.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.

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 = 'L8'
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

Rotation matrix of the camera.

Type

np.matrix

property t

Translation vector from vehicle to camera.

In camera coordinates.

Type

np.ndarray

property M

Matrix M.

Transformation matrix from vehicle coordinates to camera coordinates.

Type

np.matrix

property A

Matrix A.

Transformation matrix from camera coordinates to pixels.

Type

np.matrix

property P

Matrix P.

Transformation matrix from vehicle coordinates to pixels.

Type

np.matrix

property t_vehicle

Translation vector to the camera in vehicle coordinates.

Type

np.ndarray

property xyz

Translation vector to the camera in vehicle coordinates.

Type

Vector

property rpy

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

Type

Vector

property horizontal_fov
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.