Skip to content

Commit d2ca574

Browse files
author
Murilo M. Marinho
committed
[lesson5] Replacing ?? with help() for the proper html to show, but source is no longer shown.
1 parent d95c3ca commit d2ca574

1 file changed

Lines changed: 143 additions & 40 deletions

File tree

dqrobotics/lesson5/lesson_dq5_robot_control_basics_part1.ipynb

Lines changed: 143 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": null,
5+
"execution_count": 61,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -40,7 +40,7 @@
4040
},
4141
{
4242
"cell_type": "code",
43-
"execution_count": null,
43+
"execution_count": 62,
4444
"metadata": {},
4545
"outputs": [],
4646
"source": [
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"cell_type": "code",
54-
"execution_count": null,
54+
"execution_count": 63,
5555
"metadata": {},
5656
"outputs": [],
5757
"source": [
@@ -156,17 +156,29 @@
156156
},
157157
{
158158
"cell_type": "code",
159-
"execution_count": null,
160-
"metadata": {},
161-
"outputs": [],
159+
"execution_count": 64,
160+
"metadata": {},
161+
"outputs": [
162+
{
163+
"name": "stdout",
164+
"output_type": "stream",
165+
"text": [
166+
"Help on function __init__ in module one_dof_planar_robot:\n",
167+
"\n",
168+
"__init__(self, l1)\n",
169+
" Initialize self. See help(type(self)) for accurate signature.\n",
170+
"\n"
171+
]
172+
}
173+
],
162174
"source": [
163175
"from one_dof_planar_robot import OneDofPlanarRobot\n",
164-
"OneDofPlanarRobot.__init__??"
176+
"help(OneDofPlanarRobot.__init__)"
165177
]
166178
},
167179
{
168180
"cell_type": "code",
169-
"execution_count": null,
181+
"execution_count": 65,
170182
"metadata": {},
171183
"outputs": [],
172184
"source": [
@@ -182,7 +194,7 @@
182194
},
183195
{
184196
"cell_type": "code",
185-
"execution_count": null,
197+
"execution_count": 66,
186198
"metadata": {},
187199
"outputs": [],
188200
"source": [
@@ -271,20 +283,46 @@
271283
},
272284
{
273285
"cell_type": "code",
274-
"execution_count": null,
286+
"execution_count": 67,
275287
"metadata": {},
276-
"outputs": [],
288+
"outputs": [
289+
{
290+
"name": "stdout",
291+
"output_type": "stream",
292+
"text": [
293+
"Help on function ikm_tx in module one_dof_planar_robot:\n",
294+
"\n",
295+
"ikm_tx(self, tx)\n",
296+
" fkm calculates the IKM for the 1-DoF planar robot using the\n",
297+
" desired x-axis translation.\n",
298+
"\n"
299+
]
300+
}
301+
],
277302
"source": [
278-
"OneDofPlanarRobot.ikm_tx??"
303+
"help(OneDofPlanarRobot.ikm_tx)"
279304
]
280305
},
281306
{
282307
"cell_type": "code",
283-
"execution_count": null,
308+
"execution_count": 68,
284309
"metadata": {},
285-
"outputs": [],
310+
"outputs": [
311+
{
312+
"name": "stdout",
313+
"output_type": "stream",
314+
"text": [
315+
"Help on function ikm_ty in module one_dof_planar_robot:\n",
316+
"\n",
317+
"ikm_ty(self, ty)\n",
318+
" fkm calculates the IKM for the 1-DoF planar robot using the\n",
319+
" desired y-axis translation.\n",
320+
"\n"
321+
]
322+
}
323+
],
286324
"source": [
287-
"OneDofPlanarRobot.ikm_ty??"
325+
"help(OneDofPlanarRobot.ikm_ty)"
288326
]
289327
},
290328
{
@@ -297,7 +335,7 @@
297335
},
298336
{
299337
"cell_type": "code",
300-
"execution_count": null,
338+
"execution_count": 69,
301339
"metadata": {},
302340
"outputs": [],
303341
"source": [
@@ -332,7 +370,7 @@
332370
"outputs": [],
333371
"source": [
334372
"# Length\n",
335-
"l1 = 1;\n",
373+
"l1 = 1\n",
336374
"\n",
337375
"# Create robot\n",
338376
"one_dof_planar_robot = OneDofPlanarRobot(l1)\n",
@@ -395,16 +433,41 @@
395433
"cell_type": "code",
396434
"execution_count": null,
397435
"metadata": {},
398-
"outputs": [],
399-
"source": [
400-
"OneDofPlanarRobot.translation_jacobian??"
436+
"outputs": [
437+
{
438+
"name": "stdout",
439+
"output_type": "stream",
440+
"text": [
441+
"\u001b[0;31mSignature:\u001b[0m \u001b[0mOneDofPlanarRobot\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtranslation_jacobian\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtheta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
442+
"\u001b[0;31mSource:\u001b[0m \n",
443+
" \u001b[0;32mdef\u001b[0m \u001b[0mtranslation_jacobian\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mtheta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\n",
444+
"\u001b[0;34m\u001b[0m \u001b[0;34m''' Calculates the translation Jacobian of the 1-DoF planar\u001b[0m\n",
445+
"\u001b[0;34m robot. '''\u001b[0m\u001b[0;34m\u001b[0m\n",
446+
"\u001b[0;34m\u001b[0m \u001b[0;34m\u001b[0m\n",
447+
"\u001b[0;34m\u001b[0m \u001b[0mj\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0ml1_\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mi_\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0msin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtheta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mj_\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mcos\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtheta1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\n",
448+
"\u001b[0;34m\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mvec3\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
449+
"\u001b[0;31mFile:\u001b[0m ~/git/OpenExecutableBooksRobotics/dqrobotics/lesson5/one_dof_planar_robot.py\n",
450+
"\u001b[0;31mType:\u001b[0m function"
451+
]
452+
}
453+
],
454+
"source": [
455+
"help(OneDofPlanarRobot.translation_jacobian)"
401456
]
402457
},
403458
{
404459
"cell_type": "code",
405-
"execution_count": null,
406-
"metadata": {},
407-
"outputs": [],
460+
"execution_count": 72,
461+
"metadata": {},
462+
"outputs": [
463+
{
464+
"name": "stdout",
465+
"output_type": "stream",
466+
"text": [
467+
"Corresponding end effector velocity\n"
468+
]
469+
}
470+
],
408471
"source": [
409472
"# Length\n",
410473
"l1 = 1\n",
@@ -426,9 +489,17 @@
426489
},
427490
{
428491
"cell_type": "code",
429-
"execution_count": null,
430-
"metadata": {},
431-
"outputs": [],
492+
"execution_count": 73,
493+
"metadata": {},
494+
"outputs": [
495+
{
496+
"name": "stdout",
497+
"output_type": "stream",
498+
"text": [
499+
"t_dot = [-0.00302661 -0.35998728 -0. ]\n"
500+
]
501+
}
502+
],
432503
"source": [
433504
"t_dot = Jt*theta1_dot\n",
434505
"print(f\"t_dot = {t_dot}\")"
@@ -467,9 +538,17 @@
467538
},
468539
{
469540
"cell_type": "code",
470-
"execution_count": null,
471-
"metadata": {},
472-
"outputs": [],
541+
"execution_count": 74,
542+
"metadata": {},
543+
"outputs": [
544+
{
545+
"name": "stdout",
546+
"output_type": "stream",
547+
"text": [
548+
"t_dot = - 0.19i + 0.74j - 0.71k\n"
549+
]
550+
}
551+
],
473552
"source": [
474553
"# Length\n",
475554
"l1 = 1\n",
@@ -494,9 +573,17 @@
494573
},
495574
{
496575
"cell_type": "code",
497-
"execution_count": null,
576+
"execution_count": 75,
498577
"metadata": {},
499-
"outputs": [],
578+
"outputs": [
579+
{
580+
"name": "stdout",
581+
"output_type": "stream",
582+
"text": [
583+
"Corresponding joint velocity\n"
584+
]
585+
}
586+
],
500587
"source": [
501588
"\n",
502589
"# Get the translation jacobian, based on theta\n",
@@ -508,9 +595,17 @@
508595
},
509596
{
510597
"cell_type": "code",
511-
"execution_count": null,
512-
"metadata": {},
513-
"outputs": [],
598+
"execution_count": 76,
599+
"metadata": {},
600+
"outputs": [
601+
{
602+
"name": "stdout",
603+
"output_type": "stream",
604+
"text": [
605+
"theta_dot = [-0.62168767]\n"
606+
]
607+
}
608+
],
514609
"source": [
515610
"from dqrobotics.utils.DQ_LinearAlgebra import pinv\n",
516611
"\n",
@@ -554,9 +649,17 @@
554649
},
555650
{
556651
"cell_type": "code",
557-
"execution_count": null,
558-
"metadata": {},
559-
"outputs": [],
652+
"execution_count": 77,
653+
"metadata": {},
654+
"outputs": [
655+
{
656+
"name": "stdout",
657+
"output_type": "stream",
658+
"text": [
659+
"Running control loop for 251 iterations.\n"
660+
]
661+
}
662+
],
560663
"source": [
561664
"import numpy as np\n",
562665
"\n",
@@ -600,7 +703,7 @@
600703
},
601704
{
602705
"cell_type": "code",
603-
"execution_count": null,
706+
"execution_count": 78,
604707
"metadata": {},
605708
"outputs": [],
606709
"source": [
@@ -639,7 +742,7 @@
639742
},
640743
{
641744
"cell_type": "code",
642-
"execution_count": null,
745+
"execution_count": 79,
643746
"metadata": {},
644747
"outputs": [],
645748
"source": [
@@ -730,7 +833,7 @@
730833
},
731834
{
732835
"cell_type": "code",
733-
"execution_count": null,
836+
"execution_count": 80,
734837
"metadata": {},
735838
"outputs": [],
736839
"source": [

0 commit comments

Comments
 (0)