We modeled our current realtime setup by studying the sources there GitHub - Mandelbr0t/UniversalRobot-Realtime-Control: A Fork of https://bitbucket.org/RopeRobotics/ur-interface/src. I reduced the code to the absolute minimum needed for executing commands and added an option for real-time Control of a UR Robot.
Essentially a light program is sent to the controller, doing a simple lookup of RTDE float buffer values as a 6 joints pose, and formats it as a servoj
command and sync
, then you remotely update the RTDE float buffer values. This makes sure that if you drop frames over network the servoj
command is still sent at the proper 125Hz update rate and the robot wont jitter. By using the servoj
command you will always be slightly lagging behind your actual target, even if using aggressive gain and lookahead values. From our research the “ultimate” way to realtime control the bot is to use the speedj
command with a control loop so you can be closer to the target than with a simple proportional control loop as servoj
is doing, but the current setup is good enough for us.