Ask Your Question

Adding object/changing position in Gazebo and Rviz

asked 2020-02-10 07:38:45 -0500

Zenzu gravatar image

I am trying to add a box, with which a KUKA robot could interact (push it into the desired position). Besides being able to interact with it, I have to be able to change its position through a node. Could you point me into the right direction, what should be the right way of doing it? My ideas/attempts are:

  1. If I create a box in same urdf file as KUKA, the arm avoids the object because of the collision avoidance. I believe that if I could somehow disable this, I could push the object with arm. Will I be able to change the position of the object using tf?
  2. The second idea is to insert the object in Gazebo using the Gazebo GUI. It seems to work but I am getting an error, right after I have inserted the object:

[ERROR] [1581331637.324486823]: This robot has a joint named "joint_a1" which is not in the gazebo model.

[FATAL] [1581331637.325261818]: Could not initialize robot simulation interface

So far I have not find any impact of that error. I am able to change its position using /gazebo/set_model_state service. To visualize the object in Rviz, tf broadcaster is needed, right? I think that the actual position of the object I could get from /gazebo/get_model_state service.

3) The third idea was to create two separate robot_models (2 separate urdf files with 2 urdf_spawn nodes). But with this idea I have had no success so far.

Could you point me to the right direction? How can it be solved?

PS: for better understanding I am trying to create this environment in ROS using KUKA:

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-02-10 08:35:56 -0500

atas gravatar image

updated 2020-02-10 08:40:42 -0500

You can create a model plugin for your gazebo model, you need insert box model into the world file and specify the name of your model plugin so that you can manipulate the states/properties of this model through the plugin. Inside The plugin you can well use ros functinoalities like subscriber and publishers, this way you Can have access to topics that you will use to change the pose of model accordingly. Have look at link below to see a gazebo plugin that I wrote for my project, It’s simply moves an object randomly Between defined boundaries,

note; I am not sure if this is the simplisest way to handle this but I would have done it this way, hope it helps

edit flag offensive delete link more


thank you very much. I am going to try it and later I will let you know.

Zenzu gravatar image Zenzu  ( 2020-02-10 09:05:47 -0500 )edit

It seems to work, Thank you once more

Zenzu gravatar image Zenzu  ( 2020-02-11 04:28:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-02-10 07:38:45 -0500

Seen: 1,174 times

Last updated: Feb 10 '20