### Bezier spline motion When robots need to perform motion along complex geometrical paths, often spline motions are employed. Splines can be seen as complex three-dimensional curves that are formed by a series of points in space. By choosing appropriate points, spline motions can be used to accurately approximate almost all surfaces that need to be manipulated by the robot.

Figure 2.3 shows an example of a robot performing a spline motion. In this case, the spline motion is defined by five points in space. Below the figure, the Robotics API motion statements are shown that let the robot execute this spline motion. Figure 2.3: Spline motion, in this case defined by five spline points

// lwr is a robot of type LWR
SplineInterface splineInterface = lwr.use(SplineInterface.class);

// do a ptp first, as spline motions from home position can cause singularity problems
lwr.use(PtpInterface.class).ptp(lwrLeft.getBase().plus(0.3, 0.5, 0.3, 0, 0, Math.PI)).execute();

// create spline points
Frame curr = lwrLeft.getFlange().snapshot(lwrLeft.getBase());
Frame f1 = curr.plus(-0.15, 0, -0.1);
Frame f2 = f1.plus(-0.15, 0, -0.05);
Frame f3 = f2.plus(-0.15, 0, -0.025);
Frame f4 = f3.plus(-0.15, 0, 0);
Frame f5 = f4.plus(-0.15, 0, 0.1);

// spline motion
splineInterface.spline(f1, f2, f3, f4, f5).execute();

__________________________________________________________________

 Robotics API support for: Spline motion Provided by: SplineInterface Also available in: MotionInterface Method(s): spline(Frame, Frame...) spline(DeviceParameters[], Frame, Frame...) Valid DeviceParameters: OverrideParameter, MotionCenterParameter, CartesianParameters, ControllerParameter, RedundancyDeviceParameter, RobotToolParameter, AlphaParameter