Conversion from URDF to SDF using gzsdf issues
Hi,
My question is two-fold.
(i) I have a URDF which has parallel linkages and multijoint definitions. I noticed that having a child link
with multiple parent links
gave unexpected behavior when using the joint_state_publisher gui
to move the joints: I could only use one actuator joint to move the head I am trying to control. The xacro file is in this link.
(ii) I tried to export my URDF model to gazebo and in light of this, I wrote a separate file as was done in the rrbot example that adds a gazebo element
for each link and joint. So I include the superchick_gazebo file within my superchick.xacro file and when I try to load it in gazebo, I notice that all my links come out correctly but the joints are not well placed as they are in rVIZ :
Here's what the interpreted sdf looked like in Gazebo.
In my terminal, I noticed warnings such as
Warning [parser_urdf.cc:346] attempted to add visual to link [base_panel], but it already exists under group [lump::panel_12_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [base_panel], but it already exists under group [lump::panel_3_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [base_panel], but it already exists under group [lump::panel_9_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [base_panel], but it already exists under group [lump::panel_12_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [base_panel], but it already exists under group [lump::panel_3_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [base_panel], but it already exists under group [lump::panel_9_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::base_panel]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::panel_12_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::panel_3_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::panel_9_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::base_panel]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::panel_12_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::panel_3_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::panel_9_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::big_bladder_link]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::big_bladder_link]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::left_bladder]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::left_bladder]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::right_bladder]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::right_bladder]
Warning [parser_urdf.cc:346] attempted to add visual to link [table_top], but it already exists under group [lump::table_cover]
Warning [parser_urdf.cc:317] attempted to add collision to link [table_top], but it already exists under group [lump::table_cover]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::table_top]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::base_panel]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::big_bladder_link]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::left_bladder]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::panel_12_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::panel_3_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::panel_9_oc]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::right_bladder]
Warning [parser_urdf.cc:346] attempted to add visual to link [right_leg], but it already exists under group [lump::table_cover]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::table_top]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::base_panel]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::big_bladder_link]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::left_bladder]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::panel_12_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::panel_3_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::panel_9_oc]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::right_bladder]
Warning [parser_urdf.cc:317] attempted to add collision to link [right_leg], but it already exists under group [lump::table_cover]
Error [Model.cc:640] can't have two joint with the same name
Exception [Model.cc:641] can't have two joint with the same name
Error [Model.cc:134] LoadJoint Failed
[INFO] [WallTime: 1479666240.902647] Spawn status: SpawnModel: Successfully spawned model
[urdf_spawner-4] process has finished cleanly
log file: /home/lex/.ros/log/817283fc-af4e-11e6-8627-801934199d44/urdf_spawner-4*.log
Msg Connected to gazebo master @ http://127.0.0.1:11345
Msg Publicized address: 10.0.0.3
Error [Plugin.hh:156] Failed to load plugin libgazebo_ros_control.so: libgazebo_ros_control.so: cannot open shared object file: No such file or directory
I checked my URDF over and over to be sure that no two joints have the same name but every time I do
bash
gzsdf print superchick.urdf > superchick.sdf
I notice there are two joints automatically generated for certain joints.
As a workaround, I think if there is a way to call a clean sdf directly in gazebo, that would be nice. I looked online, there doesn't seem to be a nice tutorial on how this can be achieved.
Are there ways to mitigate this problem?
Asked by lakehanne on 2016-11-21 14:38:48 UTC
Answers
SDF supports parallel linksages, but URDF does not. Everything in URDF must be a tree, not a graph. I think you can work around this by using <gazebo>
reference elements in your URDF file.
Asked by nkoenig on 2016-11-22 10:39:39 UTC
Comments
I already did but it doesn't help. To improve my visuals, I stripped the links that were giving warnings of their collision elements and removed the other two actuators. I now have a simplified model but I still get
Error [Model.cc:640] can't have two joint with the same name
Exception [Model.cc:641] can't have two joint with the same name
Error [Model.cc:134] LoadJoint Failed
[INFO] [WallTime: 1479872980.124301] Spawn status: SpawnModel: Successfully spawned model
Asked by lakehanne on 2016-11-22 22:36:43 UTC
You have an err that says a model can't have two joints with the same name. Try resolving that error by changing joint names.
Asked by nkoenig on 2016-11-23 12:29:00 UTC
Comments