cancel
Showing results for 
Search instead for 
Did you mean: 

Command JumpAssignedRobot and ReachTest

Creator
Creator

Hello,

 

I realized some robotic simulations but now I want to use the JumpedAssignedRobot command from Process Simulate (as shown in the figure). Is it possible to realize it with the .Net Api or is there a workaround?  And I also want to know if it is possible to check the locations of the robot path before running the simulation as it is done with the ReachTest Application in Process Simulate. I hope you can help me.

 

problem_command_jump_assigned_ robot.png

6 REPLIES

Re: Command JumpAssignedRobot and ReachTest

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

To Jump the robot that is assigned to robotic location operation use that code:

public void JumpRobotToLocation(ITxRoboticLocationOperation location)
        {
            if (location != null && location.ParentRoboticOperation != null)
            {
                TxRobot robot = location.ParentRoboticOperation.Robot as TxRobot;

                TxOlpControllerUtilities controllerUtilities = new TxOlpControllerUtilities();
                ITxRoboticControllerServices rcs = (ITxRoboticControllerServices)controllerUtilities.GetInterfaceImplementationFromController(robot.Controller.Name, typeof(ITxRoboticControllerServices), typeof(TxControllerAttribute), "ControllerName");
                if (rcs == null)
                {
                    rcs = (ITxRoboticControllerServices)controllerUtilities.GetInterfaceImplementationFromController("default", typeof(ITxRoboticControllerServices), typeof(TxControllerAttribute), "ControllerName");
                }
                
                if (rcs != null)
                {
                    rcs.Init(robot);
                    TxJumpToLocationData data = new TxJumpToLocationData();
                    data.GenerateMessage = true;
                    TxJumpToLocationStatus statusRes = rcs.JumpToLocation(location, data);
                }
            }
        }

To test if a robott reaches a specific location use that:

public bool CanRobotReachLocation(TxRobot robot, ITxRoboticLocationOperation location)
        {
            TxRobotInverseData data = new TxRobotInverseData((location as ITxLocatableObject).AbsoluteLocation, TxRobotInverseData.TxInverseType.InverseFullReach);
            return robot.DoesInverseExist(data);
        }

If you want to get the possible solutions call to:

ArrayList poses = robot.CalcInverseSolutions(data);
    foreach (TxPoseData pose in poses)
{
 //add your logic here
}

Re: Command JumpAssignedRobot and ReachTest

Creator
Creator

Hi,

 

thanks a lot for your quick response. That was a great help. The only problem I have at the moment is to get a list of all locations out of the operation. As shown in the picture I have one operation and in order to do the reach test with all locations I need a list of them. I had a look at the methods of the class TxOperation but I couldn't find an appropriate solution. I have an operation of type TxGenerixRoboticOperation and want to have the three locations (Home, plus1000, minus1000) of type ITxRoboticLocationOperation. Is there a possibility?

 

problem_operation.PNG

 

Re: Command JumpAssignedRobot and ReachTest

Siemens Legend Siemens Legend
Siemens Legend

Hi,

 

You can call to GetAllDescendants or GetDirectDescendants methods of ITxObjectCollection interface that is implemented by TxGenericRoboticOperation. These methods get a parameter of type ITxTypeFilter.

Also ITxOrderedObjectCollection interface provides methods and properties to access and manipulate the order of the location operations.

        TxObjectList ChildOperations(TxGenericRoboticOperation op)
        {
            TxObjectList children = op.GetAllDescendants(new TxNoTypeFilter());
            return children;
        }

 

Re: Command JumpAssignedRobot and ReachTest

Genius
Genius

Hello Diana,

 

I've written a similar code to validate if robot can reach specific locations. The result is pretty similar to "Reach Test" result list, although some locations that can be reached in the program are marked as not reachable (in "Reach Test" command and in the customized API). 

 

I've noticed in Motion Tab - Robotics Group, from Options menu, that when an option called "Use location information in static applications" is checked, "Reach Test" list now reaches the locations that were not reached before. It looks like the method to calculate the reachability changes, as mention in this option definition ("...the system takes this information from the location or from the operation...").

 

Motion TabMotion Tab

I'm looking for the information inside the location but couldn't find the parameter that can give me the reachability value. Can you help me with that?

 

 

 

 

 

 

Re: Command JumpAssignedRobot and ReachTest

Siemens Phenom Siemens Phenom
Siemens Phenom

There is a controller service that checks reachability. PSR calls this service when you select "Use location information in static applications".

 

To do the same in your application, you need to retrieve the ITxRoboticControllerServices interface of the robot assigned controller, then use service CheckInverse().

 

Re: Command JumpAssignedRobot and ReachTest

Genius
Genius

Thank you very much Gilles!

 

I'll take on look on that, that's exactly what I needed!