How khlann/miaa_sim works
Main Components Identification
• Asset Repository: Represented by the “asset” folder, which holds 3D models, URDFs, descriptions, and pre-rendered parts for objects and multiple robot models. This acts as a resource library for simulation.
• Configuration Module: The “config” directory contains separate configuration files (e.g., camera_varant.py, object_varant.py, robot_varant.py) that parameterize and customize different simulation aspects.
• Simulation Core and Entry Point: The “main.py” acts as the central initiation script that ties together the simulation environment, assets, and robot instances.
• Robot Modules:
– The “robot” folder includes files like camera.py (for sensor simulation), controller.py (managing the simulation’s robot lifecycle), motion_planning.py (integrating the mplib’s planning logic), and visualization.py (for real-time rendering or UI aspects).
• External Libraries & Dependencies: These include the sapien library for simulation and mplib for motion planning as specified in the README.
Relationships and Data Flow
• The entry point in main.py will load configurations from the “config” files and initialize the simulation environment.
• The asset repository data (e.g., URDF files, textured models, and point samples) are used to construct the robot models and environmental objects within the simulation.
• The Controller (from robot/controller.py) integrates and manages different robot instances based on selected configurations (extracted from config/robot_varant.py, etc.). It serves as a mediator between higher-level commands and lower-level control logic.
• Motion planning logic (in robot/motion_planning.py) uses mplib to perform trajectory planning, translating user inputs (through two “demonstration” modes, move_to_pose and move_to_joints) into robot actuation commands.
Architectural Patterns & Design Principles
• Modular Design: The clear separation of asset management, configuration, simulation control, motion planning, and visualization reflects a modular design, making it easier to update or extend individual components.
• Separation of Concerns: By isolating configuration files from control logic and assets from simulation code, the project enhances maintainability.