Skip to content

Commit 2d8abf1

Browse files
petercorkeclaude
andauthored
docs(notebooks): modernise branched-robot.ipynb for the current Robot API (#852)
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent af4de2c commit 2d8abf1

2 files changed

Lines changed: 42 additions & 8 deletions

File tree

‎.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,7 @@ CATKIN_IGNORE
195195
docs/lite/pypi/
196196
docs/lite/files/
197197
docs/lite/wasm_check/node_modules/
198+
199+
# files written by running docs/notebooks/branched-robot.ipynb
200+
docs/notebooks/*.dot
201+
docs/notebooks/*.svg

‎docs/notebooks/branched-robot.ipynb‎

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"<!-- RTB_HEADER -- generated from the notebook metadata (rtb_header) by sync_bootstrap.py, do not hand-edit -->\n",
8+
"<table>\n",
9+
" <tr>\n",
10+
" <td><div align=\"left\"><font size=\"30\">Robotics Toolbox for Python</font></div></td>\n",
11+
" <td><img src=\"figs/RobToolBox_RoundLogoB.png\" width=\"300\"></td>\n",
12+
" </tr>\n",
13+
"</table>\n",
14+
"\n",
15+
"<p></p>\n",
16+
"<div align=\"center\" style=\"font-size: 1.5em;\">A branched robot</div>\n",
17+
"<p></p>\n",
18+
"\n",
19+
"(c) Peter Corke 2026\n",
20+
"\n",
21+
"A robot with more than one end-effector: its forward kinematics and Jacobian for each branch, extracting the ETS of a branch, and drawing the robot as a graph. Drawing the graphs needs [Graphviz](https://graphviz.org) (the `dot` command) installed.\n",
22+
"\n",
23+
"> **Modernised 2026-10-19** to address API drift: this notebook was written for an earlier release of the Toolbox, and has been updated so that it runs with the current one."
24+
]
25+
},
326
{
427
"cell_type": "code",
528
"execution_count": null,
@@ -61,14 +84,14 @@
6184
"outputs": [],
6285
"source": [
6386
"import roboticstoolbox as rtb\n",
64-
"from IPython.core.display import SVG"
87+
"from IPython.display import SVG"
6588
]
6689
},
6790
{
6891
"cell_type": "markdown",
6992
"metadata": {},
7093
"source": [
71-
"We will load a model for a simple Y-shaped planar robot. Check out the source code to see how the model was constructed using `ELink` and `ERobot` classes."
94+
"We will load a model for a simple Y-shaped planar robot. Check out the source code to see how the model was constructed using `Link` and `Robot` classes."
7295
]
7396
},
7497
{
@@ -140,7 +163,7 @@
140163
"metadata": {},
141164
"outputs": [],
142165
"source": [
143-
"robot.fkine(robot.qz, endlink=\"eea\")"
166+
"robot.fkine(robot.qz, end=\"eea\")"
144167
]
145168
},
146169
{
@@ -156,7 +179,7 @@
156179
"metadata": {},
157180
"outputs": [],
158181
"source": [
159-
"robot.fkine(robot.qz, endlink=\"eeb\")"
182+
"robot.fkine(robot.qz, end=\"eeb\")"
160183
]
161184
},
162185
{
@@ -172,7 +195,7 @@
172195
"metadata": {},
173196
"outputs": [],
174197
"source": [
175-
"robot.jacob0(robot.qz, endlink=\"eea\")"
198+
"robot.jacob0(robot.qz, end=\"eea\")"
176199
]
177200
},
178201
{
@@ -196,7 +219,7 @@
196219
"cell_type": "markdown",
197220
"metadata": {},
198221
"source": [
199-
"and we could easily turn this into an unbranched robot represented by an `ERobot` instance"
222+
"and we could easily turn this into an unbranched robot represented by an `Robot` instance"
200223
]
201224
},
202225
{
@@ -205,15 +228,15 @@
205228
"metadata": {},
206229
"outputs": [],
207230
"source": [
208-
"r = rtb.ERobot(p, checkjindex=False)\n",
231+
"r = rtb.Robot(p, check_jindex=False)\n",
209232
"print(r)"
210233
]
211234
},
212235
{
213236
"cell_type": "markdown",
214237
"metadata": {},
215238
"source": [
216-
"This robot has 5 links but only 4 joint angles which are inherited from the original branched robot: `q0`, `q1`, `q4` and `q5`. If invoking its `fkine` method you must pass in a vector with at least 6 elements, but only 4 elements will be used.\n",
239+
"This robot has 5 links but only 4 joint angles which are inherited from the original branched robot: `q0`, `q1`, `q4` and `q5`. Its `fkine` method accepts either a vector of the four joint angles, in order, or a vector of six elements indexed by the original joint numbers, in which case `q2` and `q3` are ignored.\n",
217240
"\n",
218241
"We can also find the transformation between any two links in the robot. In this case, from one end effector to the other, from link eea to link eeb"
219242
]
@@ -359,6 +382,13 @@
359382
"_Feature"
360383
],
361384
"window_display": false
385+
},
386+
"rtb_header": {
387+
"title": "A branched robot",
388+
"paragraphs": [
389+
"A robot with more than one end-effector: its forward kinematics and Jacobian for each branch, extracting the ETS of a branch, and drawing the robot as a graph. Drawing the graphs needs [Graphviz](https://graphviz.org) (the `dot` command) installed."
390+
],
391+
"modernised": "2026-10-19"
362392
}
363393
},
364394
"nbformat": 4,

0 commit comments

Comments
 (0)