Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Override collision check timeout

#1
I want to be able to timeout the collision check with MoveL_Test after 10 seconds on the C# API. But there doesn't seem to be a way to change the timeout unless i modify the function itself on the API. 

This is the function from the API:
Code:
        public int MoveL_Test(double[] j1, Mat t2, double minstepDeg = -1)
        {
            Link.check_connection();
            var command = "CollisionMoveL";
            Link.send_line(command);
            Link.send_item(this);
            Link.send_array(j1);
            Link.send_pose(t2);
            Link.send_int((int) (minstepDeg * 1000.0));
            Link.ReceiveTimeout = 3600 * 1000;
            var collision = Link.rec_int();
            Link.ReceiveTimeout = Link.DefaultSocketTimeoutMilliseconds;
            Link.check_status();
            return collision;
        }


I know there is the IRoboDKLink interface and the RoboDKLink class that inherits it but there's no public function to send the array, pose, and integer. For me to just create a copy of the function and specify the timeout time that I want.

What are my options to set the timeout for collision checking with MoveL_Test?
#2
The timeout for the MoveL_Test function is hardcoded. You could use a variable instead. I'll bring this up with the tech team so we can provide an official update which allows you to customize this timeout.
#3
Hey Albert, what do you mean I could use a variable instead?
#4
I mean that you could replace the number 3600 * 1000 by a constant or a variable to change this value.
#5
Thank you, that seems to help. But now I'm facing another issue with needing to reconnect to RoboDK.

From what I can understand, after the timeout on the Socket gets thrown. I will need to dispose the existing Socket before calling the Connect() function on IRoboDK to reconnect to the same RoboDK instance? But sometimes after another timeout occurs with movel_test and disposing the existing Socket. When I try reconnecting, it instead closes the existing RoboDK process/instance and creates a new one. For the time being, setting a delay of about 10 seconds before reconnecting seems to work. But is there a better way of reconnecting to the same RoboDK instance?
#6
When the timeout is triggered you should use a new connection. You can safely have multiple connections in parallel and establish a new connection to RoboDK. However, you would have to update the pointer to the Robolink object on every item.

Also, for your information, if you use the InstructionListJoints function to check for collisions you can intercept the calculation by using a parallel thread and calling Stop() on the program item you used the InstructionListJoints with. This feature is undocumented but we could provide this with the MoveJ_Test and MoveL_Test functions if that can help you.
#7
Using InstructionListJoints does seem like a more viable solution to what I am doing but I don't understand why I keep getting an error with the returned result. Even though in RoboDK itself I can run the program fine with two instructions. The error I am getting: "Warning! Path is not continuous.".

I am testing the function in Python to see what is being returned but I also don't understand these joints being returned as well. Because these joints are not inline to the path the robot would take to go from one point to the other. Nor does it seem to return the rail and turntable axes as well, only the robot joints.

Are the joints returned supposed to be the joints the robot uses at a step distance between two instructions? Because that is what I would like to have from movel_test. Where it returns the valid step joints/poses along the path between the two points.

I also tested the function in the C# API and it seems to work where it says there's 2 valid instructions but would return over a dozen joints that don't seem valid?

I've attached a RDK file of what I am testing out.


Attached Files
.rdk   MasterModel.rdk (Size: 6.55 MB / Downloads: 31)
#8
Any tips on how I can properly use InstructionListJoints?
#9
For InstructionlistJoints function to properly work you should make sure to specify the frame, the tool and start the movement with a joint movement. Also, if you use a time-based result you should specify the speed as well.

I see that you only have 2 linear movements in the program you are using for testing.
  




Users browsing this thread:
2 Guest(s)