Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Render does not set off
#1
Good morning. I tried to disable graphical rendering with RDK.Render(False) instruction, but there seems to be no effect. How it is possible?
#2
What are you trying to achieve, exactly?
Can you provide your sample code?
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our YouTube Channel.
#3
I'm trying to disable graphical render in order to speed up offline programming. My sample code should be something like this:


Quote:RDK.setCollisionActive(COLLISION_OFF)
RDK.Render(False)

#Define Tool
Tool=RDK.Item(ToolName,ITEM_TYPE_TOOL)
if not Tool.Valid():
   raise Exception("Tool %s not valid or not available." %ToolName )

# Get robot item
Robot=RDK.Item("",ITEM_TYPE_ROBOT)
if not Robot.Valid():
   raise Exception("Robot not valid or not available.")

#Get the Robot number degree of freedom
Robot_dofs = len(Robot.JointsHome().list())

# Get Home target item
T_HOME=RDK.Item("HOME",ITEM_TYPE_TARGET)
if not T_HOME.Valid():
   raise Exception("Target HOME not found.")

# Move robot to HOME pose
Robot.setJoints(T_HOME.Joints().list())
LastRobotTarget=T_HOME

#Get CS reference
ReferenceCS=RDK.Item("ReferenceCS",ITEM_TYPE_FRAME)
if not ReferenceCS.Valid():
   raise Exception("ReferenceCS not found.")

#Set ReferenceCS respect to the robot
Robot.setPoseFrame(ReferenceCS)
LastRobotPose=Robot.Pose()
LastRobotPoseAbs=Robot.PoseAbs()
LastRobotJoints=Robot.Joints().list()


StandardSpeedL=1000
StandardSpeedJ=50

ProgramName="MyProgram"

#Assuming to have P1 and P2 already defined
T1=RDK.AddTarget('P1', ReferenceCS)
T1.setAsJointTarget()
T1.setPose(P1)
T1.SetAsCartesianTarget()
T2=RDK.AddTarget('P2', ReferenceCS)
T2.setAsJointTarget()
T2.setPose(P2)
T2.SetAsCartesianTarget()

prog = RDK.AddProgram(ProgramName)
prog.setSpeed(StandardSpeedL,StandardSpeedJ,-1,-1)
prog.setPoseTool(Tool)
prog.setPoseFrame(ReferenceCS)
prog.setRounding(100)
prog.MoveJ(T_HOME)
prog.setSpeed(StandardSpeedL,StandardSpeedJ,-1,-1)
prog.MoveL(T1)
prog.MoveJ(T2)
prog.setSpeed(StandardSpeedL,StandardSpeedJ,-1,-1)
prog.setSpeed(StandardSpeedL,StandardSpeedJ,-1,-1)
prog.MoveJ(T_HOME)


I also tried RDK.Render(False) instruction in example macros (such as SampleOfflineProgramming.py) without success.
#4
What do you mean by no effect?

Calling RDK.Render(False) will prevent rendering while you are doing operations. However, it will still render automatically if there was no interaction with the API for some time (approximately 100 ms, this delay can be changed in Tools-Options-Other).

On the other hand, calling RDK.Render() itself will always provoke an immediate render.
#5
Ok, I didn't know that it would automatically render after about 100 ms of delay. I need to be sure that the method prevents rendering while I'm doing operations, so I'll try to change this value in Tools-Options-Other.
  




Users browsing this thread:
1 Guest(s)