Open Nicogene opened 2 months ago
The exportFirstBaseLinkAdditionalFrameAsFakeURDFBase
option of ModelExporterOptions
(https://robotology.github.io/idyntree/structiDynTree_1_1ModelExporterOptions.html#a776c8f98ae5c58e038e3a1962f9fd318) controls this behavior. The history behind it is a bit convoluted, but the basic reason is that one of the URDF parser used by ROS has a bug that basically ignores the mass/inertia of the root link (see https://github.com/ros/kdl_parser/issues/27 and https://github.com/ros/robot_model/issues/6), so having exportFirstBaseLinkAdditionalFrameAsFakeURDFBase
set to true
by default make sures that if a the model has a fake link in the base, when loaded in kdl the root link is not ignored.
However, if you need to avoid this behaviour, you can set it to False
:
export_options.exportFirstBaseLinkAdditionalFrameAsFakeURDFBase = False
fyi @kaidegast @mfussi66 @Nicogene
The
exportFirstBaseLinkAdditionalFrameAsFakeURDFBase
option ofModelExporterOptions
(robotology.github.io/idyntree/structiDynTree_1_1ModelExporterOptions.html#a776c8f98ae5c58e038e3a1962f9fd318) controls this behavior. The history behind it is a bit convoluted, but the basic reason is that one of the URDF parser used by ROS has a bug that basically ignores the mass/inertia of the root link (see ros/kdl_parser#27 and ros/robot_model#6), so havingexportFirstBaseLinkAdditionalFrameAsFakeURDFBase
set totrue
by default make sures that if a the model has a fake link in the base, when loaded in kdl the root link is not ignored.However, if you need to avoid this behaviour, you can set it to
False
:export_options.exportFirstBaseLinkAdditionalFrameAsFakeURDFBase = False
Thanks @traversaro! Do you think it is safe to set it to false
in creo2urdf
?
Thanks @traversaro! Do you think it is safe to set it to
false
increo2urdf
?
Sure. The only downside is that users loading the created by creo2urdf
will get a warning:
The root link
has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF.
from https://github.com/ros/kdl_parser/blob/74d4ee3bc6938de8ae40a700997baef06114ea1b/kdl_parser/src/kdl_parser.cpp#L240-L242 when they will load the URDF in ROS's robot-state-publisher. As the robot-state-publisher does not use dynamics, this is not a big problem, just a minor annoyance.
@mfussi66 @kaidegast and I noticed this strange behaviour when trying to export frames attached to the link that is passed as
baseLink
to theModelExporterOptions
. Basically what happens is that the frame exported become the new baseLink and the fixed joint between the base link and the frame is reversed (the frame is the parent, the base link is the child).Here is the python snipped I used for testing this strange behaviour:
And here is the resulting URDF:
cc @traversaro