This paper introduces a scheme of B-spline calculation, which is used for G2 continuous trajectory generation. The B-spline is composed of line segments, Euler spirals, and arcs. By simplifying and digging in the qualities of Euler spirals, we discover a valid spiral segment criterion. This criterion can be used in deciding how to compose the B-spline. One main trait of the trajectory is that this B-spline trajectory is assumed and generated inside a collision-free corridor in every interpolation scenario. Hence, the trajectory can be G2 continuous and avoid instant obstacles in every scenario case.