-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move placo examples and test in a specific folder
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |