How do I create a Plane feature?

Hi Viktor,

If you want to add a Feature for your URCap, you can use the FeatureContributionModel class (only for SDK versions 1.9 and up) to add Feature variables specific to your URCap. These are special Features that are not modifiable by the user on Polyscope, and are only controllable through your URCap. I think this class is only available in the InstallationNodeContribution via the InstallationAPIProvider class. You can get it by doing something like

apiProvider.getInstallationAPI().getFeatureContributionModel()

Afterwards, you can call addFeature(), getFeature(), removeFeature, and updateFeature() through the FeatureContributionModel. Remember that a Feature is represented internally by a Pose, so you’ll have to provide that as well when you add a feature.

I managed to create 3 points, but couldn’t figure out how to use URScript outside the generateScript() method.

Well, URScript is the Python-like code that will run on the actual robot, when it comes time to play/run your polyscope program. The Java code you write for your URCap ultimately needs to provide its portion of URScript in the generateScript() method.

Are you asking this question because you’re using pose_trans() and other pose manipulation methods to generate your plane feature? If so, you’ll need to do the math in Java (there’s a helpful post that did this already: Pose_trans and pose_inv functions in URCap - #6 by paul.weidinger)

2 Likes