Convert the vehicle transform directly to forward speed
(self, transform=None, velocity=None)
| 226 | return am_ab > 0 and am_ab < ab_ab and am_ad > 0 and am_ad < ad_ad |
| 227 | |
| 228 | def _get_forward_speed(self, transform=None, velocity=None): |
| 229 | """ Convert the vehicle transform directly to forward speed """ |
| 230 | if not velocity: |
| 231 | velocity = self._vehicle.get_velocity() |
| 232 | if not transform: |
| 233 | transform = self._vehicle.get_transform() |
| 234 | |
| 235 | vel_np = np.array([velocity.x, velocity.y, velocity.z]) |
| 236 | pitch = np.deg2rad(transform.rotation.pitch) |
| 237 | yaw = np.deg2rad(transform.rotation.yaw) |
| 238 | orientation = np.array([np.cos(pitch) * np.cos(yaw), np.cos(pitch) * np.sin(yaw), np.sin(pitch)]) |
| 239 | speed = np.dot(vel_np, orientation) |
| 240 | return speed |
| 241 | |
| 242 | def _is_actor_affected_by_stop(self, actor, stop, multi_step=20): |
| 243 | """ |
no test coverage detected