# Path: tests/core.py
# class TestCore(unittest.TestCase):
# 
#     def setUp(self):
#         self.pyrep = PyRep()
#         self.pyrep.launch(path.join(ASSET_DIR, 'test_scene.ttt'), headless=True)
#         self.pyrep.step()
#         self.pyrep.start()
# 
#     def tearDown(self):
#         self.pyrep.stop()
#         self.pyrep.step_ui()
#         self.pyrep.shutdown()
# 
# Path: pyrep/const.py
# class JointType(Enum):
#     REVOLUTE = sim.sim_joint_revolute_subtype
#     PRISMATIC = sim.sim_joint_prismatic_subtype
#     SPHERICAL = sim.sim_joint_spherical_subtype
# 
# Path: pyrep/robots/arms/panda.py
# class Panda(Arm):
# 
#     def __init__(self, count: int = 0):
#         super().__init__(count, 'Panda', 7)


import unittest
import numpy as np
from tests.core import TestCore
from pyrep.const import JointType
from pyrep.robots.arms.panda import Panda


# Pick one arm to test all of the joint group functionality.
# Simply checks for wiring mistakes between the joints.
class TestJointGroups(TestCore):

    def setUp(self):
        super().setUp()
        self.robot = Panda()
        self.num_joints = len(self.robot.joints)

    def test_get_joint_types(self):
        self.assertEqual(self.robot.get_joint_types(),
                         [JointType.REVOLUTE] * self.num_joints)

    def test_get_set_joint_positions(self):
        self.robot.set_joint_positions([0.1] * self.num_joints)
        self.assertEqual(len(self.robot.get_joint_positions()), self.num_joints)

    def test_get_set_joint_target_positions(self):
        self.robot.set_joint_target_positions([0.1] * self.num_joints)
        self.assertEqual(
            len(self.robot.get_joint_target_positions()), self.num_joints)

    def test_get_set_joint_target_velocities(self):
        self.robot.set_joint_target_velocities([0.1] * self.num_joints)
        self.assertEqual(
            len(self.robot.get_joint_target_velocities()), self.num_joints)


# Path: tests/core.py
# class TestCore(unittest.TestCase):
# 
#     def setUp(self):
#         self.pyrep = PyRep()
#         self.pyrep.launch(path.join(ASSET_DIR, 'test_scene.ttt'), headless=True)
#         self.pyrep.step()
#         self.pyrep.start()
# 
#     def tearDown(self):
#         self.pyrep.stop()
#         self.pyrep.step_ui()
#         self.pyrep.shutdown()
# 
# Path: pyrep/const.py
# class JointType(Enum):
#     REVOLUTE = sim.sim_joint_revolute_subtype
#     PRISMATIC = sim.sim_joint_prismatic_subtype
#     SPHERICAL = sim.sim_joint_spherical_subtype
# 
# Path: pyrep/robots/arms/panda.py
# class Panda(Arm):
# 
#     def __init__(self, count: int = 0):
#         super().__init__(count, 'Panda', 7)


# Path: tests/test_joint_groups.py
import unittest
import numpy as np
from tests.core import TestCore
from pyrep.const import JointType
from pyrep.robots.arms.panda import Panda



# Pick one arm to test all of the joint group functionality.
# Simply checks for wiring mistakes between the joints.
class TestJointGroups(TestCore):

    def setUp(self):
        super().setUp()
        self.robot = Panda()
        self.num_joints = len(self.robot.joints)

    def test_get_joint_types(self):
        self.assertEqual(self.robot.get_joint_types(),
                         [JointType.REVOLUTE] * self.num_joints)

    def test_get_set_joint_positions(self):
        self.robot.set_joint_positions([0.1] * self.num_joints)
        self.assertEqual(len(self.robot.get_joint_positions()), self.num_joints)

    def test_get_set_joint_target_positions(self):
        self.robot.set_joint_target_positions([0.1] * self.num_joints)
        self.assertEqual(
            len(self.robot.get_joint_target_positions()), self.num_joints)

    def test_get_set_joint_target_velocities(self):
        self.robot.set_joint_target_velocities([0.1] * self.num_joints)
        self.assertEqual(
            len(self.robot.get_joint_target_velocities()), self.num_joints)


    def test_get_set_joint_forces(self):