MCPcopy Create free account
hub / github.com/botbotrobotics/BotBrain / isValidOdometry

Function isValidOdometry

frontend/src/hooks/useBlockProgramExecution.tsx:90–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 => {

Callers 2

executeMoveFunction · 0.85
executeTurnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected