A method for
programming an
industrial robot having a tool, to perform a process on an object while following a
robot path defined by a number of waypoints. The method comprises: obtaining configuration data including configuration data for the tool, configuration data for the
robot path and information about the position and orientation of the object in relation to the
robot, obtaining a sequence of waypoints, which defines the process in relation to the object, the waypoints comprises information about desired positions of the tool in relation to the object and desired positions of process events in relation to the object, obtaining at least one distance for adjusting the position of a
waypoint, deciding whether an obtained
waypoint should be modified or not, based on the obtained information about the waypoints, generating a modified sequence of waypoints by modifying the waypoints in the obtained sequence of waypoints, based on said decision, the obtained distance and the obtained information about the waypoints and generating the actual
robot path based on the modified sequence of waypoints and the obtained configuration data.