Skip to content

Commit 70c192f

Browse files
committed
fix link and deprecated pydrake.geometry.render
1 parent e874527 commit 70c192f

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

exercises/pick/rigid_transforms.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
]
5050
},
5151
{
52+
"attachments": {},
5253
"cell_type": "markdown",
5354
"metadata": {
5455
"colab_type": "text",
@@ -88,7 +89,7 @@
8889
"X_AB @ X_BC\n",
8990
"```\n",
9091
"\n",
91-
"You may also inverse a rigid transform by the [inverse](https://drake.mit.edu/pydrake/pydrake.math.html?highlight=rigidtransform#pydrake.math.RigidTransform_.RigidTransform_[float].inverse) method.\n",
92+
"You may also inverse a rigid transform by the [inverse](https://drake.mit.edu/pydrake/pydrake.math.html?highlight=rigidtransform#pydrake.math.RigidTransform.inverse) method.\n",
9293
"\n",
9394
"```python\n",
9495
"X_AB.inverse()\n",

exercises/robot/manipulation_station_io.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"In this exercise, you will explore the [ManipulationStation](http://manipulation.mit.edu/robot.html#manipulation_station) that was mentioned during the lecture. You should recall that the orange ports are the ones that do not exist for the actual hardware platform.\n",
4646
"\n",
4747
"<html>\n",
48-
"<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr align=\"center\"><td style=\"vertical-align:middle\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">iiwa_position→</td></tr><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">iiwa_feedforward_torque (optional)→</td></tr><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">wsg_position→</td></tr><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">wsg_force_limit (optional)→</td></tr></tbody></table></td><td align=\"center\" style=\"border:solid;padding-left:20px;padding-right:20px;vertical-align:middle\" bgcolor=\"#F0F0F0\"><a href=\"https://github.com/RussTedrake/manipulation/blob/ceb817b527cbf1826c5b9a573ffbef415cb0f013/manipulation/scenarios.py#L453\">ManipulationStation</a></td><td style=\"vertical-align:middle\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ iiwa_position_commanded</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ iiwa_position_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ iiwa_velocity_estimated</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ iiwa_state_estimated</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ iiwa_torque_commanded</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ iiwa_torque_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ iiwa_torque_external</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ wsg_state_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ wsg_force_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ camera_[NAME]_rgb_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ camera_[NAME]_depth_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ <b style=\"color:orange\">camera_[NAME]_label_image</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ ...</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ camera_[NAME]_rgb_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ camera_[NAME]_depth_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ <b style=\"color:orange\">camera_[NAME]_label_image</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ <b style=\"color:orange\">query_object</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ <b style=\"color:orange\">contact_results</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ <b style=\"color:orange\">plant_continuous_state</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">→ <b style=\"color:orange\">body_poses</b></td></tr></tbody></table></td></tr></tbody></table>\n",
48+
"<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr align=\"center\"><td style=\"vertical-align:middle\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">iiwa_position\u2192</td></tr><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">iiwa_feedforward_torque (optional)\u2192</td></tr><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">wsg_position\u2192</td></tr><tr><td align=\"right\" style=\"padding:5px 0px 5px 0px\">wsg_force_limit (optional)\u2192</td></tr></tbody></table></td><td align=\"center\" style=\"border:solid;padding-left:20px;padding-right:20px;vertical-align:middle\" bgcolor=\"#F0F0F0\"><a href=\"https://github.com/RussTedrake/manipulation/blob/ceb817b527cbf1826c5b9a573ffbef415cb0f013/manipulation/scenarios.py#L453\">ManipulationStation</a></td><td style=\"vertical-align:middle\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 iiwa_position_commanded</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 iiwa_position_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 iiwa_velocity_estimated</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 iiwa_state_estimated</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 iiwa_torque_commanded</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 iiwa_torque_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 iiwa_torque_external</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 wsg_state_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 wsg_force_measured</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 camera_[NAME]_rgb_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 camera_[NAME]_depth_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 <b style=\"color:orange\">camera_[NAME]_label_image</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 ...</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 camera_[NAME]_rgb_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 camera_[NAME]_depth_image</td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 <b style=\"color:orange\">camera_[NAME]_label_image</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 <b style=\"color:orange\">query_object</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 <b style=\"color:orange\">contact_results</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 <b style=\"color:orange\">plant_continuous_state</b></td></tr><tr><td align=\"left\" style=\"padding:5px 0px 5px 0px\">\u2192 <b style=\"color:orange\">body_poses</b></td></tr></tbody></table></td></tr></tbody></table>\n",
4949
"</html>\n",
5050
"\n",
5151
"Now we construct a ManipulationStation object and finalize the system setting. To get a sense of what this manipulation station looks like, you can open the meshcat viewer from the generated link as usual. There should be a bookshelf and a Kuka arm with a gripper attached (it might take a few seconds to load)."
@@ -83,7 +83,7 @@
8383
"id": "82VsgQ938k7v"
8484
},
8585
"source": [
86-
"[**Context**](https://drake.mit.edu/pydrake/pydrake.systems.framework.html?highlight=context#pydrake.systems.framework.Context_) is an abstract class template that represents all the typed values that are used in a System’s computations: time, numeric-valued input ports, numerical state, and numerical parameters. There are also type-erased abstract state variables, abstract-valued input ports, abstract parameters, and a double accuracy setting. It is important to note that a **Context** is designed to be used only with the System that created it. State and Parameter data can be copied between contexts for compatible systems as necessary. One of the most common mistakes is to pass the wrong context. Although most methods in drake should throw an error if you pass a context from the wrong system, but not all of them do yet. \n",
86+
"[**Context**](https://drake.mit.edu/pydrake/pydrake.systems.framework.html?highlight=context#pydrake.systems.framework.Context_) is an abstract class template that represents all the typed values that are used in a System\u2019s computations: time, numeric-valued input ports, numerical state, and numerical parameters. There are also type-erased abstract state variables, abstract-valued input ports, abstract parameters, and a double accuracy setting. It is important to note that a **Context** is designed to be used only with the System that created it. State and Parameter data can be copied between contexts for compatible systems as necessary. One of the most common mistakes is to pass the wrong context. Although most methods in drake should throw an error if you pass a context from the wrong system, but not all of them do yet. \n",
8787
"\n",
8888
"In the cell below, we first create a root context from the diagram, and then we retrieve the contexts of the subsystems from the root context."
8989
]

exercises/segmentation/label_generation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
},
290290
"source": [
291291
"# Analysis for Cluttered Scenes\n",
292-
"**Assume we have a scene with more than one object, i.e., we now have a Cheez-It box in the scene along with the mustard bottle. Let’s explore how our pipeline can work for generating object masks in these scenarios (suppose we can still easily crop the objects in the scene to a region about a flat empty surface). Answer the following questions.**\n",
292+
"**Assume we have a scene with more than one object, i.e., we now have a Cheez-It box in the scene along with the mustard bottle. Let\u2019s explore how our pipeline can work for generating object masks in these scenarios (suppose we can still easily crop the objects in the scene to a region about a flat empty surface). Answer the following questions.**\n",
293293
"\n",
294294
"**6.1.b** A direct and unmodified application of our pipeline above would use the full raw point cloud which includes both objects. Using this unmodified method, can you get the separate masks of the mustard bottle and Cheez-It box? Explain your reasoning.\n",
295295
"\n",

exercises/trajectories/rrt_planning.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,20 +490,20 @@
490490
"\n",
491491
" G.init(q_start)\n",
492492
" for k = 1 to max_interation:\n",
493-
" q_sample Generate Random Configuration\n",
494-
" random number random()\n",
493+
" q_sample \u2190 Generate Random Configuration\n",
494+
" random number \u2190 random()\n",
495495
" if random_number < prob_sample_goal:\n",
496-
" q_sample q_goal\n",
497-
" n_near Find the nearest node in the tree(q_sample)\n",
498-
" (q_1, q_2, ... q_N) Find intermediate q's from n_near to q_sample\n",
496+
" q_sample \u2190 q_goal\n",
497+
" n_near \u2190 Find the nearest node in the tree(q_sample)\n",
498+
" (q_1, q_2, ... q_N) \u2190 Find intermediate q's from n_near to q_sample\n",
499499
" \n",
500500
" // iteratively add the new nodes to the tree to form a new edge\n",
501-
" last_node n_near\n",
501+
" last_node \u2190 n_near\n",
502502
" for n = 1 to N:\n",
503-
" last_node Grow RRT tree (parent_node, q_{n}) \n",
503+
" last_node \u2190 Grow RRT tree (parent_node, q_{n}) \n",
504504
" \n",
505505
" if last node reaches the goal:\n",
506-
" path backup the path recursively\n",
506+
" path \u2190 backup the path recursively\n",
507507
" return path\n",
508508
" \n",
509509
" return None"

manipulation/utils.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
from urllib.request import urlretrieve
44

55
import numpy as np
6-
import pydrake.all
76
from IPython import get_ipython
7+
from pydrake.common import GetDrakePath
88
from pydrake.common.containers import namedview
9+
from pydrake.geometry import RenderLabel
910
from pydrake.multibody.tree import JointIndex
1011

1112
# Use a global variable here because some calls to IPython will actually case an
@@ -52,7 +53,7 @@ def LoadDataResource(filename):
5253

5354

5455
def ConfigureParser(parser):
55-
"""Add the manipulation/package.xml index to the given pydrake Parser."""
56+
"""Add the manipulation/package.xml index to the given Parser."""
5657
package_xml = os.path.join(os.path.dirname(__file__), "models/package.xml")
5758
parser.package_map().AddPackageXml(filename=package_xml)
5859
AddPackagePaths(parser)
@@ -64,28 +65,28 @@ def AddPackagePaths(parser):
6465
parser.package_map().Add(
6566
"manipulation_station",
6667
os.path.join(
67-
pydrake.common.GetDrakePath(),
68+
GetDrakePath(),
6869
"examples/manipulation_station/models",
6970
),
7071
)
7172
parser.package_map().Add(
7273
"ycb",
73-
os.path.join(pydrake.common.GetDrakePath(), "manipulation/models/ycb"),
74+
os.path.join(GetDrakePath(), "manipulation/models/ycb"),
7475
)
7576
parser.package_map().Add(
7677
"wsg_50_description",
7778
os.path.join(
78-
pydrake.common.GetDrakePath(),
79+
GetDrakePath(),
7980
"manipulation/models/wsg_50_description",
8081
),
8182
)
8283

8384

8485
reserved_labels = [
85-
pydrake.geometry.render.RenderLabel.kDoNotRender,
86-
pydrake.geometry.render.RenderLabel.kDontCare,
87-
pydrake.geometry.render.RenderLabel.kEmpty,
88-
pydrake.geometry.render.RenderLabel.kUnspecified,
86+
RenderLabel.kDoNotRender,
87+
RenderLabel.kDontCare,
88+
RenderLabel.kEmpty,
89+
RenderLabel.kUnspecified,
8990
]
9091

9192

0 commit comments

Comments
 (0)