You can use the Object CHOP to get the distance from a point on your robot arm to any other point in space (maybe another robotarm). You can feed that distance to a Logic CHOP (set it to ‘off when outside bounds’ mode) and set those bounds to the minimum safety distance. So whenever the distance becomes lower than the safety distance, the Logic CHOP will output 1, otherwise 0.
Another more advanced option is to use the Bullet Physics engine in TD for your robot arms. You could make an invisible bigger virtual arm around your robot arms, and have those collide in TD in the Bullet Solver, so the virtual arms collide before the real ones do.
find some examples for Object CHOP and the Bullet physics engine if you click in main menu Help->Operator Snippets (bullet solver is under COMPs)