docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CameraInfoMsg

    ROS sensor_msgs/CameraInfo message.

    Inheritance
    object
    CameraInfoMsg
    Implements
    IMessage
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.SimulationPro.Foundation.SensorMessages
    Assembly: Unity.SimulationPro.Foundation.dll
    Syntax
    [Serializable]
    public class CameraInfoMsg : IMessage

    Constructors

    CameraInfoMsg()

    Initializes a new instance with default values.

    Declaration
    public CameraInfoMsg()

    CameraInfoMsg(HeaderMsg, uint, uint, string, double[], double[], double[], double[], uint, uint, RegionOfInterestMsg)

    Initializes a new instance with default values.

    Declaration
    public CameraInfoMsg(HeaderMsg header, uint height, uint width, string distortion_model, double[] d, double[] k, double[] r, double[] p, uint binning_x, uint binning_y, RegionOfInterestMsg roi)
    Parameters
    Type Name Description
    HeaderMsg header

    ROS message header containing timestamp and coordinate frame identifier.

    uint height

    Image height in pixels.

    uint width

    Image width in pixels.

    string distortion_model

    Name of the lens distortion model (e.g. "plumb_bob").

    double[] d

    Scalar operand.

    double[] k

    Camera intrinsic matrix (3×3).

    double[] r

    Right-hand operand.

    double[] p

    A 3D point.

    uint binning_x

    Horizontal decimation factor (number of columns combined).

    uint binning_y

    Vertical decimation factor (number of rows combined).

    RegionOfInterestMsg roi

    Region of interest within the image.

    Fields

    binning_x

    3x4 row-major matrix ###################################################################### Operational Parameters # ###################################################################### These define the image region actually captured by the camera # driver. Although they affect the geometry of the output image, they # may be changed freely without recalibrating the camera. # ###################################################################### Binning refers here to any camera setting which combines rectangular neighborhoods of pixels into larger "super-pixels." It reduces the resolution of the output image to (width / binning_x) x (height / binning_y). The default values binning_x = binning_y = 0 is considered the same as binning_x = binning_y = 1 (no subsampling).

    Declaration
    public uint binning_x
    Field Value
    Type Description
    uint

    binning_y

    Binning y field.

    Declaration
    public uint binning_y
    Field Value
    Type Description
    uint

    d

    D field.

    Declaration
    public double[] d
    Field Value
    Type Description
    double[]

    distortion_model

    The distortion model used. Supported models are listed in sensor_msgs/distortion_models.hpp. For most cameras, "plumb_bob" - a simple model of radial and tangential distortion - is sufficent.

    Declaration
    public string distortion_model
    Field Value
    Type Description
    string

    header

    This message defines meta information for a camera. It should be in a camera namespace on topic "camera_info" and accompanied by up to five image topics named: image_raw - raw data from the camera driver, possibly Bayer encoded image - monochrome, distorted image_color - color, distorted image_rect - monochrome, rectified image_rect_color - color, rectified The image_pipeline contains packages (image_proc, stereo_image_proc) for producing the four processed image topics from image_raw and camera_info. The meaning of the camera parameters are described in detail at http://www.ros.org/wiki/image_pipeline/CameraInfo. The image_geometry package provides a user-friendly interface to common operations using this meta information. If you want to, e.g., project a 3d point into image coordinates, we strongly recommend using image_geometry. If the camera is uncalibrated, the matrices D, K, R, P should be left zeroed out. In particular, clients may assume that K[0] == 0.0 indicates an uncalibrated camera. ###################################################################### Image acquisition info # ###################################################################### Time of image acquisition, camera coordinate frame ID

    Declaration
    public HeaderMsg header
    Field Value
    Type Description
    HeaderMsg

    height

    Header timestamp should be acquisition time of image Header frame_id should be optical frame of camera origin of frame should be optical center of camera +x should point to the right in the image +y should point down in the image +z should point into the plane of the image ###################################################################### Calibration Parameters # ###################################################################### These are fixed during camera calibration. Their values will be the # same in all messages until the camera is recalibrated. Note that # self-calibrating systems may "recalibrate" frequently. #

    The internal parameters can be used to warp a raw (distorted) image # to: #

    1. An undistorted image (requires D and K) #
    2. A rectified image (requires D, K, R) # The projection matrix P projects 3D points into the rectified image.# ###################################################################### The image dimensions with which the camera was calibrated. Normally this will be the full camera resolution in pixels.
    Declaration
    public uint height
    Field Value
    Type Description
    uint

    k

    K field.

    Declaration
    public double[] k
    Field Value
    Type Description
    double[]

    k_MessageTypeId

    Identifier for this message type.

    Declaration
    public static readonly MessageTypeId k_MessageTypeId
    Field Value
    Type Description
    MessageTypeId

    k_MessageTypeName

    The ROS message type name string used for serialization and topic matching.

    Declaration
    public const string k_MessageTypeName = "sensor_msgs/CameraInfo"
    Field Value
    Type Description
    string

    p

    P field.

    Declaration
    public double[] p
    Field Value
    Type Description
    double[]

    r

    R field.

    Declaration
    public double[] r
    Field Value
    Type Description
    double[]

    roi

    Region of interest (subwindow of full camera resolution), given in full resolution (unbinned) image coordinates. A particular ROI always denotes the same window of pixels on the camera sensor, regardless of binning settings. The default setting of roi (all values 0) is considered the same as full resolution (roi.width = width, roi.height = height).

    Declaration
    public RegionOfInterestMsg roi
    Field Value
    Type Description
    RegionOfInterestMsg

    width

    Width field.

    Declaration
    public uint width
    Field Value
    Type Description
    uint

    Properties

    D

    D field.

    Declaration
    public double[] D { get; set; }
    Property Value
    Type Description
    double[]

    K

    K field.

    Declaration
    public double[] K { get; set; }
    Property Value
    Type Description
    double[]

    MessageTypeId

    Gets the unique runtime identifier for this message type.

    Declaration
    public MessageTypeId MessageTypeId { get; }
    Property Value
    Type Description
    MessageTypeId

    MessageTypeName

    Gets the ROS message type name for this message.

    Declaration
    public string MessageTypeName { get; }
    Property Value
    Type Description
    string

    P

    P field.

    Declaration
    public double[] P { get; set; }
    Property Value
    Type Description
    double[]

    R

    R field.

    Declaration
    public double[] R { get; set; }
    Property Value
    Type Description
    double[]

    Methods

    Deserialize(IMessageDeserializer)

    Deserializes a CameraInfoMsg from the given deserializer.

    Declaration
    public static CameraInfoMsg Deserialize(IMessageDeserializer deserializer)
    Parameters
    Type Name Description
    IMessageDeserializer deserializer

    The deserializer.

    Returns
    Type Description
    CameraInfoMsg

    A new CameraInfoMsg instance.

    Register()

    Registers this message type with the MessageTypeRegistry.

    Declaration
    [InitializeOnLoadMethod]
    public static void Register()

    ToString()

    Returns a human-readable string representation of this message.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of this instance.

    Overrides
    object.ToString()

    WriteTo(IMessageSerializer)

    Serializes this message to the given serializer.

    Declaration
    public void WriteTo(IMessageSerializer serializer)
    Parameters
    Type Name Description
    IMessageSerializer serializer

    The serializer.

    Implements

    IMessage

    Extension Methods

    MessageExtensions.GetPixelsInCameraSpace(CameraInfoMsg)
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)