What does it mean to do research with a phd student? I am an undergraduate student and have recently been accepted by a professor to work on a robotics project in his lab. The professor mentioned that I will be working with a Phd student.   

My confusion is as to what work I'll actually be able to do as the Phd student who is obviously more qualified will do majority of the work. So, will I just be left with useless work like analysis/ report writing or will I actually be given work?
You need to work that out with the professor and the PhD student. Before you start, get an idea about what you will be expected to do and how exciting or boring that will seem to you. 

But, you should also settle the question about authorship of any resulting publications. You need to know in advance if you will be a co-author or will only get an acknowledgement of your contributions. 

At your stage you may not be able to insist on much, but you should know going in what the parameters are. But as you phrase your question, it is impossible to answer, as the key is with those other individuals.