MCPcopy Create free account
hub / github.com/PJLab-ADG/OASim / normalize

Function normalize

limsim/evaluation/math_utils.py:34–46  ·  view source on GitHub ↗

normalize an angle such that the angle lies in [0, pi) Args: yaw (Union[float, np.ndarray]): angle in radians Returns: Union[float, np.ndarray]: angle in [0, pi)

(yaw: Union[float, np.ndarray])

Source from the content-addressed store, hash-verified

32
33
34def normalize(yaw: Union[float, np.ndarray]) -> Union[float, np.ndarray]:
35 """normalize an angle such that the angle lies in [0, pi)
36
37 Args:
38 yaw (Union[float, np.ndarray]): angle in radians
39
40 Returns:
41 Union[float, np.ndarray]: angle in [0, pi)
42 """
43 yaw = np.fmod(yaw, np.pi * 2) + np.pi * 2
44 yaw = np.fmod(yaw, np.pi)
45
46 return yaw

Callers 1

_evaluate_orientationMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected