webots icon indicating copy to clipboard operation
webots copied to clipboard

Reset Solid referenced in a mechanical loop

Open stefaniapedrazzi opened this issue 2 years ago • 0 comments

On reset, the current Robot translation/rotations fields are not reset due to the mechanical loop:

Robot {
  translation -0.18 0 0.779992
  children [
    Shape {
      appearance Copper {
      }
      geometry Box {
        size 0.1 0.1 0.1
      }
    }
    HingeJoint {
      endPoint Solid {
        translation 0 -0.8 0
        children [
          Transform {
            children [
              Shape {
                appearance Copper {
                }
                geometry DEF SPHERE Sphere {
                  radius 0.2
                }
              }
            ]
          }
          HingeJoint {
            endPoint SolidReference {
              solidName "base"
            }
          }
        ]
        boundingObject USE SPHERE
        physics Physics {
        }
      }
    }
  ]
  name "base"
  boundingObject Box {
    size 0.1 0.1 0.1
  }
  physics Physics {
  }
}

Steps to reproduce:

  1. Add the previous Robot in a world
  2. run the simulation and change the position of the robot
  3. reset the simulation -> the Robot position is not reset to the initial one

However, if you remove the SolidReference node, the Robot position is correctly reset to the initial one.

Not sure if this is a bug or the behavior is correct, but nothing is printed in the console thus it currently seems a buggy behavior.

stefaniapedrazzi avatar Aug 23 '22 07:08 stefaniapedrazzi