Skip to content

Commit ca1b35d

Browse files
committed
Move placo examples and test in a specific folder
1 parent 4670626 commit ca1b35d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

src/example/placo/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Usage
2+
3+
For these examples, you will need [Placo](https://github.com/pollen-robotics/reachy_placo).
File renamed without changes.

src/example/show_graph_singularity.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
4+
5+
def make_graph() -> None:
6+
"""make a 3D graph of the shoulder pitch joint depending on the x and y position of the elbow on the shoulder frame"""
7+
x = np.linspace(-0.1, 0.1, 500)
8+
y = np.linspace(-0.1, 0.1, 500)
9+
x, y = np.meshgrid(x, y)
10+
z = -np.arctan2(y, x) % (2 * np.pi)
11+
fig = plt.figure()
12+
ax = fig.add_subplot(111, projection="3d")
13+
ax.plot_surface(x, y, z, cmap="viridis")
14+
ax.set_xlabel("X")
15+
ax.set_ylabel("Y")
16+
ax.set_zlabel("-atan2(y, x)")
17+
plt.show()
18+
19+
20+
def main_test() -> None:
21+
make_graph()
22+
23+
24+
if __name__ == "__main__":
25+
main_test()

0 commit comments

Comments
 (0)