test: 补充关节状态发布夹具
This commit is contained in:
@@ -4,6 +4,7 @@ from types import SimpleNamespace
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from builtin_interfaces.msg import Time as TimeMsg
|
||||
|
||||
from xr_rm_teleop.realman_adapter import JointStateSnapshot
|
||||
from xr_rm_teleop.single_arm_velocity_teleop import (
|
||||
@@ -148,6 +149,9 @@ def test_invalid_controller_quaternion_stops_current_tick() -> None:
|
||||
del other
|
||||
return SimpleNamespace(nanoseconds=0)
|
||||
|
||||
def to_msg(self):
|
||||
return TimeMsg()
|
||||
|
||||
class FakeClock:
|
||||
def now(self):
|
||||
return FakeTime()
|
||||
@@ -174,7 +178,11 @@ def test_invalid_controller_quaternion_stops_current_tick() -> None:
|
||||
time.monotonic(),
|
||||
)
|
||||
)
|
||||
teleop._ik_solver = SimpleNamespace(update_joint_state=lambda joints: np.eye(4))
|
||||
teleop._ik_solver = SimpleNamespace(
|
||||
joint_names=[f"omnipic_joint_{index}" for index in range(1, 8)],
|
||||
update_joint_state=lambda joints: np.eye(4),
|
||||
)
|
||||
teleop._joint_state_pub = SimpleNamespace(publish=lambda message: None)
|
||||
teleop._active = False
|
||||
teleop._last_valid_joint_target = None
|
||||
teleop._last_current_pose = None
|
||||
|
||||
Reference in New Issue
Block a user