I am trying to construct a simple path following robot using servos and IR sensors. I wanted to know how I should approach this as most path following robots are constructed using DC motors and drivers.
Which Libraries should I incorporate and commands should I use.
You are starting the wrong way. First You need a strategy that You know can work. Then You can start buying stuff.
Path following using IR sounds bad to me. How will You create IR radiating lines, points....?
You keep writing about IR sensors and a black line. The black line is what you are seeing. Have you tested it under IR light to determine if it is still black? IF it is a good reflector of IR, it will be the same as we see white.
Compile, download and run and see what happends. No need for anybody to analyze and think. Code has no beautypoints. If it does what is wanted, it is good code.