Spawn an .obj or .stl file in Gazebo
I recently got a couple models that I would like to import into gazebo. However they are of .obj and .stl file types (I have each model in both formats). Is there a direct way to import these models into Gazebo? Do I need to convert them to something else first?
I've made simple models out of boxes for Gazebo by writing raw xml files using commands like
rosrun gazebo spawn_model -file my_path/fridge.xml -gazebo -model Fridge -x 0 -y 1 -z .4 -Y 3.14159
However using this command and replacing -gazebo with -urdf just throws errors like
SpawnModel: Failure - model format is
or
GazeboROSNode SpawnModel Failure: input model_xml not Gazebo XML, or cannot be converted to Gazebo XML not URDF (nor COLLADA).
Clearly obj and stl are not the correct formats for these commands, so how is it done?