1

I want to use a BallJoint in my proto however, I am getting this Warning: (PROTO) > Solid > BallJoint: Skipped node: Cannot insert RotationalMotor node in 'device' field of BallJoint node. Any ideas how to fix this? Here's how I define it:

      BallJoint {
        jointParameters BallJointParameters {
          anchor 0 0.05 0
        }
        device [
          RotationalMotor {
            name "motor 1"
            maxVelocity 1
          }
        ]
        device2 [
          RotationalMotor {
            name "motor 2"
            maxVelocity 1
            minPosition -1.5707963267948966
            maxPosition 1.5707963267948966
          }
        ]
        device3 [
          RotationalMotor {
            name "motor 3"
            maxVelocity 1
          }
        ]
        endPoint Solid {
          translation 0 0.05 0
          children [
            Shape {
              appearance BrushedAluminium {
              }
              geometry DEF SPHERE Sphere {
                radius 0.03
                subdivision 32
                ico FALSE
              }
            }
          ]
          boundingObject USE SPHERE
          physics Physics {
          }
        }
      }
hkhodr
  • 23
  • 3
  • 1
    This feature has been introduced in the recent Webots R2019b, and there is a working example here: https://cyberbotics.com/doc/guide/samples-devices#motor3-wbt Could you check your Webots version? – FabienRohrer Jul 23 '19 at 06:55
  • Yes, I have Webots R2019b. I actually used this example to test: I copied the robot node from the world file(motor3.wbt) and paste it to my proto file. – hkhodr Jul 23 '19 at 09:54
  • I just tried to copy your code inside the Robot.children of projects/robots/robotis/bioloid/worlds/bioloid_dog.wbt and it is working like a charm. Where do you copy this precisely? Could you reproduce in a PROTO which is released in Webots? – FabienRohrer Jul 23 '19 at 15:53
  • Yes it works if I add the BallJoint node to the wbt file or the scene tree but it fails when I save it in a PROTO and try to add this proto as a node. I used the Robot node from cyberbotics.com/doc/guide/samples-devices#motor3-wbt and added the header for proto as: #VRML_SIM R2019b utf8 PROTO motor3 [ field SFVec3f translation 0 0 0 field SFRotation rotation 0 1 0 0 field SFString mycontroller "void" ] { – hkhodr Jul 23 '19 at 17:18
  • In my previous test, I copied your snippet inside BioloidDog.proto. So copying this into a PROTO is working in some cases. Maybe you added the BallJoint in a forbidden place in your PROTO. A priori, it should work if the PROTO route node is a Robot node, and if you add it in a Solid.children. Could you check this? – FabienRohrer Jul 24 '19 at 07:08
  • I just give a try, and my last comment is certainly the key of your issue :-) You should check the root node of your PROTO. A motor could only be added into a Robot node (because it is the way to actuate a joint). I bet the root node of your PROTO is not a Robot node ;-) – FabienRohrer Jul 24 '19 at 07:13
  • 1
    I double checked and my root node is indeed a Robot node [link] (https://imgur.com/QndgjZ6). Maybe to be clearer the problem is when I add the proto to the tree scene as a node not when saving the proto file. I tried to copy my code snippet inside BioloidDog.proto as a first child. Then added a node (BioloidDog.proto) gave me same warning. – hkhodr Jul 24 '19 at 09:43
  • I can finally reproduce the issue. Yes, it's when the node is added from the scene tree that the problem occurs. I will take a look at this. – FabienRohrer Jul 25 '19 at 11:47

1 Answers1

1

This is actually a Webots bug. You may find the fix here: https://github.com/omichel/webots/pull/756

FabienRohrer
  • 1,794
  • 2
  • 15
  • 26