ROS2 Camera Graph

File: ros2_camera.py
License: BSD-3-Clause. Copyright (c) 2023, Micah Nye. All rights reserved.

Classes:

ROS2CameraGraph

The class that implements the ROS2 Camera graph.

class pegasus.simulator.logic.graphs.ros2_camera_graph.ROS2CameraGraph

Bases: Graph

The class that implements the ROS2 Camera graph. This class inherits the base class Graph.

Methods:

__init__(camera_prim_path[, config])

Initialize the ROS2 Camera class

camera_labels_topic(camera_type)

(str) Path to the camera labels topic.

camera_topic(camera_type)

(str) Path to the camera topic.

initialize(vehicle)

Method that initializes the graph of the camera.

__init__(camera_prim_path, config={})

Initialize the ROS2 Camera class

Parameters:
  • camera_prim_path (str) – Path to the camera prim. Global path when it starts with /, else local to vehicle prim path

  • config (dict) – A Dictionary that contains all the parameters for configuring the ROS2CameraGraph - it can be empty or only have some of the parameters used by the ROS2CameraGraph.

Examples

The dictionary default parameters are

>>> {"graph_evaluator": "execution",            # type of the omnigraph to create (execution, push)
>>>  "resolution": [640, 480],                  # output video stream resolution in pixels [width, height]
>>>  "types": ['rgb', 'camera_info'],           # rgb, depth, depth_pcl, instance_segmentation, semantic_segmentation, bbox_2d_tight, bbox_2d_loose, bbox_3d, camera_info
>>>  "publish_labels": True,                    # publish labels for instance_segmentation, semantic_segmentation, bbox_2d_tight, bbox_2d_loose and bbox_3d camera types
>>>  "topic": ""                                # base topic name for the camera (default is camera name in Isaac Sim)
>>>  "namespace": ""                            # namespace for the camera (default is vehicle name in Isaac Sim)
>>>  "tf_frame_id": ""}                         # tf frame id for the camera (default is camera name in Isaac Sim)
camera_labels_topic(camera_type)

(str) Path to the camera labels topic.

Parameters:

camera_type (str) – one of the supported camera output types

Returns:

Camera labels topic name (str) if the camera type exists, else empty string

Return type:

str

camera_topic(camera_type)

(str) Path to the camera topic.

Parameters:

camera_type (str) – one of the supported camera output types

Returns:

Camera topic name (str) if the camera type exists, else empty string

Return type:

str

initialize(vehicle)

Method that initializes the graph of the camera.

Parameters:

vehicle (Vehicle) – The vehicle that this graph is attached to.