Optimization-based trajectory generation with linear temporal logic