Commits

Trammell Hudson  committed 2a687d1

xyz commands work

  • Participants
  • Parent commits 63c4c85

Comments (0)

Files changed (1)

 robot_test(
 	robot_t * const robot,
 	double x,
-	double y
+	double y,
+	double z
 )
 {
 #if 0
 	robot_move(robot, 1, cmd_1, 1);
 	robot_ik_test(robot, r, 0);
 #endif
-	robot_ik_test(robot, x, y, 0);
+	robot_ik_test(robot, x, y, z);
 	return 0;
 }
 
 	const double y1 =  200;
 	const double y2 =  300;
 
-	robot_line(robot, x1, y1, x1, y2, 250, 50000);
-	robot_line(robot, x1, y2, x2, y2, 500, 50000);
-	robot_line(robot, x2, y2, x2, y1, 250, 50000);
-	robot_line(robot, x2, y1, x1, y1, 500, 50000);
+	robot_line(robot, x1, y1, x1, y2, 250/5, 50000);
+	robot_line(robot, x1, y2, x2, y2, 500/5, 50000);
+	robot_line(robot, x2, y2, x2, y1, 250/5, 50000);
+	robot_line(robot, x2, y1, x1, y1, 500/5, 50000);
 
 	printf("box done!\n");
 
 
 		int x = 0;
 		int y = 0;
+		int z = 0;
 		char cmd[32];
 
-		if (sscanf(line, "%16[^ ] %d %d", cmd, &x, &y) != 3)
+		int rc = sscanf(line, "%16[^ ] %d %d %d", cmd, &x, &y, &z);
+		if (rc != 3 && rc != 4)
 		{
 			printf("?\n");
 			continue;
 
 		if (strcmp(cmd, "r") == 0)
 		{
-			robot_test(robot, x, y);
+			robot_test(robot, x, y, 0);
+			continue;
+		}
+
+		if (strcmp(cmd, "x") == 0)
+		{
+			robot_test(robot, x, y, z);
 			continue;
 		}