RoboDK Forum
Set rounding in Python does not have any effect- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: Set rounding in Python does not have any effect (/Thread-Set-rounding-in-Python-does-not-have-any-effect)



Set rounding in Python does not have any effect-christian.hansen-06-11-2021

Hi all out there...

I wanted to have a more smooth robot motion with setRounding, but it did not really work. No effect, when I added this in the Python code as seen below:

There was not really any Examples of using setRounding. Thx in advance :)

Code:
#Set smoothing
setRounding(100)

def pickStack(target):

# In respect to target pos, move the tool at the approach pos
stackTargetOffset = target.Pose().RelTool(5,0,-500,rz=0)
robot.MoveJ(stackTargetOffset)

# In respect to target pos, move the tool all the way under the stack
stackTargetOffset = target.Pose().RelTool(5,0,0,rz=0)
robot.MoveL(stackTargetOffset)

#Then move to the target and get in contact with the stack
robot.MoveL(target)

#Attach the stack so we see in simulation that the stack is attached
tool.AttachClosest()

# In respect to target pos, then move the stack a bit up in the air
stackTargetOffset = target.Pose () .RelTool (5 0 0, rz=0)
robot.MoveL(stackTargetOffset)

# In respect to target pos, then move the stack out away from the other stacks
stackTargetOffset = target.Pose().RelTool(-5,0,-500,rz=0)
robot.MoveL(stackTargetOffset)

# Move the robot to home
robot.MoveJ(home)



RE: Set roundings in Python - did not have any effect?-Vineet-06-11-2021

Hello,

You would have to use the following:

robot.setRounding(100)

Its needs to run as a method on an item of robot type. (ITEM_TYPE_ROBOT) or to add an instruction, you can run as a method on a program too.