1. A method of initializing the position and direction of a mining vehicle, the mining vehicle comprising a movable carrier and a control system, and wherein the control system is arranged to read an electronic environmental model including data on coordinates of an environment delimiting a route; and a route including at least the coordinates of route points of the route to be driven, the method comprising: scanning the environment of the mining vehicle and determining scanned points on the basis of obstacles detected by the scanning; determining a search range including at least part of the route points of the preplanned route of the mining vehicle; selecting each route point within the search range at a time as the position of the mining vehicle; calculating coordinates for the scanned points of the scanning by using each route point within the search range and at least one direction; comparing the coordinates calculated for the scanned points with the environmental model; and selecting such a route point and direction as the initial values of the vehicle, the coordinates of the scanned points of which best match the environmental model.