Minimum time and minimum switch path planning for a hyper-redundant manipulator with lockable joints