Camera Config¶
Camera configuration management.
Maps semantic camera names to hardware serial numbers, camera types, and roles.
Format::
{
"scene_1": {"serial": 37038161, "type": "zed", "role": "scene"},
"scene_2": {"serial": 55667788, "type": "zed", "role": "scene"},
"left_wrist": {"serial": "123456789012", "type": "realsense", "role": "left_wrist"},
"right_wrist": {"serial": 14932342, "type": "zed", "role": "right_wrist"}
}
Roles¶
"scene": fixed overhead / scene camera (multiple allowed)"left_wrist": wrist camera on the left arm (at most one)"right_wrist": wrist camera on the right arm (at most one)
Legacy format (ZED only, still fully supported)::
{
"scene_camera": 37038161,
"left_wrist_camera": 16522755
}
Integer values are assumed to be ZED cameras with no role assigned.
CameraConfig
¶
Manages camera configuration mapping semantic names to hardware info.
Source code in raiden/camera_config.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
add_camera(name, serial, camera_type='zed', role=None)
¶
Add or update a camera entry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique camera name (key in the config). |
required |
serial
|
Union[int, str]
|
Hardware serial number (int for ZED, str for RealSense). |
required |
camera_type
|
str
|
'zed' or 'realsense'. |
'zed'
|
role
|
Optional[str]
|
'scene', 'left_wrist', or 'right_wrist'. Optional but recommended. |
None
|
Source code in raiden/camera_config.py
create_camera(name)
¶
Create and return a Camera instance for the named camera.
Does NOT call open() – the caller is responsible for that.
Raises:
| Type | Description |
|---|---|
ValueError
|
if the name is not in the config or the type is unknown. |
Source code in raiden/camera_config.py
create_default_config()
¶
Suggest a default config based on detected ZED cameras.
Source code in raiden/camera_config.py
detect_cameras()
staticmethod
¶
Detect all connected ZED cameras and return their info.
Source code in raiden/camera_config.py
get_camera_by_role(role)
¶
Return the name of the unique camera with the given role, or None.
Use for 'left_wrist' and 'right_wrist' (at most one each). For 'scene' cameras use get_cameras_by_role().
Source code in raiden/camera_config.py
get_camera_type(name)
¶
Return 'zed' or 'realsense' for the named camera, or None if not found.
Source code in raiden/camera_config.py
get_cameras_by_role(role)
¶
Return names of all cameras with the given role (e.g. multiple 'scene' cameras).
Source code in raiden/camera_config.py
get_role(name)
¶
Return the role for a camera ('scene', 'left_wrist', 'right_wrist'), or None.
get_serial_by_name(name)
¶
Return the serial number for a camera name (int for ZED, str for RealSense).
Source code in raiden/camera_config.py
list_cameras()
¶
validate_against_hardware()
¶
Check which configured ZED cameras are currently connected.