Skip to content

Commit

Permalink
Additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanElsner committed Nov 25, 2023
1 parent 6bd75d5 commit 1b469cd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/test_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ def test_custom_gripper():
sensors=[
robotiq_gripper_sensor.RobotiqGripperSensor(gripper, 'robotique')
])
arm.build_robot(parameters.RobotParams(gripper=gripper_params))
arm.build_robot(parameters.RobotParams(gripper=gripper_params,
has_hand=False))
20 changes: 19 additions & 1 deletion test/test_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
import numpy as np
import pytest
from dm_control import mjcf
from dm_robotics.moma.sensors import joint_observations, wrench_observations
from dm_robotics.moma.effectors import default_gripper_effector
from dm_robotics.moma.models.end_effectors.robot_hands import robotiq_2f85
from dm_robotics.moma.sensors import (joint_observations,
robotiq_gripper_sensor,
wrench_observations)

from dm_robotics.panda import arm, hardware, parameters

Expand Down Expand Up @@ -63,3 +67,17 @@ def test_wrench_sensor(mock_hardware):
wrench_observations.Observations.FORCE)](physics)
sensor.observables[sensor.get_obs_key(
wrench_observations.Observations.TORQUE)](physics)


def test_custom_gripper():
with patch('panda_py.Panda') as mock_panda:
gripper = robotiq_2f85.Robotiq2F85()
gripper_params = parameters.GripperParams(
model=gripper,
effector=default_gripper_effector.DefaultGripperEffector(
gripper, 'robotique'),
sensors=[
robotiq_gripper_sensor.RobotiqGripperSensor(gripper, 'robotique')
])
hardware.build_robot(
parameters.RobotParams(gripper=gripper_params, has_hand=False))

0 comments on commit 1b469cd

Please sign in to comment.