A geometric approach to the investigation of the dynamics of constrained robotic systems