Browse Source

draft: add arctan to anfgle computation

remote-reachy2-improvements
haixuanTao 9 months ago
parent
commit
8f0fa67d39
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      examples/so100-remote/parse_keyboard.py

+ 10
- 3
examples/so100-remote/parse_keyboard.py View File

@@ -2,6 +2,7 @@

import time

import numpy as np
import pyarrow as pa
from dora import Node

@@ -10,13 +11,19 @@ node = Node()

now = time.time()

for j in range(100):
for j in range(0, 100):
for i in range(110):
time.sleep(0.033)
x = 0.0 + (j * 0.005)
y = -0.1 - (i * 0.001)
if x == 0:
theta = -1.8
else:
theta = np.arctan(y / x)

print("Sending action")
print("Sending action: ", x, y, theta)
node.send_output(
"action",
pa.array([0.0 + (j * 0.005), -0.1 - (i * 0.001), 0.18, -3.1, -1.8, 0.45]),
pa.array([0.0 + (j * 0.005), -0.1 - (i * 0.001), 0.18, -3.1, theta, 0.45]),
metadata={"encoding": "xyzrpy"},
)

Loading…
Cancel
Save