An object oriented approach to flexible robot dynamics