Skip to content

Commit

Permalink
Add tests for real robot
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed Dec 30, 2023
1 parent 0345e27 commit 8d087ce
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Empty file added tests/rcb4_tests/__init__.py
Empty file.
32 changes: 32 additions & 0 deletions tests/rcb4_tests/test_armh7interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import unittest
import time

import numpy as np

from rcb4.armh7interface import ARMH7Interface


class TestRobotModel(unittest.TestCase):

interface = None

@classmethod
def setUpClass(cls):
cls.interface = ARMH7Interface()
cls.interface.auto_open()
cls.interface.search_servo_ids()

def test_servo_angle_vector(self):
self.interface.hold()
self.interface.neutral()
self.interface.servo_angle_vector(
[32, 34],
[8000, 8000],
velocity=0)
time.sleep(4.0)
current_av = self.interface.angle_vector()
if np.any(np.abs(self.interface.angle_vector() - 16) > 2.0):
self.assertRaises()
self.interface.neutral()
time.sleep(4.0)
self.interface.free()

0 comments on commit 8d087ce

Please sign in to comment.