JointMotion Lock

JointMotion Lock

MichaelT_123
Advisor Advisor
1,102 Views
4 Replies
Message 1 of 5

JointMotion Lock

MichaelT_123
Advisor
Advisor

Hi TF360,

 

Is there API way to lock/unlock or check a status of JointMotion  ( like: setLock, getLock). 

Any attempt to change value (via API) of a locked joint will throw an exception. It is logical on the surface, ...

but why resort to such brutal method? Is there a more civilized solution?

 

Regards

MichaelT

 

 

 

 

 

MichaelT
0 Likes
1,103 Views
4 Replies
Replies (4)
Message 2 of 5

ekinsb
Alumni
Alumni

Thank you for reporting this.  The ability to lock a joint was added after we exposed the API for joints and until now, I wasn't aware that the capability exists.  There should be an isLocked property on the Joint object.  I've added an item into our backlog so we can schedule the work to expose it.


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 5

MichaelT_123
Advisor
Advisor

Thank you Mr. E

 

 

 

MichaelT
0 Likes
Message 4 of 5

marc.a.grossman
Enthusiast
Enthusiast

There is a way to lock/unlock joints. I've got a script that locks joints for me although I'm getting some errors when I try to unlock. In my case I've got a working model of a delta robot and want to move joints... essentially drive the motors to move the robot. Because it's a parallel kinematic it seems that when I move one joint it moves others unless they're specifically locked... probably due to Fusion360's solver. That's not the behavior I wanted so I'm using a private method (not really the right way to do it) to lock the two joints I want held fixed as I move the other. Then I re-lock them. This does fail sometimes and I'm not sure why, and it's not deterministic. It seems to fail on the unlocking after having locked.

 

Hope this helps

 

Here are the relevant lines of code:

def moveJoint(free_joint, fixed_joints, newAngle):
	try:
		revoluteMotion = adsk.fusion.RevoluteJointMotion.cast(free_joint.jointMotion)
		for j in fixed_joints:
			if not (j.isLocked):
				j._set_isLocked(True)
		revoluteMotion.rotationValue = pi*newAngle/180.0
		adsk.doEvents()
		#unlock the joints
		for j in fixed_joints:
			if j.isLocked:
				j._set_isLocked(False)
	except:
		if ui:
			ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
0 Likes
Message 5 of 5

MichaelT_123
Advisor
Advisor

Hi Mr. Grossman

 

I do not have extensive experience with locking joints, ...mines are still moving smoothly in reasonable syncs. 🙂

However, I have had some problems with F360 ball joints... 

Regarding the issue you are facing, it is difficult to judge without conducting spiritual excorcisms on the implementation. It would be difficult and effortful (black roster, obsidian knife, clear full moonlight,  proper mushrooms, lingering hangover aftereffect, etc.) considering the meagerness of the documentation.

My guessing is that in unconstrained (un-locked) kinematics, successive nodes' (joints) states are calculated adaptively based on their last positions. In free kinematics ( like yours unconstrained-multi-joint robot arm ) there will be the infinite number of solutions to respective joint tensors, ... so a step-by-step adoption algorithm is chosen to resolve the dilemma.

The algorithm might fail when you lock-unlock joint, because of insufficient or undetermined boundary conditions. 

But do not wary too much ... artificial intelligence is coming ... IT will solve such a poultry problem ... and more!

 

With Regards

MichaelT

 

 

 

MichaelT
0 Likes