diff --git a/src/Mod/Robot/KukaExporter.py b/src/Mod/Robot/KukaExporter.py index bae92d7992c8..340d9655ba73 100644 --- a/src/Mod/Robot/KukaExporter.py +++ b/src/Mod/Robot/KukaExporter.py @@ -26,7 +26,7 @@ def ExportCompactSub(Rob,Trak,FileName): - print Rob,Trak,FileName + print(Rob,Trak,FileName) Traj = Trak.Trajectory # open the output file SrcFile = open(FileName,'w') @@ -65,5 +65,5 @@ def ExportCompactSub(Rob,Trak,FileName): #DatFile.close() def ExportFullSub(Rob,Trak,FileName): - print Trak,FileName + print(Trak,FileName) diff --git a/src/Mod/Robot/MovieTool.py b/src/Mod/Robot/MovieTool.py index 252379c8921e..8bd2a513c1da 100644 --- a/src/Mod/Robot/MovieTool.py +++ b/src/Mod/Robot/MovieTool.py @@ -19,4 +19,4 @@ def run(): for l in range(size): Robot.Tcp = Trajectory.position(l/24.0).multiply(Tool) FreeCADGui.updateGui() - FreeCADGui.ActiveDocument.ActiveView.saveImage(OutDir + "Rob_" + `l` + ".jpg",x,y,"White") + FreeCADGui.ActiveDocument.ActiveView.saveImage(OutDir + "Rob_" + l + ".jpg",x,y,"White") diff --git a/src/Mod/Robot/RobotExample.py b/src/Mod/Robot/RobotExample.py index 2a7d02229c35..5bf6e98b8062 100644 --- a/src/Mod/Robot/RobotExample.py +++ b/src/Mod/Robot/RobotExample.py @@ -9,31 +9,31 @@ # === Basic robot stuff === # create the robot. If you not specify a other kinematic it becomes a Puma 560 rob = Robot6Axis() -print rob +print(rob) # accessing the axis and the Tcp. Axis go from 1-6 and are in degrees: Start = rob.Tcp -print Start -print rob.Axis1 +print(Start) +print(rob.Axis1) # move the first Axis of the robot: rob.Axis1 = 5.0 # the Tcp has changed (forward kinematic) -print rob.Tcp +print(rob.Tcp) # move the robot back to start position (reverse kinematic): rob.Tcp = Start -print rob.Axis1 +print(rob.Axis1) # the same with axis 2: rob.Axis2 = 5.0 -print rob.Tcp +print(rob.Tcp) rob.Tcp = Start -print rob.Axis2 +print(rob.Axis2) # Waypoints: w = Waypoint(Placement(),name="Pt",type="LIN") -print w.Name,w.Type,w.Pos,w.Cont,w.Velocity,w.Base,w.Tool +print(w.Name,w.Type,w.Pos,w.Cont,w.Velocity,w.Base,w.Tool) # generate more. The Trajectory find allways outomatically a unique name for the waypoints l = [w] @@ -42,12 +42,12 @@ # create a trajectory t = Trajectory(l) -print t +print(t) for i in range(7): t.insertWaypoints(Waypoint(Placement(Vector(0,0,i*100+500),Vector(1,0,0),0),"LIN","Pt")) # see a list of all waypoints: -print t.Waypoints +print(t.Waypoints) del rob,Start,t,l,w @@ -79,7 +79,7 @@ StartTcp = App.activeDocument().Robot.Tcp t.insertWaypoints(StartTcp) App.activeDocument().Trajectory.Trajectory = t -print App.activeDocument().Trajectory.Trajectory +print(App.activeDocument().Trajectory.Trajectory) # insert some more Waypoints and the start point at the end again: for i in range(7): @@ -87,7 +87,7 @@ t.insertWaypoints(StartTcp) # end point of the trajectory App.activeDocument().Trajectory.Trajectory = t -print App.activeDocument().Trajectory.Trajectory +print(App.activeDocument().Trajectory.Trajectory) # === Simulation === # To be done..... ;-) @@ -102,5 +102,5 @@ # and thats kind of how its done: for w in App.activeDocument().Trajectory.Trajectory.Waypoints: (A,B,C) = (w.Pos.Rotation.toEuler()) - print ("LIN {X %.3f,Y %.3f,Z %.3f,A %.3f,B %.3f,C %.3f} ; %s"%(w.Pos.Base.x,w.Pos.Base.y,w.Pos.Base.z,A,B,C,w.Name)) + print("LIN {X %.3f,Y %.3f,Z %.3f,A %.3f,B %.3f,C %.3f} ; %s"%(w.Pos.Base.x,w.Pos.Base.y,w.Pos.Base.z,A,B,C,w.Name)) diff --git a/src/Mod/Robot/RobotExampleTrajectoryOutOfShapes.py b/src/Mod/Robot/RobotExampleTrajectoryOutOfShapes.py index 800b52bc93b6..3a20b5a90d4d 100644 --- a/src/Mod/Robot/RobotExampleTrajectoryOutOfShapes.py +++ b/src/Mod/Robot/RobotExampleTrajectoryOutOfShapes.py @@ -11,7 +11,7 @@ if edge.Type != 'Part::TopoShape':continue pos1 = edge.valueAt(0) pos2 = edge.valueAt(edge.Length) - print pos1,pos2 + print(pos1,pos2) if count==0: # first edge FirstPos1 = pos1 FirstPos2 = pos2