10.9.6.3.2. Camera Control

10.9.6.3.2.1. Overview

ORC provides randomization for the cameras. By default, the cameras will be spawned and point to the origin of the world system. However, we also provide an option to spawn the cameras that will look at the characters in the scene. Additionally, ORC has a camera calibration extension that provides camera information for cameras generated by ORC.

10.9.6.3.2.2. Aim Camera to Character

10.9.6.3.2.2.1. Introduction

This feature aims to automate the camera layout adjustment progress. Before clicking “Set up Simulation” button, users could adjust cameras’ height, view angle and distance toward characters via adjusting several carb.settings values.

10.9.6.3.2.2.2. Activate the feature

  1. To Activate the feature, we need to set setting value aim_camera_to_character to True

  2. Configure the variables

10.9.6.3.2.2.3. Attributes

Illustration for the attributes:

an illustration for what each attribute represent for the camera settings
  • Max Camera Height

    • Usage: Camera’s max height value (translation’s z axis value) range

    • Default Value: 3

  • Min Camera Height

    • Usage: Camera’s min height value (translation’s z axis value) range

    • Default Value: 2

  • Camera Focus Height

    • Usage: This attribute determines where the camera should look at. The camera’s focus point should be : “Camera Focus Height” value above character’s root position -

    • Default Value 0.7

  • Camera Max Look Down Angle

    • The Max angle between camera and the ground

    • Default Value: 60

  • Camera Min Look Down Angle

    • The Max angle between camera and the ground

    • Default Value: 60

  • Camera Min Look Down Angle

    • The Min angle between camera and the ground

    • Default Value: 0

Note

Camera Height should be higher than character focus height.

an illustration for how to set the camera

10.9.6.3.2.2.4. Special Cases

  • What if the Max Camera Height = Min Camera Height = x?

    • The program would generate camera at Height x

  • What if the Max Camera Look Down Angle = Min Camera Look Down Angle = y ?

    • The program would generate all camera with Camera Look Down Angle = y

  • What if there is no possible position to generate the camera?

    • The default camera generation function would be triggered. All the cameras would be focus on map’s origin point (0, 0, 0)

  • What if we also need to generate Lidar Cameras?

    • The Lidar Camera would be automatically matched with Camera with the same index. For instance, when creating Lidar_01, we would check whether the Camera_01 is inside the scene. If so the Lidar_01 would share the same transform as the Camera_01.

10.9.6.3.2.2.5. Extra Config Values

max_camera_distance and min_camera_distance are used to set camera’s max and min distance toward the character

  • Max Camera Distance’s default value is 14

  • Min Camera Distance’s default value is 6.5

an illustration for the extra camera config values

Note

Max camera height should be lower than max camera distance.

10.9.6.3.2.2.6. How to Adjust Random Camera Setting Variables

  • To adjust those Config Value, User need to change following carb setting variables;

  • Example script that can be run in the Window-> Script Editor

    import carb
    
    # activate the feature by setting aim_camera_to_character to true
    my_setting = carb.settings.get_settings()
    target_value = True
    aim_camera_to_character = "persistent/exts/omni.replicator.character/aim_camera_to_character"
    my_setting.set(aim_camera_to_character, target_value)
    
    # please set your target value in here
    target_max_camera_height = 3
    target_min_camera_height = 2
    target_character_focus_height = 0.7
    target_max_camera_look_down_angle = 60
    target_min_camera_look_down_angle = 0
    target_max_camera_distance = 14
    target_min_camera_distance = 6.5
    
    
    # set min camera height to "target min camera height"
    min_camera_height = "/persistent/exts/omni.replicator.character/min_camera_height"
    my_setting.set(min_camera_height , target_min_camera_height)
    setted_min_camera_height = my_setting.get(min_camera_height)
    carb.log_warn("This is the setted min height" + str(setted_min_camera_height))
    
    
    # set max camera height to "target max camra height"
    max_camera_height = "/persistent/exts/omni.replicator.character/max_camera_height"
    my_setting.set(max_camera_height , target_max_camera_height)
    setted_max_camera_height = my_setting.get(max_camera_height)
    carb.log_warn("This is the setted max height" + str(setted_max_camera_height))
    
    # set camera focus height to "target camera focus height"
    character_focus_height = "/persistent/exts/omni.replicator.character/character_focus_height"
    my_setting.set(character_focus_height, target_character_focus_height)
    setted_character_focus_height = my_setting.get(character_focus_height)
    carb.log_warn("This is the setted focus character height" + str(setted_character_focus_height))
    
    # set max camera look down angle to " taget max camera look down angle"
    max_camera_look_down_angle = "/persistent/exts/omni.replicator.character/max_camera_look_down_angle"
    my_setting.set(max_camera_look_down_angle, target_max_camera_look_down_angle)
    setted_max_camera_look_down_angle = my_setting.get(max_camera_look_down_angle)
    carb.log_warn("This is the setted max camera look down" + str(setted_max_camera_look_down_angle))
    
    # set min camera look down angle to " target min camera look down angle"
    min_camera_look_down_angle = "/persistent/exts/omni.replicator.character/min_camera_look_down_angle"
    my_setting.set(min_camera_look_down_angle, target_min_camera_look_down_angle)
    setted_min_camera_look_down_angle = my_setting.get(min_camera_look_down_angle)
    carb.log_warn("This is the setted min camera look down" + str(setted_min_camera_look_down_angle))
    
    
    # set max camera distance to " target max camera distance"
    max_camera_distance = "persistent/exts/omni.replicator.character/max_camera_distance"
    my_setting.set(max_camera_distance, target_max_camera_distance)
    setted_max_camera_distance = my_setting.get(max_camera_distance)
    carb.log_warn("This is the setted min camera distance" + str(setted_max_camera_distance))
    
    # set min camera distance to " target min camera distance"
    min_camera_distance = "persistent/exts/omni.replicator.character/min_camera_distance"
    my_setting.set(min_camera_distance, target_min_camera_distance)
    setted_min_camera_distance = my_setting.get(min_camera_distance)
    carb.log_warn("This is the setted min camera distance" + str(setted_min_camera_distance))
    

10.9.6.3.2.3. Camera Calibration

ORC includes an extension called Omni.Replicator.Character.Camera_calibration. The camera calibration tool provides camera information for cameras generated by ORC. It enables users to select a top-view camera within the stage to create the stage layout. Details such as camera direction, location, and FOV polygon information will also be captured and saved as a JSON file. For each camera generated by ORC, the FOV polygon will be visually represented in the stage layout.