Rift-Console Reference¶
Ciarc.
image_helper
¶
Provides helping functions that are used in image_processing.
filter_by_date(images, start, end)
¶
Source code in src/rift_console/image_helper.py
42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
find_image_names(directory)
¶
Traverses the given directory and find + sorts all images in our filename format
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory
|
str
|
path to the folder, needs to include con.IMAGE_PATH |
required |
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: the name of all images in that folder, sorted by its timestamp from old to now |
Source code in src/rift_console/image_helper.py
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 |
|
generate_spiral_walk(n)
¶
Create an spiraling offset pattern arround a central point, e.g. (0,0), (0,1), (1,0), (1,1), ... sorted by Manhattan geometry
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
int
|
number of offsets to be generated |
required |
Returns:
Type | Description |
---|---|
list[tuple[int, int]]
|
list[tuple[int, int]]: list of offsets |
Source code in src/rift_console/image_helper.py
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 |
|
get_angle(image)
¶
Source code in src/rift_console/image_helper.py
16 17 18 19 20 21 22 23 24 |
|
get_date(image)
¶
Source code in src/rift_console/image_helper.py
27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
parse_image_name(name)
¶
Parses an image name in the format generated by Melvonaut and extract the relevant properties for stitching
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
file name of the image |
required |
Returns:
Type | Description |
---|---|
int
|
tuple[int, int, int]: Used lenssize (and therefore if the image should be scaled to this later) |
int
|
and approximated x/y coordinates on the stiched image |
Source code in src/rift_console/image_helper.py
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 |
|
image_processing
¶
automated_stitching(local_path)
¶
Stitches images from the given path into one big image, which is stored under the same name in con.PANORAMA_PATH.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
local_path
|
str
|
Path of a folder with images that should be stitched. |
required |
Source code in src/rift_console/image_processing.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
|
count_matching_pixels(offset, first_img, second_img, max_offset)
¶
Counts how many pixels are equal between the two images for a given offset
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offset
|
tuple[int, int]
|
shift of one image |
required |
img
|
Image
|
first image |
required |
existing_img
|
Image
|
second (larger to allow shift) image |
required |
Returns:
Type | Description |
---|---|
tuple[tuple[int, int], int]
|
tuple[int, int]: used offset and number of matching pixels |
Source code in src/rift_console/image_processing.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
create_thumbnail(panorama_path)
¶
Creates a scaled down panorama and a greyscale one from a given panorama and saves it to src/rift_console/static/images/thumb.png
from where it can be used by html.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
panorama_path
|
str
|
Name of the file (should include con.PANORAMA_PATH) |
required |
Source code in src/rift_console/image_processing.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
|
cut(panorama_path, X1, Y1, X2, Y2)
¶
Cut a small portion from a bigger Panorama.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
panorama_path
|
str
|
Name of the file (should include con.PANORAMA_PATH) |
required |
coordinates
|
Section that should be cut and saved |
required |
Source code in src/rift_console/image_processing.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
stitch_images(image_path, image_name_list, panorama=None)
¶
Main stitching algorithm TODO add existing img
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_path
|
str
|
description |
required |
images
|
list[str]
|
description |
required |
Returns:
Type | Description |
---|---|
Image
|
Image.Image: description |
Source code in src/rift_console/image_processing.py
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 |
|
upload(id, path, folder=False)
¶
Uploads one objective image"
Source code in src/rift_console/image_processing.py
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
|
melvin_api
¶
port = '8080'
module-attribute
¶
url = 'localhost'
module-attribute
¶
MelvonautTelemetry
¶
Bases: BaseModel
Datapoint of Disk, Memory and CPU utilization.
Source code in src/rift_console/melvin_api.py
57 58 59 60 61 62 63 64 65 66 |
|
clear_events()
¶
Clear event log.
Source code in src/rift_console/melvin_api.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
clear_images()
¶
Deletes exisiting images on Melvonaut.
Source code in src/rift_console/melvin_api.py
302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
|
clear_logs()
¶
Deletes logs on Melvonaut.
Source code in src/rift_console/melvin_api.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
|
clear_telemetry()
¶
Delete exisiting telemtry files on Melvonaut.
Source code in src/rift_console/melvin_api.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
create_tunnel()
¶
Not completed function to automatically create an ssh tunnel with port forwarding, alternative use 'shpass -f .ssh-pw ssh -N -L 8080:localhost:8080 root@10.100.50.1'
Source code in src/rift_console/melvin_api.py
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
download_events()
¶
Download event log.
Source code in src/rift_console/melvin_api.py
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 |
|
download_telemetry()
¶
Download existing telemetry files on Melvonaut.
Source code in src/rift_console/melvin_api.py
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 |
|
get_download_save_image(image_name)
¶
Download a single image from Melvonaut.
Source code in src/rift_console/melvin_api.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
|
get_download_save_log(log_name)
¶
Downloads all logs from Melvonaut.
Source code in src/rift_console/melvin_api.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
get_setting(setting)
¶
Get a Melvonaut Setting from settings.py.
Source code in src/rift_console/melvin_api.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
list_images()
¶
List all exising images on Melvonaut.
Source code in src/rift_console/melvin_api.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
|
list_logs()
¶
List all log fiels on Melvonaut.
Source code in src/rift_console/melvin_api.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
live_melvonaut()
¶
Get live MelvonautTelemetry.
Source code in src/rift_console/melvin_api.py
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 |
|
melvonaut_api(method, endpoint, json={})
¶
Wrapper with error handling for Melvonaut API.
Source code in src/rift_console/melvin_api.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
set_setting(setting, value)
¶
Set a Melvonaut Setting from settings.py.
Source code in src/rift_console/melvin_api.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
rift_console
¶
RiftConsole
¶
State of a currently running Console, including live data from CIARC/Melvonaut API.
Source code in src/rift_console/rift_console.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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 |
|
achievements = []
class-attribute
instance-attribute
¶
beacon_objectives = []
class-attribute
instance-attribute
¶
completed_ids = []
class-attribute
instance-attribute
¶
console_found_events = []
class-attribute
instance-attribute
¶
console_image_count = -1
class-attribute
instance-attribute
¶
console_image_dates = []
class-attribute
instance-attribute
¶
ebt_ping_list = []
class-attribute
instance-attribute
¶
future_traj = []
class-attribute
instance-attribute
¶
is_network_simulation = None
class-attribute
instance-attribute
¶
last_backup_date = None
class-attribute
instance-attribute
¶
live_melvonaut_api = None
class-attribute
instance-attribute
¶
live_telemetry = None
class-attribute
instance-attribute
¶
melvin_lens = ''
class-attribute
instance-attribute
¶
melvin_task = ''
class-attribute
instance-attribute
¶
melvonaut_image_count = -1
class-attribute
instance-attribute
¶
next_state = State.Unknown
class-attribute
instance-attribute
¶
past_traj = []
class-attribute
instance-attribute
¶
prev_state = State.Unknown
class-attribute
instance-attribute
¶
slots = []
class-attribute
instance-attribute
¶
slots_used = None
class-attribute
instance-attribute
¶
user_speed_multiplier = None
class-attribute
instance-attribute
¶
zoned_objectives = []
class-attribute
instance-attribute
¶
fix_overflow(x, y)
staticmethod
¶
Helper for trajektorie predition. Does "teleportation" when MELVIN reaches one side of the map.
Source code in src/rift_console/rift_console.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
get_draw_zoned_obj()
¶
Picks objectives to be drawn later from its telemetry.
Source code in src/rift_console/rift_console.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
predict_trajektorie()
¶
Calculate the points that melvin goes through next
Source code in src/rift_console/rift_console.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|