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

Function sendStopCommands

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

Source from the content-addressed store, hash-verified

284
285 // Stop the robot with multiple commands to ensure full stop
286 const sendStopCommands = async () => {
287 for (let i = 0; i < 3; i++) {
288 publishVelocity({
289 linear: new Vector3({ x: 0, y: 0, z: 0 }),
290 angular: new Vector3({ x: 0, y: 0, z: 0 })
291 });
292 await new Promise(resolve => setTimeout(resolve, 50));
293 }
294
295 console.log('Move completed successfully:', {
296 finalDistance: distanceTraveled.toFixed(3),
297 targetDistance: distance,
298 error: (distance - distanceTraveled).toFixed(3),
299 elapsedTime
300 });
301
302 // Add delay to ensure robot fully stops before resolving
303 setTimeout(() => resolve(), 200); // Increased from 100ms
304 };
305
306 sendStopCommands();
307 } else if (maxTimeExceeded) {

Callers 2

executeMoveFunction · 0.85
executeTurnFunction · 0.85

Calls 2

publishVelocityFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected