Home Programming


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 Founding Pro, Tactile Sensor Beta Testers Posts: 1,264 Handy
    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


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

    #Theta in Radians, radius in meters
      return pose_trans(center, p[x,y,0,0,0,0])
    enddef getNextPositionOnArc(center, theta, radius):
      local x = radius*cos(theta) #Theta in Radians, radius in meters
      local y = radius*sin(theta) 
    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)
      theta = theta + 0.01
    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: 4 Apprentice
    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: 4 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