Visual servoing of an inverted pendulum