Search Unity

An Introduction to CCD IK and how to use it

Discussion in 'Animation' started by JamesB, Jun 21, 2018.

  1. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    Hello all,
    I recently did a talk about the CCD algorithm for IK and how to use the Animation Jobs system to implement it. Here are the slides for my Unite talk:
    https://oc.unity3d.com/index.php/s/WDLkaj3S9rGYCH7
    And here is the project:
    https://oc.unity3d.com/index.php/s/IR6aKCQjQrrx4uW
    Please note that this project was made using the 2018.2 beta and that Animation Jobs are part of an Experimental namespace. They are subject to change but I might not have time to update the project to match those changes, though I will do my best. Also note, this is not a complete solution for all things IK, just an introduction to the algorithm and how to use it. You will need to finish the implementation yourself in order that it is useful in a game.
     
    seventeencard, iike, CodeKiwi and 2 others like this.
  2. Ice_MJ

    Ice_MJ

    Joined:
    Jul 26, 2016
    Posts:
    15
    Thx a lot!
     
  3. Goatogrammetry

    Goatogrammetry

    Joined:
    Apr 27, 2017
    Posts:
    197
    Is there a video up?
     
  4. Ice_MJ

    Ice_MJ

    Joined:
    Jul 26, 2016
    Posts:
    15
    You can get the video at youtube. Here is the link
     
  5. dev01

    dev01

    Joined:
    May 3, 2010
    Posts:
    21
    I was wondering if there was a solution for ccdik uses in “prone animations”? Unreal engine has a solution to follow the normals of the terrain during movement in prone but Unity currently does not. Can ccdik be a solution for this and if possible can you post a script using it or video for a “prone crawl forward” on uneven ground. It’s a lot to ask but I have scoured the Internet for months and have no solution. Thanks in advance
    Great presentation by the way!
     
  6. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    @dev01 This solution for IK is only positional in that it doesn't have target rotations. This CCD algorithm is not ideal for what you are looking for. I don't know of an algorithm off the top of my head which would fill your needs perfectly but I'd imagine there are papers and tutorials out there which should help you write an algorithm which would work. I've had a few ideas for one I've been meaning to write myself but I haven't had the time! If I get around to it eventually, I'll do another talk like this one but I'm afraid that might be a bit too late for you.

    Sorry I couldn't be more helpful.
     
  7. discofhc

    discofhc

    Joined:
    Dec 18, 2017
    Posts:
    47
    Hi!
    How this relates to the "Animation Rigging" package announced at this year´s GDC talk?
    Any chance to CCD IK be implemented in the package?
    Thanks!
     
  8. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    @discofhc At the time of recording this was unrelated to Animation Rigging. However, I there is currently a branch of the Animation Rigging package with this algorithm in and I am hoping it will be merged with the master branch. If so you will be able to use this algorithm as part of the Animation Rigging package. However, the team's priority is to make sure what they have works and not to add additional rig constraints. As such it's unclear whether or not this will be added any time soon - it might, it might not. Sorry I can't be more specific.
     
  9. obucklin

    obucklin

    Joined:
    Mar 22, 2018
    Posts:
    1
    @JamesB Thanks for the great talk! I'm interested in implementing CCD for implementation with physical robots. I have a working IK script with positional control and joint limits, but I would really like to solve for end-effector(EE) orientation as well. I have found various academic articles on the subject, some of which mention EE orientation, but not how to solve for it, and at least one source which says it isn't possible. Do you have any idea how that could be implemented in the CCD algorithm? Another option is obviouly a traditional Jacobian Transpose IK solver, but given the simplicity of CCD, I would love to benchmark the two. Thanks!
     
  10. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    @obucklin I don't have any experience on writing IK algorithms for physical robots so I cannot really speak with any authority on this. It is possible that a variation of the CCD algorithm would work when each bone is only rotated in the axis it can be rotated (rather than the free rotation I used in the talk). The problem with this is that it doesn't guarantee a solution and so you will need many more checks to verify that the algorithm isn't continuing indefinitely. It's possible that a FABRIK solver might be better for this situation - I'm not sure.
     
  11. fanjiang

    fanjiang

    Joined:
    Jan 9, 2020
    Posts:
    3
    Thanks for the presentation! The link for the project seems invalid, it shows the error below. Could you please take a look?

    Internal Server Error
    The server encountered an internal error and was unable to complete your request.
    Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
     
  12. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    Ah... I may have messed up a bit here. Unity stopped using Owncloud and so that version is lost. I totally forgot that this project was being shared through Owncloud so I took no action to share it elsewhere. I still have the private repo somewhere but I did a lot of experimentation with the project after this talk so I'll need to find an appropriate place to roll it back to and then upload to another sharing location. I'm pretty busy at the moment but I will do my best to get another version ready this week.

    Sorry about this, totally my fault.
     
  13. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    nyanpath likes this.
  14. fanjiang

    fanjiang

    Joined:
    Jan 9, 2020
    Posts:
    3
  15. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Wish I went with UE insted..