Best way to animate a robot/turret?
You could also use IK-Constraints to control the legs.
Add a plane as Targets for each leg so the legs can be moved around with them.   To control the rotation, empties are used as Pole Targets
The Legs are parented to the body.


Demo .blend