You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect Gazebo (and therefore SDFormat) to be able to handle Xacro files. I would expect the change to need to be supported here, just like URDF to SDF conversion is done before loading an SDF.
The current solution of running Xacro before inserting the model into Gazebo. The issue with this approach is that I have a lot of models and I don't want to have to write custom code to go through, convert to URDF, and then dynamically load into Gazebo. I think this feature would improve the ergonomics of GzSim and SDFormat.
Implementation suggestion
Adding another if statement at the line linked above to prerun Xacro (if on the system) if the file ends in .xacro. We also might want to start structuring the decision of which file to convert to as a more patterned approach than an if statement. Open to suggestions on how you would structure this.
Additional Context
I would like to add this feature myself, but I want to get the projects thoughts on whether this is the right place to add this feature / if it would be accepted.
The text was updated successfully, but these errors were encountered:
right before xmlDoc.LoadFile, so that the output of xacro is fed into xmlDoc.LoadString instead. We'll need to handle errors well, so that it's clear whether the error is coming from xacro or the resulting URDF or SDF file.
We also might want to start structuring the decision of which file to convert to as a more patterned approach than an if statement.
Are you saying we should make it more extensible to other preprocessors like xacro? Other than .erb, I'm not sure if there is any other commonly used format, so I'm not sure if it's worth creating more complexity here. But it would be cool to do the same for .erb files and prerun erb.
Desired behavior
I have a couple of robots expressed as Xacro files. I would like to be able to include these in my Simulation world by using:
I have a
model.config
for my_robot that looks like:I would expect Gazebo (and therefore SDFormat) to be able to handle Xacro files. I would expect the change to need to be supported here, just like URDF to SDF conversion is done before loading an SDF.
sdformat/src/parser.cc
Lines 859 to 860 in 6f1c365
Alternatives considered
The current solution of running Xacro before inserting the model into Gazebo. The issue with this approach is that I have a lot of models and I don't want to have to write custom code to go through, convert to URDF, and then dynamically load into Gazebo. I think this feature would improve the ergonomics of GzSim and SDFormat.
Implementation suggestion
Adding another if statement at the line linked above to prerun Xacro (if on the system) if the file ends in
.xacro
. We also might want to start structuring the decision of which file to convert to as a more patterned approach than an if statement. Open to suggestions on how you would structure this.Additional Context
I would like to add this feature myself, but I want to get the projects thoughts on whether this is the right place to add this feature / if it would be accepted.
The text was updated successfully, but these errors were encountered: