|
402 | 402 | "metadata": {}, |
403 | 403 | "outputs": [], |
404 | 404 | "source": [ |
405 | | - "# The `work` directory in Deepnote contains all the files you see under the `Files`\n", |
406 | | - "# tab on the left (this is just a Deepnote specific thing).\n", |
407 | | - "# We will store the generated files in the `assets/` folder in the `Files` menu on the left!\n", |
408 | | - "output_dir = Path(\"work/assets/\")\n", |
| 405 | + "# Let us save our files to a new folder called `assets` in the `Files`\n", |
| 406 | + "# section on the left\n", |
| 407 | + "output_dir = Path(\"assets/\")\n", |
409 | 408 | "\n", |
410 | 409 | "# TODO: Insert your initials here!\n", |
411 | 410 | "your_initials = \"BPG\"\n", |
412 | 411 | "\n", |
413 | 412 | "for letter in your_initials:\n", |
414 | 413 | " create_sdf_asset_from_letter(\n", |
415 | 414 | " text=letter,\n", |
416 | | - " font_name=\"Arial\",\n", |
| 415 | + " font_name=\"DejaVu Sans\",\n", |
417 | 416 | " letter_height_meters=0.2,\n", |
418 | 417 | " extrusion_depth_meters=0.07,\n", |
419 | 418 | " output_dir=output_dir / f\"{letter}_model\",\n", |
|
448 | 447 | "\"\"\"\n", |
449 | 448 | "\n", |
450 | 449 | "# TODO: Write the table SDF to a file\n", |
451 | | - "table_sdf_path = \"work/assets/table.sdf\"\n", |
| 450 | + "table_sdf_path = \"assets/table.sdf\"\n", |
452 | 451 | "with open(table_sdf_path, \"w\") as f:\n", |
453 | 452 | " f.write(table_sdf)" |
454 | 453 | ] |
|
463 | 462 | "Great. Now we should be able to load our custom assets, similar to what we did before with the IIWA14 in the scenario directives. To access a local file in the scenario directives, use the following syntax:\n", |
464 | 463 | "- `file://absolute/path/to/your/file.sdf`\n", |
465 | 464 | "\n", |
466 | | - "For example, for the letter `B` in the (relative) folder `work/assets` one could use the following f-string:\n", |
467 | | - "- `f\"file://{Path.cwd()}/work/assets/B_model/B.sdf\"`\n", |
| 465 | + "For example, for the letter `B` in the (relative) folder `assets` one could use the following f-string:\n", |
| 466 | + "- `f\"file://{Path.cwd()}/assets/B_model/B.sdf\"`\n", |
468 | 467 | "\n", |
469 | 468 | "**NOTE**: The asset path must be absolute, which is why we call `Path.cwd()` to get the current working directory above! The asset path is also sensitive to spaces and indentation. If you're unable to load your assets, make sure there are no double spaces anywhere!\n", |
470 | 469 | "\n", |
|
490 | 489 | "```\n", |
491 | 490 | "- add_model:\n", |
492 | 491 | " name: B_letter\n", |
493 | | - " file: file://{Path.cwd()/work/assets/B_model.sdf}\n", |
| 492 | + " file: file://{Path.cwd()/assets/B_model.sdf}\n", |
494 | 493 | " default_free_body_pose:\n", |
495 | 494 | " B_body_link:\n", |
496 | 495 | " translation: [0, 1.0, 0.75]\n", |
|
0 commit comments