1. A trajectory planning method for determining a trajectory for controlling a state of a target device from an initial state toward a goal state, the method performed by a computer in a trajectory planning system, the computer comprising hardware, the computer configured to perform the method comprising steps of: a. dividing a state space for representing states of the target device into cells; b. determining the initial state of the target device as a root of a search tree in the state space; c. extending the search tree starting from the root, by determining, as a new branch of the search tree, an edge connecting one node indicative of one state of the target device with another node indicative of a next state which the target device reaches after a predetermined time period as a result of that one of possible inputs is applied to the target device within the predetermined time period; d. finding out a cell containing the next state, and determining whether the cell containing the next state contains any other state which is already stored as a branch of the search tree; e. discarding the new branch determined at step c if the cell containing the next state contains any other state already stored as a branch of the search tree, and, if the cell containing the next state does not contain any other state already stored as a branch of the search tree, storing the new branch determined at step c; f. executing step c through step e repeatedly until a predefined search termination condition is met; g. selecting, after the predefined search termination condition is met, one state as a best state from the states each indicated by the respective stored node and having a distance in the state space to the goal state less than a predetermined value, and determining one set of the stored branches of the search tree connecting the initial state with the best state; and h. determining a trajectory of the target device from the initial state towards the goal state using a sequence of states indicated by the determined one set of the stored branches of the search tree.