#Inverse Kinematics Bug

8 messages · Page 1 of 1 (latest)

royal shale
#

Hey all, I am writing an inverse kinematic plugin for bevy that mostly uses the openrr/k crate, but I have been experiencing a strange issue and am totally stuck, hoping someone else can give it a look over and maybe point me in the right direction....

https://gist.github.com/DrewRidley/cb1cd3dcce800de94c26357d50569c5d

Here is the example im following closely:

https://github.com/openrr/k/blob/main/examples/interactive_ik.rs

My code works, but panics at the .unwrap(). For some reason, the example has no problem with this, but in my case, the world_transform gives an Error type, and not the expected transform. I am not really sure what differs between my implementation and the example setup, other than the coordinates and angles.

Gist

GitHub Gist: instantly share code, notes, and snippets.

GitHub

k: Kinematics Library for rust-lang. Contribute to openrr/k development by creating an account on GitHub.

#

if it helps, heres the xml config im using

#
<IkCfg>
    <IkChain root="b_Spine01_02">
        <IkJoint name="b_Tail01_012">
            <IKConstraint type="fix" axis="y" name="xaxis"/>
            <IKConstraint type="rot" axis="x" name="yaxis"/>
            <IKConstraint type="rot" axis="y" name="yaxis"/>
            <IKConstraint type="rot" axis="z" name="zaxis"/>
        </IkJoint>
        <IkJoint name="b_Tail02_013">
            <IKConstraint type="rot" axis="x" name="tail_midx"/>
            <IKConstraint type="rot" axis="y" name="tail_midy"/>
            <IKConstraint type="rot" axis="z" name="tail_midz"/>
        </IkJoint>
        <IkJoint name="b_Tail03_014">
            <IKConstraint type="rot" axis="x" name="tail_endx"/>
            <IKConstraint type="rot" axis="y" name="tail_endy"/>
            <IKConstraint type="rot" axis="z" name="tail_endz"/>
        </IkJoint>
    </IkChain>
</IkCfg>
#

im using the bevy fox model scaled down to 0.1.

#

it says in the k crate that you have to call update_transforms() for them to exist, but I am calling it and they are still not populated. The chain is the correct length and incldues 9 nodes as expected (the fixed one is excluded)

high geyser
#

you should ask this in the bevy discord server

royal shale
#

The issue isn’t really a bevy one

#

Just some issues I’m having with a crate