This work presents a novel approach combining radial basis function(RBF) interpolation with Galerkin projection to efficiently solve general optimal control problems. The goal is to develop a highly flexible solution to optimal control problems,especially nonsmooth problems involving discontinuities, while accounting for trajectory accuracy and computational efficiency simultaneously. The proposed solution, called the RBF-Galerkin method, offers a highly flexible framework for direct transcription by using any interpolant functions from the broad class of global RBFs and any arbitrary discretization points that do not necessarily need to be on a mesh of points. The RBFGalerkin costate mapping theorem is developed that describes an exact equivalency between the Karush–Kuhn–Tucker(KKT)conditions of the nonlinear programming problem resulted from the RBF-Galerkin method and the discretized form of the firstorder necessary conditions of the optimal control problem, if a set of discrete conditions holds. The efficacy of the proposed method along with the accuracy of the RBF-Galerkin costate mapping theorem is confirmed against an analytical solution for a bangbang optimal control problem. In addition, the proposed approach is compared against both local and global polynomial methods for a robot motion planning problem to verify its accuracy and computational efficiency.