docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CameraInfoGenerator

    Utility for constructing a CameraInfoMsg from a Unity Camera, computing the standard ROS camera intrinsic matrices.

    Inheritance
    object
    CameraInfoGenerator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.SimulationPro.Foundation
    Assembly: Unity.SimulationPro.Foundation.dll
    Syntax
    public static class CameraInfoGenerator

    Properties

    DistortionModel

    Gets the distortion model name used when generating CameraInfoMsg instances. Always returns "plumb_bob".

    Declaration
    public static string DistortionModel { get; }
    Property Value
    Type Description
    string

    Methods

    ConstructCameraInfoMessage(Camera, HeaderMsg, float, float)

    Using a Unity Camera and a provided HeaderMsg, generate a corresponding CameraInfoMsg. See http://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/CameraInfo.html for more information.

    Declaration
    public static CameraInfoMsg ConstructCameraInfoMessage(Camera unityCamera, HeaderMsg header, float horizontalCameraOffsetDistanceMeters = 0, float integerResolutionTolerance = 0.01)
    Parameters
    Type Name Description
    Camera unityCamera

    The camera used to generate the message.

    HeaderMsg header

    The header component of this message.

    float horizontalCameraOffsetDistanceMeters

    Meters. For use with stereo cameras, typically the offset of the right camera from the left.

    float integerResolutionTolerance

    The CameraInfoMsg stores resolution as a uint. However in Unity the pixelRect that represents the resolution is a Rect allowing for floating point precision resolution. This parameter will cause debug warnings if after converting a resolution to unsigned integers the difference between the new value and the original is greater than integerResolutionTolerance. If you want to bypass this warning, set the value to 1.0f.

    Returns
    Type Description
    CameraInfoMsg

    A CameraInfoMsg populated from the Unity camera's intrinsic parameters.

    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)