Universal Robots+

createCircleMoveNode()

Hello,

I have been trying to add a circle node as a child node with the code below:

public void createSubTree(String bt) throws TreeStructureException {
ProgramAPI programAPI = apiProvider.getProgramAPI();
ProgramModel programModel = programAPI.getProgramModel();
ProgramNodeFactory nf = programModel.getProgramNodeFactory();
TreeNode root = programModel.getRootTreeNode(this);

    if (bt == "b1") {
        root.addChild(nf.createMoveNode());
        root.addChild(nf.createMoveNode());
    }else if(bt == "b2") {
        
        root.addChild(nf.createCircleMoveNode());
    }
    }

When executed and pressed “b1”, this code generates 2 MoveP child nodes. But it doesn’t create any circleMoveNode child node when pressed “b2”. The program doesn’t give any errors.

Am I missing something here?

Thank you,

hi,

you will need a MoveP (Move Process) for a CircleMoveNode

...
MoveNode moveNode = programNodeFactory.createMoveNodeNoTemplate();				
MovePConfigBuilder movePConfigBuilder = moveNode.getConfigBuilders().createMovePConfigBuilder();
TreeNode treeNode = root.addChild( moveNode.setConfig( movePConfigBuilder.build() ) );				
CircleMoveNode circleMoveNode =  programNodeFactory.createCircleMoveNode();			
treeNode.addChild( circleMoveNode );
...
1 Like

Hello,

Thank you for the answer.