Train autonomous agents in simulation. Export to C. Deploy on any microcontroller. No frameworks required.
BUILT FOR REAL-WORLD DEPLOYMENT
Define your platform in YAML. TernaryPhysics handles the physics, training, and export.
Quad, hexa, octo — full 6-DOF physics with thrust modeling
UAVs and airplanes with lift/drag aerodynamics
Differential drive with friction and terrain modeling
Multi-joint manipulators with forward kinematics
Describe your robot in a simple YAML config. Motors, sensors, physics — all declarative.
PPO training with pure NumPy. No PyTorch needed. Define rewards, run episodes.
Generate C header files. Float32, int8, or ternary weights — your choice.
Flash to any MCU. ARM, ESP32, STM32 — if it has C, it runs TernaryPhysics.
Write in Python, export to C. No runtime dependencies. No framework overhead. Just neural inference.
No PyTorch, TensorFlow, or JAX required
Single .h file, no libraries to link
Keep adapting after deployment
from ternaryphysics import SimExporter, PPOTrainer
from ternaryphysics.trainer import export_to_c_header
# Load your robot
env = SimExporter.from_yaml("drone.yaml")
# Create PPO trainer
trainer = PPOTrainer(
state_size=12,
action_size=4,
hidden_size=64
)
# Train hover behavior
trainer.train(env, episodes=1000)
# Export to C header
export_to_c_header(
trainer.policy,
"drone_policy.h"
) Everything you need to ship autonomous systems
Keep learning after deployment. Incremental updates from real-world experience.
Action bounds, rate limiting, and recovery behaviors. Protect your hardware.
Pure NumPy for training. Pure C for inference. No runtime required.
Sub-KB weights. Quantized to int8 or ternary. Fits in L1 cache.
Clean Python implementation. Easy to understand, modify, and extend.
Add custom physics models, reward functions, and action spaces.