Hello,
I am controlling a UR3e robot externally via RTDE using SDU Robotics’ ur_rtde library. I only installed the library’s Python bindings with pip, so no C++ interface. I am wondering if there is a way to control the speed of the robot while it’s moving.
Currently, I apply the new speed in the move command but that means if the robot is already moving to a certain waypoint, it’ll do so with the older speed. This way, the robot doesn’t adjust its speed immediately.
I have seen some documentation regarding setting speed_slider_fraction or socket_send(“set speed 0.5”) but I am not really sure how to integrate these with my current setup where I already have an active RTDE connection.
I think maybe the servoJ() command might be what you’re looking for?
I’m not sure about servoJ()… wouldn’t it be the same as a moveJ() where I provide a certain speed and it continues at this speed for a certain amount of time before a new command is sent with the new speed? Anyways, looking at the documentation, servoJ() has a time parameter which is used to block the function for that time, meaning I wouldn’t be able to stop the robot during this command (unlike moveJ() which can run asynchronously).
According to the documentation “Servoj can be used for online realtime control of joint positions” which definitely sounds like what you’re asking for. This is what we’ve used in the past to seam track / modulate speed on the fly. The difference here is that ServoJ is called every timeslice, as per the documentation: “It is preferred to call this function with a new setpoint (q) in each time step (thus the default t=0.002)” So you’re calling A LOT of ServoJs, and it will respect changes in target or speed, allowing you to make these on-the-fly changes to the path whereas MoveJ is a fire-and-forget type of method, as you’re finding out.
Oh okay I understand now! Thank you for clearing that up.
Until now, I have used a set of four waypoints for the motion sequence that the robot needs to reach. Using servoJ(), I then need to split the path into a lot more waypoints with step size equivalent of the time step right?
Nah, that would be miserable. You should be able to leave the target q (target joint position) the same and just feed in a different value for v (velocity). In theory, if you don’t change any parameters, this repeated call to servoJ should produce the same result as MoveJ. But obviously the point here is we WANT to change something (in your case the speed) MID-MOVE.
Oh that’s awesome if I don’t need to interpolate all the intermediate waypoints. Thanks again for your help! I will test it out and let you know of the outcome
!
I’m having some trouble understanding how to use the servoJ command. I have four waypoint along a path that I want the robot to follow. I tried calling the function, providing just those four waypoints, and the robot ended up moving along the path extremely fast. How can I fix this issue if not interpolating all the intermediate waypoints (and calling servoJ for them)?
The “v” parameter of the function controls the speed. Keep in mind this is in METERS/sec
I am using Universal Robotics Software version 5.15. For this version of the script manual, the description of servoJ seems not to use the “v” and “a” parameters at all as shown in the image below. What version do you use?
Oops. That’s on me, I didn’t read that far into it. That’s what I get for assuming things I guess. You’re outside my realm of experience now, sorry. I’ve never used the RTDE to control the robot. Maybe you were on the right track at the beginning by sending values to the speed slider. Sorry for potentially leading you down the wrong path there!
No worries at all. I still think using servoJ is better than trying to adjust the speed slider. I might just have to interpolate all the waypoints I guess to use it correctly. But thank you so much for your help!