()
| 88 | |
| 89 | // Check if odometry is valid |
| 90 | const isValidOdometry = (): boolean => { |
| 91 | const pos = odometry?.pose?.pose?.position; |
| 92 | const orient = odometry?.pose?.pose?.orientation; |
| 93 | return ( |
| 94 | pos && orient && |
| 95 | typeof pos.x === 'number' && !isNaN(pos.x) && |
| 96 | typeof pos.y === 'number' && !isNaN(pos.y) && |
| 97 | typeof orient.x === 'number' && !isNaN(orient.x) && |
| 98 | typeof orient.y === 'number' && !isNaN(orient.y) && |
| 99 | typeof orient.z === 'number' && !isNaN(orient.z) && |
| 100 | typeof orient.w === 'number' && !isNaN(orient.w) |
| 101 | ); |
| 102 | }; |
| 103 | |
| 104 | // Calculate yaw angle from quaternion |
| 105 | const getYawFromQuaternion = (orientation: any): number => { |
no outgoing calls
no test coverage detected