Skip to content

Commit 53d1968

Browse files
author
卢杰
committed
fix: make ndarray return types explicit for CI mypy
1 parent 01114ac commit 53d1968

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/unilab/envs/locomotion/g1/joystick.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def sample_reset_base_qvel(rng, num_samples: int, limit: float) -> np.ndarray:
7777
def build_upper_body_pose_weights(pose_weights: list[float]) -> np.ndarray:
7878
weights = np.asarray(pose_weights, dtype=get_global_dtype()).copy()
7979
weights[:12] = 0.0
80-
return weights
80+
return np.asarray(weights, dtype=get_global_dtype())
8181

8282

8383
def compute_weighted_pose_penalty(diff: np.ndarray, weights: np.ndarray) -> np.ndarray:

‎src/unilab/envs/locomotion/g1/motion_tracking/math_utils.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def quat_conjugate(q: np.ndarray) -> np.ndarray:
5050
Conjugate quaternion(s) (N, 4) or (4,)
5151
"""
5252
if q.ndim == 1:
53-
return np.array([q[0], -q[1], -q[2], -q[3]])
53+
return np.asarray([q[0], -q[1], -q[2], -q[3]], dtype=q.dtype)
5454
else:
55-
result = q.copy()
55+
result = np.asarray(q.copy(), dtype=q.dtype)
5656
result[:, 1:] *= -1
5757
return result
5858

0 commit comments

Comments
 (0)