Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Real-time robotic control

3 REPLIES 3
Reply
Message 1 of 4
dannugeman
1625 Views, 3 Replies

Real-time robotic control

Hi,

I am investigating fusion for use of real-time robotics control. An example appilcaition would go something like this:

  1. Design a robotic arm in fusion - Solved
  2. Animate the robotic arm
    1. Use fusion to do prerecorded animations - Solved
    2. Use the API to modify the animation/model real-time with a controller(xbox controller, joystick, etc) - unknown
  3. Export joint angles and and actuator positions in real-time
    1. Send them to the real robotic arm over TCP/IP using the python API - unknown

The biggest unknowns are live animation using the API and accessing/exporting actuator positions live using the API.

 

Could someone provide insight into the capabilities of the API and/or API calls that fit this description.

 

Thanks,

Daniel 

 

3 REPLIES 3
Message 2 of 4
marshaltu
in reply to: dannugeman

Hello,

 

I am not clear how you create "animation" by Fusion 360. A potential solution for you could be "parameter" driven.

 

1. Convert the input of your controller into model parameter.

2. Drive your robotic arm by the parameter.

3. Calculate the position of robotic arm according to current parameter.

4. Pass it to real robotic arm over TCP/IP.

 

The following codes demo how to drive model by model parameter. Please download attached design, upload it to your project, open the design and run the codes.

 

import adsk.core, adsk.fusion, traceback
import time

def run(context):
    ui = None
    try: 
        app = adsk.core.Application.get()
        ui = app.userInterface

        design = adsk.fusion.Design.cast(app.activeProduct)
        param = design.rootComponent.modelParameters.itemByName('d6')
        
        angle = 0.0
        oldexp = param.expression
        while angle <= 90:
            param.expression = '{} deg'.format(angle)
            angle += 1.0
            time.sleep(0.1)
            adsk.doEvents()
            
        param.expression = oldexp
           
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))


Marshal Tu
Fusion 360 Developer
Autodesk, Inc.

Message 3 of 4
xiaodong_liang
in reply to: marshaltu

Hi,

 

As Marshal said, it is basically to drive the parameters, assuming you could pass the data from he hardware to Fusion 360. 

 

I am not familiar with XBox. What I have practiced with is Socket.IO. This is a blog. probably it might help a bit.

http://adndevblog.typepad.com/cloud_and_mobile/2016/03/practise-with-fusion-360-and-socketio-javascr...

 

Message 4 of 4
ekinsb
in reply to: dannugeman

In addition to parameters, it is possible to do the equivalent of the "Drive Joints" command where you're changing the value of the joint so it's not required to have a parameter.

 

It's not currently possible to get the joint information as the user is dragging the components in the assembly.  This would require an event to be fired as the user is manipulating the assembly and this does not currently exist.

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report