Mech rig help

I’m trying to build a mech rig and I have got some problems.
Please look at my blend.

My question is:
How do I link an armature to the middle cube controlling the foot in pose mode?


Simply parent the cube to a bone in the armature.