我目前正在为我的Finch机器人编写程序,该程序将使其在用户输入的特定时间内随机移动。当我运行代码时,Finch会向右移动更多。如何使它直线移动但步调随意?我已将代码附加在底部。
int max = 255;
int min = 100;
Random random = new Random();
int speed1 = random.nextInt(max + 1 - min) + min;
int speed2 = random.nextInt(max + 1 - min) + min;
System.out.print("Enter speficications(ms: ");
int timeToHold = sc.nextInt();
System.out.println("The Finch will now move to your
specifications.");
myFinch.setWheelVelocities(speed1, speed2, timeToHold);
myFinch.quit();
System.exit(0);