Improving lifting motion planning and re-planning of cranes with consideration for safety and efficiency