Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

333
Visualizações
Configurable joint, rotation not acting as expected

I've take the Crawler project example and rework it for a personal project. And I have a huge issue making work the joints of the lower legs (not the upper legs thought).

enter image description here

I had to apply local transformation like this, so that the object are all in the same direction. Then I've edit the axis in the configurable joint, only the Z axis is limited, the others are locked. Then I've applied a 90 limit angle rotation.

enter image description here enter image description here

Thing is, in what ever constraint I use for the axis, when I apply an angle, I still get the same angle limit. I use a model to predict between -1 and 1 an output for the angle, which is mapped in a function to give 0 or 180 Degrees.

    public void SetJointTargetRotation(float x, float y, float z)
    {
        x = (x + 1f) * 0.5f;
        y = (y + 1f) * 0.5f;
        z = (z + 1f) * 0.5f;

        var xRot = Mathf.Lerp(joint.lowAngularXLimit.limit, joint.highAngularXLimit.limit, x);
        var yRot = Mathf.Lerp(-joint.angularYLimit.limit, joint.angularYLimit.limit, y);
        var zRot = Mathf.Lerp(-joint.angularZLimit.limit, joint.angularZLimit.limit, z);

        currentXNormalizedRot =
            Mathf.InverseLerp(joint.lowAngularXLimit.limit, joint.highAngularXLimit.limit, xRot);
        currentYNormalizedRot = Mathf.InverseLerp(-joint.angularYLimit.limit, joint.angularYLimit.limit, yRot);
        currentZNormalizedRot = Mathf.InverseLerp(-joint.angularZLimit.limit, joint.angularZLimit.limit, zRot);

        joint.targetRotation = Quaternion.Euler(xRot, yRot, zRot);
        currentEularJointRotation = new Vector3(xRot, yRot, zRot);
    }

But for testing I'm not using the neural net yet, I hard code inputs like this:

bpDict[leg3Lower].SetJointTargetRotation(0, 0, 1f);

But this is what I get:

enter image description here

In red, the movement of the leg (down to right). In bleu, the original position of the leg. In Black, the "axis" and limit that it was supposed to make.\

And even if I fool around with the axis, it will always go to the same position when I apply 1f(inside the robot, supposed to be down) -1 (flat, supposed to be up the sky).

Am I missing something?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I fond out that I had to modify the Secondary axis in the Configurable joint. I don't fond this very instinctive, but yhea I managed to make it work by letting the axis to 0,0,-1 and 0,-1,0 to the secondary axis.

I didn't understand the logic, but if you come by this post, try to add 1 or -1 in both of them.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda