RoboDK Forum
Automatic setting of the type of approach point- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: General questions about RoboDK (//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK)
+--- Thread: Automatic setting of the type of approach point (/Thread-Automatic-setting-of-the-type-of-approach-point)



Automatic setting of the type of approach point-Valentin BONNEAU-02-02-2022

Hello.

To follow up on the thread on curve following projects, another question :
Is it possible to set up automatically the first point of the trajectory (approach point as a linear movement and not a joint movement? circuled in red on the picture).
I know I can change it afterwards, but I have a lot of tests to do, and I'd like to avoid changing it manually.



Thanks


RE: Automatic setting of the type of approach point-Jeremy-02-02-2022

There is no way to change it automatically in RoboDK.
The reason is, the first MoveJ is there to ensure you are using the proper robot configuration before you get started.
So you know, MoveJ respect robot configuration, MoveL don't. More on that here:https://www.youtube.com/watch?v=mk1wvc19lTc&list=PLjiA6TvRACQfltgBxfEiXkZoj0YBFoaO3&index=10

What you can do is write a small python script changing the first MoveJ of a program with a MoveL.
Look at this example://www.sinclairbody.com/doc/en/PythonAPI/examples.html#modify-program-instructions

If you look towards the end of the example, something like this should work, or at least be very close to doing so:
Code:
elif instruction_dict['Type'] == INS_TYPE_MOVE:
print("Move instruction: use setInstruction to modify target")
ins_name, ins_type, move_type, isjointtarget, pose, joints = prog.Instruction(ins_id)
#prog.setInstruction(ins_id, ins_name, ins_type, move_type, isjointtarget, pose, joints)
prog.setInstruction(ins_id, ins_name, ins_type, MOVE_TYPE_LINEAR , isjointtarget, pose, joints)



RE: Automatic setting of the type of approach point-Valentin BONNEAU-02-03-2022

All right, thanks for the clarification and for the suggestion.
The reason I want to use a moveL is that to avoid any issue of calibration between 3D simulation and real cell, I work in a local frame associated to the part, and the initial moveJ does not place the robot above the starting point but a bit far away making it unsafe to use.


RE: Automatic setting of the type of approach point-Jeremy-02-03-2022

嗯,那就意味着你的虚拟细胞不是properly calibrated to match the real world.

Did you take a look at this?
https://www.youtube.com/playlist?list=PLjiA6TvRACQd8Zju_r_VSL7LBNEmBE57E

Even if you work on a local frame, things should match from the virtual to the real environment. Except if you are drastically moving the local frame once the program is loaded on the controller using a camera or something.

Jeremy