Autonomous systems often operate under complex task constraints that involve both spatial and temporal aspects, such as "the robot must inspect Area 1 for 3 minutes, then Area 2 for 5 minutes, and finally reach the goal while maintaining a speed below 5 m/s at all times". Signal
...
Autonomous systems often operate under complex task constraints that involve both spatial and temporal aspects, such as "the robot must inspect Area 1 for 3 minutes, then Area 2 for 5 minutes, and finally reach the goal while maintaining a speed below 5 m/s at all times". Signal Temporal Logic (STL) is a formal, logic-based framework to specify these objectives. While some of the existing research has focused on using STL to generate robot trajectories that satisfy predefined constraints, this paper tackles the inverse problem: given successful trajectories, how can we infer the underlying STL constraints they adhere to? We address this problem by using Parametric STL (PSTL), where domain experts define template STL formulas with certain values left as symbolic parameters (e.g., "the robot must inspect Area 1 for t_1 minutes"). The goal is to determine the parameter values that best replicate the expert trajectories. To this end, we introduce a framework that uses Bayesian Optimization (BO) to identify the unknown parameters of the PSTL formulas. This approach leverages BO’s ability to explore and exploit parameter spaces with minimal evaluations, ensuring that the learned PSTL parameters closely match expert demonstrations while preserving the interpretability and structure of the original task specifications. Our experimental results demonstrate that the proposed framework can accurately learn PSTL parameters with an error of less than 10%, although certain edge cases still present challenges. Additionally, we explore the amount of expert data required to effectively learn these parameters and show that even a small set of 20-25 expert trajectories can produce accurate results that capture key task behaviors.