SleipnirGroup / Choreo

A graphical tool for planning time-optimized trajectories for autonomous mobile robots in the FIRST Robotics Competition.
BSD 3-Clause "New" or "Revised" License
112 stars 34 forks source link

Show where generation error is #443

Open Tom-ne opened 2 months ago

Tom-ne commented 2 months ago

Currently, when there is an error generating the path, there is no way for the user to know where is the problem, I think it would be helpful the add to the error message shown to the user, where is the error in the path.

calcmogul commented 2 months ago

Related to https://github.com/SleipnirGroup/TrajoptLib/issues/56.

This is deceptively difficult. For an infeasible trajectory, the best you can do is determine which constraints are violated, map the constraints to specific things like pose or dynamics, then report that to the user. Other error messages are solver internal errors we can't diagnose.

Tom-ne commented 2 months ago

I think showing the user what constraints are violated will still speed up the learning process for new users and help find why is there an issue

calcmogul commented 2 months ago

I agree, but it has to be in a user-consumable form. On the backend, constraints are just indices into cₑ(x) = 0 and cᵢ(x) ≥ 0, and that information alone tells the user nothing. Mapping those indices to something the user understands is the hard part.

On the TrajoptLib side, we could record a string with the constraint type whenever SubjectTo() is called, since the surrounding function has the necessary context.