Pull Active TCP pose in installation

Hi all,

We have implemented things from toolchanger and custom gripper SDK’s, but I cannot find any examples of what we need to add now:

With this method, I get my active TCP’s name = idKey

public TCP getTCP(String idKey) {
return this.tcpContributionModel.getTCP(idKey);
}

With this method, I can update the Active TCP’s pose.

public void updateTCP(String idKey, double x, double y, double z, double rx, double ry, double rz) {
	Pose pose = this.poseFactory.createPose(x, y, z, rx, ry, rz, Unit.M,
			com.ur.urcap.api.domain.value.simple.Angle.Unit.RAD);
	this.update(idKey, pose);
}

Can someone share a method to be able to pull the Active TCP’s actual pose as well?

We need to pull active TCP’s pose and then update it with a measured offset.

I see this method:

rtdeReader.getActualTcpPose()

but it only returns the actual TCP pose right now, is there one for returning a pose for a saved TCP with a specific name?

Maybe I am missing one of the SDK examples where this is done?

public String[] getAllTCPs() {	
		
		Collection<TCP> allTCPs = tcpModel.getTCPs();
		tcpList.clear();
		tcpList.addAll(allTCPs);
	    
	    ArrayList<String> stringList = new ArrayList<String>();
	    for(int i = 0; i < tcpList.size(); i++) {
	    	stringList.add(tcpList.get(i).toString());
	    }
	    
	    String[] returnArray = new String[stringList.size()];
	    returnArray = stringList.toArray(returnArray);
	    return returnArray;	 
	}

I’ve used something like this before to populate an arrayList of all the TCPs. I probably didn’t do it very efficiently, but I just stored all the names to another String array, then iterate over that array looking for a name that matches whatever I pass to the function. Then I take that array’s index and call a .get() method on the actual TCP array so I can access that TCP by its name.

1 Like