Skip to content

Commit a56ff95

Browse files
author
Murilo M. Marinho
committed
[adaptive_control] Snippets with executable code.
1 parent be65f03 commit a56ff95

2 files changed

Lines changed: 46 additions & 15 deletions

File tree

working/adaptive_control.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ kernelspec:
55
display_name: python3
66
---
77

8-
# Installing
8+
# Adaptive Control with Partial or Complete Task-Space Measurements
9+
10+
This is an example implementation of the adaptive controller described in ()[http://doi.org/10.1109/TRO.2022.3181047].
11+
12+
## Installation
913

1014
```{code-cell} ipython3
1115
%%capture
@@ -15,18 +19,45 @@ kernelspec:
1519
%pip install marinholab-papers-tro2022-adaptivecontrol --break-system-packages
1620
```
1721

18-
# Importing
22+
## Importing
1923

2024
```{attention}
2125
In a Jupyter notebook, you can wrap the import in a `try--except` block because the kernel does not always handle
2226
well the import from the dynamic library.
2327
```
2428

29+
```{attention}
30+
Currenlly, `dqrobotics` must be installed with the `--pre` flag.
31+
```
32+
2533
```{literalinclude} adaptive_control/example.py
2634
:start-after: # IMPORT START
2735
:end-before: # IMPORT END
2836
```
2937

30-
# Usage
38+
## Usage
39+
40+
### Kinematic Model
41+
42+
In this implementation we rely on the object called `Example_SerialManipulatorEDH`. This object
43+
inherits from `DQ_SerialManipulator`. By `EDH`, it was meant `E`xtended `DH`, from which the
44+
parametric Jacobians can also be obtained.
45+
46+
```{note}
47+
In future stable versions of `dqrobotics`, this could inherit from `DQ_SerialManipulatorDH`.
48+
```
49+
50+
```{literalinclude} adaptive_control/example.py
51+
:start-after: # ROBOT RAW KINEMATICS START
52+
:end-before: # ROBOT RAW KINEMATICS END
53+
```
54+
55+
```{literalinclude} adaptive_control/example.py
56+
:start-after: # MAIN START
57+
:end-before: # MAIN END
58+
```
3159

32-
##
60+
```{code-cell} ipython3
61+
from adaptive_control.example import main
62+
main()
63+
```

working/adaptive_control/example.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ def vs050_raw_kinematics() -> Example_SerialManipulatorEDH:
5252
return robot
5353
# ROBOT RAW KINEMATICS END
5454

55-
# MAIN START
56-
setup_plot()
55+
def main():
56+
# MAIN START
57+
setup_plot()
5758

58-
estimated_robot = vs050_raw_kinematics()
59-
q_init = np.array([0, pi/4, pi/2, 0, pi/4, 0])
59+
estimated_robot = vs050_raw_kinematics()
60+
q_init = np.array([0, pi/4, pi/2, 0, pi/4, 0])
6061

61-
dqp.plot(estimated_robot,
62-
q=q_init,
63-
line_color='r',
64-
cylinder_color="r",
65-
cylinder_alpha=0.3)
66-
plt.show(block=True)
67-
# MAIN END
62+
dqp.plot(estimated_robot,
63+
q=q_init,
64+
line_color='r',
65+
cylinder_color="r",
66+
cylinder_alpha=0.3)
67+
# MAIN END

0 commit comments

Comments
 (0)