Device for automatic control of a construction machine