Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Curve Follow project using Python and RoboDk program

#1
Hello All, 
I am attaching my station here. I have couple of questions here. 

1) I want to use the curve follow project with loop where I go around the object. Suppose it is like cutting tool. But I want my tool to follow the same path again and again (loop) with offset. So I designed the curve follow project. It has offset option in edit path setting to use normal offset but it is one time. How to use python code to set the offset?

2) I have written my own program, but the curve follow program is not updating. The object(my curve path does move with offset but not the robot tool). Can you please help me what I am doing wrong in code? 

Regards.


Attached Files
.rdk   Test_8_150mm_follow_path_move_down.rdk (Size: 1,023.81 KB / Downloads: 129)
#2
I recommend you to update your script to the attached example to offset your object and create a new program multiple times.
Code:
# Run the curve project 5 times with 5mm offset
for i in range(5):
    # Apply the offset to the curve object
    current_pose = curve_object.Pose()
    new_pose = current_pose.Offset(0, 0, i * offset_mm)
    curve_object.setPose(new_pose)

    # Update the curve follow project to use the new position
    curve_project.Update()

    prog = curve_project.getLink(robolink.ITEM_TYPE_PROGRAM)
    prog.ShowInstructions(True) # Break the link by showing the instructions (a future Update will create a new program)
    prog.ShowInstructions(False) # Hide the instructions   
    prog.setName(prog.Name() + "_" + str(i+1))
    prog_list.append(prog)


Attached Files
.rdk   Test_8_150mm_follow_path_move_down_v2.rdk (Size: 1.13 MB / Downloads: 138)
#3
Hello Albert,
This will just create the new object but never trace the curve follow project as intended in my previous code. This is the difficulty i was facing with Python how to integrate the two together.
#4
The code and project I provided you updates the curve follow project and creates a new program iteratively.
#5
Understood it works. I modified few things and now it runs. Thank you for quick help.
#6
Great, thank you for your feedback.
  




Users browsing this thread:
1 Guest(s)