Discussion

Left ArrowBack to discussions page
ehteehte Posts: 3 Apprentice
using x^2+y^2=r^2 where x=r*costheta and y=r*sintheta.
Please help me with this thing.

Best Answer

  • matthewd92matthewd92 Posts: 849 Handy
    Accepted Answer
    @George1969 the simple answer is yes, if you can create a parametric formula for a trajectory path it is possible to make the robot follow it.

    What I wrote above is the code for making a parametric circle work on a UR3, you would need to understand the UR scripting language to be able to make this work on your robot.  You can find more information on UR Script here

    @ehte to make the base the center of the circle, you just need to find the current position of the robot and rotate the Rz portion by 6.28 radians and then go to that point, that should be the easiest way to make the robot the center of a circle

Comments

  • matthewd92matthewd92 Posts: 849Founding Pro, Tactile Sensor Beta Testers Handy
    You would need to also base that off of some known point, the center preferably.  Have you tried something like this:

    def getNextPositionOnArc(center, theta, radius):
      local x = radius*cos(theta) #Theta in Radians, radius in meters
      local y = radius*sin(theta) #Theta in Radians, radius in meters
      return pose_trans(center, p[x,y,0,0,0,0])
    end
    Center would need to be the center you want of the circle as a pose, you could define a waypoint and then save that to a variable and pass into the function

    global center = Waypoint_Center
    global theta = 0
    global radius = 0.025
    while (theta < 6.29):
      global nextPosition = getNextPositionOnArc(center,theta, radius)
      movej(nextPosition)
      theta = theta + 0.01
    end 
    Something like that might work
  • ehteehte Posts: 3 Apprentice
    I want to make a circle where base of the robot act as a centre. Can you please suggest some ideas
  • George1969George1969 Posts: 3 Apprentice
    Hello,
    I have a question at this post. Firstly, I'm beginner in robots programming and I'm sorry if I say nonsense. I did not manage to go through the script posted by Matthew (if you want to posted step by step how to write the code in UR3 robot). My question is it possible to use this procedure to make the robot to move along a anything curve if I write his parametric equation? (Not a circle like in this example).

    Thanks in advanced. 
  • George1969George1969 Posts: 3 Apprentice
    Hello Matthew, 
    Thanks for your response. I succeeded to write the program for ur to move along a circle. The script's manual is very useful, but I'm not anymore young and I learn more easy from examples. 
Sign In or Register to comment.
Left ArrowBack to discussions page