<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Inverse kinematics - robot in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5899425#M20638</link>
    <description>&lt;P&gt;Hi, is it possible to script and test some inverse kinematics on joints I added to a robot in my fusion 360 project?&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2015 15:28:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-11-09T15:28:21Z</dc:date>
    <item>
      <title>Inverse kinematics - robot</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5899425#M20638</link>
      <description>&lt;P&gt;Hi, is it possible to script and test some inverse kinematics on joints I added to a robot in my fusion 360 project?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 15:28:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5899425#M20638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-09T15:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Inverse kinematics - robot</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5900239#M20639</link>
      <description>&lt;P&gt;I'm not sure what kind of tests you want to do but true inverse kinematics are not currently supported through the API.&amp;nbsp; When you move an occurrence using the API you do that by setting the tranformation matrix associated with the occurrence using the transform property of the Occurrence object.&amp;nbsp; When you do this all joints are ignored.&amp;nbsp; You can move the occurence anywhere without any regard to joints.&amp;nbsp; Just as soon anything happens within the assembly to cause the assembly to recompute that part will snap back into the position defined by the joints.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can perform forward kinematics through the API by doing the equivalent of the "Drive Joints" command but I suspect that's not&amp;nbsp;what you're looking for.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 23:19:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5900239#M20639</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2015-11-09T23:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Inverse kinematics - robot</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5900570#M20640</link>
      <description>Oh, but drive joints maybe will work. An idea would be to make scripts that when I give them a parameter (maybe from command line?) like x1 y0 z0. My script then translates this to how the joints should move and move them. Would that be possible?</description>
      <pubDate>Tue, 10 Nov 2015 07:28:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5900570#M20640</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-10T07:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Inverse kinematics - robot</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5901869#M20641</link>
      <description>&lt;P&gt;In case drive joint will do what you need, here's some example code that demonstrates driving a joint.&amp;nbsp; I'm driving the&amp;nbsp;joints through a series of changes to create an animation.&amp;nbsp; I wanted to attach the assembly I used but unfortunately, I built in the upcoming release so the f3d can't be used in the current release.&amp;nbsp; It's simple though.&amp;nbsp; I have an assembly that contains two instances of the same component (which is a subassembly made up of several parts).&amp;nbsp; That component is named "PistonAssembly".&amp;nbsp; Inside that component I have several joints that control the behavior of the parts within it.&amp;nbsp; One of those joints is a revolution joint named "Motor".&amp;nbsp; This program will find the two instances of the joint and drive them indepenedently of each other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;def driveJoint():
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface

        des = adsk.fusion.Design.cast(app.activeProduct)
        root = des.rootComponent
        
        # Get the two occurrences in the root.  These are two
        # instances of the same component.
        piston1 = root.occurrences.itemByName('PistonAssembly:1')
        piston2 = root.occurrences.itemByName('PistonAssembly:2')
        
        # Get the component referenced by the occurrences.
        pistonComp = piston1.component
        
        # Get the joint in the piston component.  It will be in 
        # the context of the piston component.
        motorJoint = pistonComp.joints.itemByName('Motor')
        
        # Create proxies of the joint for each occurrence.
        motor1 = motorJoint.createForAssemblyContext(piston1)
        motor2 = motorJoint.createForAssemblyContext(piston2)
        
        # Get the RevoluteJointMotion object from each joint.
        revJointMotion1 = motor1.jointMotion
        revJointMotion2 = motor2.jointMotion
        
        # Drive the joints.
        for i in range(0, 720, 3):        
            revJointMotion1.rotationValue = i * (math.pi/180.0)
            revJointMotion2.rotationValue = (i+180) * (math.pi/180.0)
            
            adsk.doEvents()
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a picture of the assembly and you can see the structure in the browser.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="PistonAssembly.png" alt="PistonAssembly.png" src="https://forums.autodesk.com/t5/image/serverpage/image-id/199774i2230BABE9EC545CF/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2015 19:24:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/5901869#M20641</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2015-11-10T19:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inverse kinematics - robot</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/8207888#M20642</link>
      <description>&lt;P&gt;Hello Sir!&lt;/P&gt;&lt;P&gt;Can we have a way to somehow calculate angles and positions in Fusion 360 for static analysis on inverse kinematics problem? WhatI mean by this is, can we read angles(revolute joints), lengths(prismatic joints) in real time like how BricsCAD does.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Video Link:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=zWj3mZ3bkvI" target="_blank"&gt;https://www.youtube.com/watch?v=zWj3mZ3bkvI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If it isn't&amp;nbsp;already there, it would be&amp;nbsp;very much appreciated if included in the next update&amp;nbsp;of Fusion 360.&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rohit Kumar&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 17 Aug 2018 20:14:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/inverse-kinematics-robot/m-p/8207888#M20642</guid>
      <dc:creator>jrohit1110</dc:creator>
      <dc:date>2018-08-17T20:14:23Z</dc:date>
    </item>
  </channel>
</rss>

