MoveL inside MoveJ

I am trying to make a linear movement inside a joint move, but it is giving me some problems.

This is what I am trying to do
Udklip

moveTreeNode = root.addChild(moveNode.setConfig(mJConfig));
addWaypointToMoveNode(programNodeFactory);
moveTreeNode.addChild(moveNode.setConfig(mLConfig));

But with this, I am getting a linear move, with two waypoints inside.

Can anyone see what I am doing wrong here?

  1. If you have used the following, you will notice that it creates a default waypoint:


    so the problem could be that the you actually adds two waypoints with (1. and 2. line code).

  2. Another thing is that your moveNode gets setConfig twice with different value. It could be that the program override the value that you have set before hand.

It is just what I’ve notice since I’ve not seen your whole program - hope it helped.

1 Like

To add the waypoints, I used a function from one of the samples

private void addWaypointToMoveNode(ProgramNodeFactory programNodeFactory) throws TreeStructureException
{
	WaypointNode waypointNode = programNodeFactory.createWaypointNode();
	moveTreeNode.addChild(waypointNode);
	waypointNodes.add(waypointNode);
}

I can make it create an J move, or L move just fine. But not an L move inside a J move.

Shouldn’t

moveTreeNode.addChild(moveNode.setConfig(mLConfig));

create the L move? or is that where I am doing it wrong?

Got it! I had to make a new moveNode for the L movement.

So now I got the J move with an L move inside… and need to figure out how to put stuff inside that L move now.

1 Like

whats the point of the nested waypoints? the script output is the same as ordering them sequentially :confused:

I need the J to make sure all joints are at the correct angle, before doing the L move.

1 Like

The point of nesting relies in the shared parameters.
If you have a structure like:

MoveJ
–Waypoint_1
–Waypoint_2
–MoveL
----Waypoint_3
----Waypoint_4
–Waypoint_5

Then the shared motion parameters of the MoveJ (speed, acceleration) will apply to waypoints 1,2 and 5.
While the shared motion parameters of the MoveL will apply to waypoints 3 and 4.