Universal Robots Forum

Dropdown list list of Features

I was looking in the cyclecounter example, and from that I got a way on how to populate a dropdown with variables from the program.

ArrayList<Object> items = new ArrayList<Object>();
		items.addAll(api.getVariableModel().get(new Filter<Variable>() {
			public boolean accept(Variable element) {
				return element.getType().equals(Variable.Type.GLOBAL) || element.getType().equals(Variable.Type.VALUE_PERSISTED);

But is there a way to get a list of what is in Features?


Or, almost… would like to get planes in the list too

nvm, I forgot to enable the variable…

This sample reads the collection of features from the API, and displays them in a Dropdown.

The Whip Welding URCap shows a method to find plane features and populating a drop-down in HTML, is it still the best way to create a drop-down of feature planes in Swing?

Also, the whip URCap has lots of good examples for getting plane feature points. However, it doesn’t seem to be getting the points correctly, I tested it with a random plane I made and printed the pose, the pose for point one is correct for the position (and seems to be Base->Point) But the rotation seems off, and the pose for point 2 doesn’t seem correct in terms of both position and rotation.

It seems like getX,getY,getRZ in respect to the base, but I can’t figure out why the values aren’t matching.