Hi everyone,
I am using a servoj command to operate the robot, to move from point A to point B.
I am not 100% sure I am using the command correctly, because at the end of the motion, robot doesn’t slow down noticeable and it stops abruptly as can be seen on the video (UR5e Servoj issue - YouTube)
I have done a trajectory planning with an initial and final velocity/ acceleration to be zero (my conditions). Even though the graphs I received show me that the velocity and acceleration behave in the desired manner, it doesn’t seem so from the video I attached.
As you can see from the attached code, I run servoj in the loop and update the desired position as each time step.
Any suggestions for where the issue comes from?
HOST = '192.168.1.103' # UR IP address
PORT_30003 = 30003
print("Starting Program")
count = 0
home_status = 0
program_run = 0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10)
s.connect((HOST, PORT_30003))
time.sleep(1.00)
print("")
# starting position
pos_start = [-0.165, -0.501, 0.234, -0.327, -3.109, 0.065]
pos_target = [0.37, -0.405, 0.099, 1.241, -2.871, -0.196]
# s.send((f"movel(p{pos_start}, 0.1, 0.2)" + "\n").encode())
# pos_start[3:] = trans.AxisAngle2Euler(pos_start[3], pos_start[4], pos_start[5])
# pos_target[3:] = trans.AxisAngle2Euler(pos_target[3], pos_target[4], pos_target[5])
t_total = 4
planner = traj.path_plan(pos_start, pos_target, t_total)
t_step = 0.002
t = 0
time_range = []
posx = []
posy = []
posz = []
vx = []
vy = []
vz = []
ax = []
ay = []
az = []
while t <= t_total:
t += t_step
[position, orientation, velocity, ang_vel, acceleration, ang_acc, jerk] = planner.trajectory_planning(t)
next_position = [position[0], position[1], position[2], orientation[0], orientation[1], orientation[2]]
s.send((f"servoj(get_inverse_kin(p{next_position}), 0, 0, {t}, {t_step}, 150)" + "\n").encode())
print(velocity)