webots_ros2 icon indicating copy to clipboard operation
webots_ros2 copied to clipboard

getUrdf() from Webots cannot handle a SliderJoint in a Transform node

Open swjqq opened this issue 3 years ago • 7 comments

When I use SliderJoint in the Robot node, the ROS2 package, which used to work properly, will report an error. I want to know how to solve this problem? Snipaste_2022-03-02_20-46-43 Snipaste_2022-03-02_20-43-15

swjqq avatar Mar 02 '22 12:03 swjqq

The webots_ros2_driver node send a URDF content to the robot_state_publisher node. This content is generated by Webots based on the robot in the simulation.

It seems that the robot_state_publisher node can found a joint but not a corresponding link. Try to change the DEF LIFT for the Transform node to something else than the DEF LIFT for the SliderJoint node. This is not an issue for Webots but it seems that the export feature is not dealing with clash names for different types of nodes.

BenjaminHug8 avatar Mar 02 '22 15:03 BenjaminHug8

Thank you for your reply, but It seems that changing the DEF for the Transform node can't work. I made the following changes: Snipaste_2022-03-03_21-06-23 And it reports the the same error as follow: Snipaste_2022-03-03_21-04-52

However, when I move the SliderJoint node from the children of the Transform node to the children of the Robot node , it works properly. Snipaste_2022-03-03_21-22-12 Snipaste_2022-03-03_21-29-27

swjqq avatar Mar 03 '22 13:03 swjqq

If you check the error message, it is talking about a LIFT_TRANSFORM missing link and not anymore about a LIFT missing link, so the error type is the same but overall the error is not the same.

But it seems you manage to have a solution to your issue.

However it seems that the exportUrdf() function used by Webots does not manage the scenario using the sliderJoint in a Transform node.

BenjaminHug8 avatar Mar 04 '22 07:03 BenjaminHug8

If you check the error message, it is talking about a LIFT_TRANSFORM missing link and not anymore about a LIFT missing link, so the error type is the same but overall the error is not the same.

But it seems you manage to have a solution to your issue.

However it seems that the exportUrdf() function used by Webots does not manage the scenario using the sliderJoint in a Transform node.

Thanks. I have checked the error message and I think it is the same error. I found that the name of the missing node would change to the same as the DEF of the Transform node. Snipaste_2022-03-04_18-17-15

In a word, a solution to this issue is to avoid using the SliderJoint in a Transform node.

swjqq avatar Mar 04 '22 10:03 swjqq

Perfect, then your issue is solved right (you managed to use the SliderJoint)?

(In case your issue is solved, please do not close this issue. We will keep it to track and fix the use of the Transform node.)

BenjaminHug8 avatar Mar 04 '22 10:03 BenjaminHug8

Perfect, then your issue is solved right (you managed to use the SliderJoint)? Yes. (In case your issue is solved, please do not close this issue. We will keep it to track and fix the use of the Transform node.) OK.

swjqq avatar Mar 04 '22 14:03 swjqq

I think that this bug also applies to HingeJoint objects which are children of Transform objects.

[robot_state_publisher-3] Error: Failed to build tree: parent link [slot] of joint [slot_redacted N_joint] not found. This is not valid according to the URDF spec. Every link you refer to from a joint needs to be explicitly defined in the robot description. To fix this problem you can either remove this joint [slot_redacted N_joint] from your urdf file, or add "<link name="slot" />" to your urdf file. [robot_state_publisher-3] at line 225 in /tmp/binarydeb/ros-galactic-urdfdom-2.3.5/urdf_parser/src/model.cpp [robot_state_publisher-3] Failed to parse robot description using: urdf_xml_parser/URDFXMLParser [robot_state_publisher-3] terminate called after throwing an instance of 'std::runtime_error' [robot_state_publisher-3] what(): Unable to initialize urdf::model from robot description


Transform { translation 0 0 0.2 children [ HingeJoint { jointParameters HingeJointParameters { } device [ RotationalMotor { name "redacted M" } ] endPoint Slot { type "vehicle wheel" endPoint TractorFrontWheel { name "redacted N" tireRadius 0.2 width 1.1 physics NULL } }

Can @RegularTriangle help clarify and establish the last known-good version before this bug began to occur? (regarding the "which used to work properly" comment)

I am finding that the problem may be intermittent, as well.

gStewartAtUpower avatar Jul 01 '22 21:07 gStewartAtUpower