@dbemowsk original query was for a sliding gate.
Anything else I would say just use 2 pairs of microswitches and if there is any ambiguity, drive direction until a change is noted. Keep it simple.
A bit of googling would have shown me how. Startup or enthusiast licence. Cheers.
@bjornhallberg fusion360 free? Looks like it is $26/month sub'd or $40/month otherwise?