Skip to content

Commit

Permalink
Move placo examples and test in a specific folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Drenayaz committed Jan 16, 2025
1 parent 4670626 commit ca1b35d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/example/placo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Usage

For these examples, you will need [Placo](https://github.com/pollen-robotics/reachy_placo).
File renamed without changes.
25 changes: 25 additions & 0 deletions src/example/show_graph_singularity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import matplotlib.pyplot as plt
import numpy as np


def make_graph() -> None:
"""make a 3D graph of the shoulder pitch joint depending on the x and y position of the elbow on the shoulder frame"""
x = np.linspace(-0.1, 0.1, 500)
y = np.linspace(-0.1, 0.1, 500)
x, y = np.meshgrid(x, y)
z = -np.arctan2(y, x) % (2 * np.pi)
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(x, y, z, cmap="viridis")
ax.set_xlabel("X")
ax.set_ylabel("Y")
ax.set_zlabel("-atan2(y, x)")
plt.show()


def main_test() -> None:
make_graph()


if __name__ == "__main__":
main_test()

0 comments on commit ca1b35d

Please sign in to comment.