{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from Go2Py.robot.interface.dds import GO2Real\n", "import time\n", "robot = GO2Real(mode='lowlevel')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import time\n", "for i in range(1000):\n", " q = np.zeros(12) \n", " dq = np.zeros(12)\n", " kp = np.zeros(12)\n", " kd = np.zeros(12)\n", " tau = np.zeros(12)\n", " tau[0] = -0.0\n", " robot.setCommands(q, dq, kp, kd, tau)\n", " time.sleep(0.01) " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import time\n", "dataset = []\n", "for i in range(10000):\n", " sample = robot.getJointStates()\n", " dataset.append(sample['q'])\n", " time.sleep(0.01)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from scipy.spatial.transform import Rotation" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Rotation.from_matrix(np.eye(3)).as_quat()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.18" } }, "nbformat": 4, "nbformat_minor": 4 }