:param theta1: angle 1 (..., 1) :param theta2: angle 2 (..., 1) :return diff: smallest angle difference between angles (..., 1)
(theta1, theta2)
| 672 | return x_all |
| 673 | |
| 674 | def angle_diff(theta1, theta2): |
| 675 | ''' |
| 676 | :param theta1: angle 1 (..., 1) |
| 677 | :param theta2: angle 2 (..., 1) |
| 678 | :return diff: smallest angle difference between angles (..., 1) |
| 679 | ''' |
| 680 | period = 2*np.pi |
| 681 | diff = (theta1 - theta2 + period / 2) % period - period / 2 |
| 682 | diff[diff > np.pi] = diff[diff > np.pi] - (2 * np.pi) |
| 683 | return diff |
| 684 | |
| 685 | def convert_state_to_state_and_action(traj_state, vel_init, dt, data_type='torch'): |
| 686 | ''' |
no outgoing calls
no test coverage detected