ros-simulation / gazebo_ros_demos

Example robots and code for interfacing Gazebo with ROS
361 stars 227 forks source link

Defining joints with the gazebo reference element tag #17

Open robotsorcerer opened 8 years ago

robotsorcerer commented 8 years ago

Hi,

Thank you for this example. 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 one 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 you did 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 an rVIZ simulation showed:

model

Here's what the interpreted sdf looked like in Gazebo.

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

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?

j-rivero commented 8 years ago

Thanks very much for the questions Lekan. Looks to me that the problems or question you described are more related to the gazebo simulator than to the ROS wrapper instead. For attracting more gazebo users and developers I would recommend to post these same questions in http://answers.gazebosim.org/. The second question is perfectly well explained. In the first one I would recommend to attach a video showing the unexpected behavior.

muratkoc503 commented 3 years ago

Thanks for question. 1 parent link may have be 1 or more child, but 1 child mustn't have be 1 or more parent at urdf. Probably, your child link have many parents.