Major Features Added: - KDL-based kinematics engine with world/local coordinate transformation - Complete GUI system with configuration management - Robot loader with URDF parsing and joint control - Enhanced environment system with transport object management - Main application entry point with dependency validation Technical Improvements: - World coordinate to robot base coordinate transformation in KDL - Real-time configuration updates through GUI - Comprehensive error handling and validation - Configuration-driven design throughout - Robot model scaling adjusted to 0.2x for proper visualization Files Added: - src/robot/kinematics.py: KDL forward/inverse kinematics with coordinate transforms - src/gui/: Complete GUI framework with main window and config management - main.py: Application entry point with environment validation - models/*.stl: Robot link mesh files for URDF visualization - tests/: Unit test framework for core components This commit establishes the complete foundation for robotic arm path planning and task execution development. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
88 lines
2.3 KiB
Python
88 lines
2.3 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Robotic Arm Feasibility Test System
|
|
|
|
Main entry point for the robotic arm simulation system.
|
|
This system tests the feasibility of robotic arm operations in complex environments,
|
|
specifically transporting objects through obstacles.
|
|
"""
|
|
|
|
import sys
|
|
import json
|
|
from pathlib import Path
|
|
|
|
# Add src directory to Python path
|
|
PROJECT_ROOT = Path(__file__).parent.absolute()
|
|
sys.path.insert(0, str(PROJECT_ROOT / 'src'))
|
|
|
|
from src.gui.main_window import MainWindow
|
|
|
|
# Configuration constants
|
|
CONFIG_FILE = "config.json"
|
|
REQUIRED_MODULES = ['pybullet', 'tkinter', 'numpy']
|
|
|
|
|
|
def check_dependencies():
|
|
"""Check if all required dependencies are installed"""
|
|
missing = []
|
|
|
|
for module in REQUIRED_MODULES:
|
|
try:
|
|
__import__(module)
|
|
except ImportError:
|
|
missing.append(module)
|
|
|
|
if not missing:
|
|
return True
|
|
|
|
print(f"Missing dependencies: {', '.join(missing)}")
|
|
print(f"Install with: pip install {' '.join(missing)}")
|
|
return False
|
|
|
|
|
|
def verify_environment():
|
|
"""Verify that the environment is properly configured"""
|
|
# Check configuration file
|
|
config_path = PROJECT_ROOT / CONFIG_FILE
|
|
if not config_path.exists():
|
|
print(f"Error: {CONFIG_FILE} not found")
|
|
return False
|
|
|
|
# Check robot model file
|
|
try:
|
|
with open(config_path, 'r', encoding='utf-8') as f:
|
|
config = json.load(f)
|
|
|
|
model_path = config.get('robot', {}).get('model_path', '')
|
|
if model_path and not Path(model_path).exists():
|
|
print(f"Warning: Robot model not found: {model_path}")
|
|
# Continue anyway - let the simulation handle missing model
|
|
except (json.JSONDecodeError, IOError) as e:
|
|
print(f"Error reading configuration: {e}")
|
|
return False
|
|
|
|
return True
|
|
|
|
|
|
def main():
|
|
"""Main entry point"""
|
|
# Verify dependencies and environment
|
|
if not check_dependencies():
|
|
sys.exit(1)
|
|
|
|
if not verify_environment():
|
|
sys.exit(1)
|
|
|
|
# Start application
|
|
try:
|
|
app = MainWindow()
|
|
app.run()
|
|
except KeyboardInterrupt:
|
|
pass # Clean exit on Ctrl+C
|
|
except Exception as e:
|
|
print(f"Fatal error: {e}")
|
|
sys.exit(1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main() |