自主机器人模拟系统代码

import pygame
import math
import heapq
from collections import defaultdict
import random # Need random for stuck recovery rotation direction
import sys # For exiting the program
import csv # For data logging
import datetime # For timestamping log file

# --- Simulation Parameters ---
FPS = 60
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
GRID_SIZE = 20  # A* grid cell size in pixels

# --- Robot Parameters ---
ROBOT_RADIUS = 15
ROBOT_SPEED = 3 # Base forward speed for autonomous mode
ROBOT_ROT_SPEED = 4 # Base rotational speed for autonomous mode
# --- Manual Control Speeds ---
MANUAL_FORWARD_SPEED = 4.0
MANUAL_BACKWARD_SPEED = 2.0
MANUAL_ROT_SPEED = 5.0
# --- End Manual Control ---
SAFE_DISTANCE = ROBOT_RADIUS + 2

你可能感兴趣的:(人形机器人系统:理论与实践,机器人,python,windows)