Retracting Legs in surveys

I have an S900 fitted with Pixhawk, the retractable legs are setup using a 3 position switch and manually work perfect.

My question is, when flying a survey is the retract landing gear added at the start and end of mission? Also if you have to RTH for a battery change is it added.

I cannot seem to get them to work automatically, doing it manually and then switching back to mission works, however it can bugger up the resume mission.