Skip to content

Commit a85d20d

Browse files
authored
Remove the 'work' directory (not needed) and change to a linux available font (#485)
1 parent 531cd5a commit a85d20d

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

book/intro/exercises/03_physics_simulation_and_robots.ipynb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -847,18 +847,17 @@
847847
},
848848
"outputs": [],
849849
"source": [
850-
"# The `work` directory in Deepnote contains all the files you see under the `Files`\n",
851-
"# tab on the left (this is just a Deepnote specific thing). We will store the generated\n",
852-
"# files in the `assets/` folder in the `Files` menu on the left!\n",
853-
"output_dir = Path(\"work/assets/\")\n",
850+
"# Let us save our files to a new folder called `assets` in the `Files`\n",
851+
"# section on the left\n",
852+
"output_dir = Path(\"assets/\")\n",
854853
"\n",
855854
"# TODO: Insert your initials here!\n",
856855
"your_initials = \"BPG\"\n",
857856
"\n",
858857
"for letter in your_initials:\n",
859858
" create_sdf_asset_from_letter(\n",
860859
" text=letter,\n",
861-
" font_name=\"Arial\",\n",
860+
" font_name=\"DejaVu Sans\",\n",
862861
" letter_height_meters=0.2,\n",
863862
" extrusion_depth_meters=0.07,\n",
864863
" output_dir=output_dir / f\"{letter}_model\",\n",
@@ -935,7 +934,7 @@
935934
"letter_to_visualize = \"P\" # One at a time!\n",
936935
"\n",
937936
"# This is the path to the SDF file for the letter\n",
938-
"letter_path = f\"work/assets/{letter_to_visualize}_model/{letter_to_visualize}.sdf\"\n",
937+
"letter_path = f\"assets/{letter_to_visualize}_model/{letter_to_visualize}.sdf\"\n",
939938
"\n",
940939
"# TODO: Define a ModelVisualizer instance\n",
941940
"# HINT: You know how to do this by now!\n",
@@ -1025,7 +1024,7 @@
10251024
" # method as the third argument!\n",
10261025
"\n",
10271026
" # TODO: Load the letters in your initials\n",
1028-
" # HINT: Remember to use 'work/assets/...' to access the letters, as we did above!\n",
1027+
" # HINT: Remember to use 'assets/...' to access the letters, as we did above!\n",
10291028
"\n",
10301029
" # TODO: Add a visualizer to the builder\n",
10311030
"\n",
@@ -1050,7 +1049,7 @@
10501049
" # (Important: notice that we first load the letter, then finalize the plant, and then set the pose)\n",
10511050
" #\n",
10521051
" # ```\n",
1053-
" # B_letter = parser.AddModels(f\"work/assets/B_model/B.sdf\")[0]\n",
1052+
" # B_letter = parser.AddModels(f\"assets/B_model/B.sdf\")[0]\n",
10541053
" # ...\n",
10551054
" # plant.Finalize()\n",
10561055
" # ...\n",

book/intro/exercises/04_hardwarestation_and_scenarios.ipynb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -402,18 +402,17 @@
402402
"metadata": {},
403403
"outputs": [],
404404
"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",
409408
"\n",
410409
"# TODO: Insert your initials here!\n",
411410
"your_initials = \"BPG\"\n",
412411
"\n",
413412
"for letter in your_initials:\n",
414413
" create_sdf_asset_from_letter(\n",
415414
" text=letter,\n",
416-
" font_name=\"Arial\",\n",
415+
" font_name=\"DejaVu Sans\",\n",
417416
" letter_height_meters=0.2,\n",
418417
" extrusion_depth_meters=0.07,\n",
419418
" output_dir=output_dir / f\"{letter}_model\",\n",
@@ -448,7 +447,7 @@
448447
"\"\"\"\n",
449448
"\n",
450449
"# 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",
452451
"with open(table_sdf_path, \"w\") as f:\n",
453452
" f.write(table_sdf)"
454453
]
@@ -463,8 +462,8 @@
463462
"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",
464463
"- `file://absolute/path/to/your/file.sdf`\n",
465464
"\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",
468467
"\n",
469468
"**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",
470469
"\n",
@@ -490,7 +489,7 @@
490489
"```\n",
491490
"- add_model:\n",
492491
" 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",
494493
" default_free_body_pose:\n",
495494
" B_body_link:\n",
496495
" translation: [0, 1.0, 0.75]\n",

0 commit comments

Comments
 (0)