cancel
Showing results for 
Search instead for 
Did you mean: 

RobotExpert - Possible to get robot position and location via command? (C#)

Experimenter
Experimenter

I need to get robot position and location for every step of simulation. Is it possible?

2 REPLIES

Re: RobotExpert - Possible to get robot position and location via command? (C#)

Hi Discohratky,

 

have a look at the TxSimulationPlayer class provided by the SDK.

 

Documentation:

At any given moment there is a single, current simulation player, with which all simulation-related commands and viewers work. To get the current simulation player, use the TxApplication.ActiveDocument.SimulationPlayer property.

 

This class fires events for the Simulation for example "TimeIntervalReached" or "OperationEndedForward".

With the event arguments you get access to the operation (ITxOperation). This class has a Property called SimulatedObjects. You will find the assigned robot in this property. With the robot object you have access to the values you want to read.

 

TxApplication.ActiveDocument.SimulationPlayer.OperationEndedForward += OperationEndedForward;

public void OperationEndedForward(object sender, TxSimulationPlayer_OperationEndedForwardEventArgs args)
{
// assuming the first object in the list is the robot object
var robot = args.operation.SimulatedObjects[0] as ITxRobot;
// access tcpf var tcpf = robot.TCPF;
}

 Code is not tested but i think you get an idea how it should work.

 

Kind regards,

Andreas 

 

------------

ICARUS Consulting GmbH

Friedrich-Penseler-Straße 10

21337 Lüneburg

Registergericht: Amtsgericht Lüneburg HRB 110610

Geschäftsführer: Markus Baschwitz, Andre Jürgens-Tatje, Maik Pretzel

Re: RobotExpert - Possible to get robot position and location via command? (C#)

Experimenter
Experimenter
Thanks you for reply,

It works as expected.
Problem solved.

Have a nice day.