ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Spawning and controlling two different robots in Gazebo

asked 2016-07-21 09:40:09 -0500

TredBobek gravatar image

updated 2016-07-22 03:01:04 -0500


Currently there's an UR5 robot, which is working and doing it's stuff (with moveit).

My task is to have a robot that goes around in circles near the UR5 (so later the UR5 can do stuff with it). I already made a simple robot that can move around, go in circles, if I publish on a certain topic. It has it's own URDF, gazebo ros control, launch file etc. (let's call it simple robot)

And of course the UR5 has these too.

I tried launching both of these with a launch file, which of course didn't work. I saw all kind of tutorials about spawning the same robot multiple times, which isn't what I want. I want to spawn two different robots.

Spawning the complete UR5 and the simple robot model (without a controller, just the model) is easy, but when it comes to control the simple robot too (spawning a gazebo_ros_control, or somehow using the UR5's), that's where things get nasty. One of the problems (I think) is that both URDFs have a "<plugin name="ros_control" filename="">" part, and I think spawning 2 ros controllers won't really work. Deleting this plugin from the simple robot's URDF won't help, I can't control it (I can't remember, but I think even thought the .yaml is loaded, it can't find the controllers or something like that)

Maybe I have to make it global somehow...

The other problem is probably namespace. Making a correct namespace for the simple robot isn't hard, but for the UR5... I think that's a bit complex.

I tried making a merged URDF, so the simple robot is part of the UR5's system (so there won't be problem with namespaces and stuff), but the problem is that I need to connect the simple robot to the UR5.

Simple, there's a world link already for the UR5, I just connect the simple robot to the world with a floating joint... yeah, well it seems like floating is not supported, or I don't know, but when I start the program it says:

[ WARN] [1469109391.706616642]: Converting unknown joint type of joint 'world_simple_joint' into a fixed joint

Connecting the simple robot with a fixed joint to the word seems to be a bit of a problem.

I tried searching everywhere on the internet, but there's nothing on spawning different robots. Just the usual multirobot system, where there's one URDF, one robot, that's being spawned multiple times in different namespaces. I found a post about two different things (an arm and a hand) being put together, but that uses a fixed joint (and system where there's an arm, and a tool at the end of it is quite common).

Is there a way to do this?

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-07-29 04:59:00 -0500

TredBobek gravatar image

Well here's a solution (although it's not perfect): I ditched the ros_control idea, and now the simple robot uses the plugin. I can spawn it near the UR5, and I can move it around, but the problem is that my robot is not a differential wheeled robot, so a linear.x=1 won't move it forward, but in circles. But luckily that was my goal (for now...)

I don't know if the floating joint idea works or not. Yes, it throws a warn about changing it to a fixed, but in reality it will move like it has a floating joint (except if you want to move it by hand with the gazebo interface, it will count as one model).

Hope it helps.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-07-21 09:40:09 -0500

Seen: 939 times

Last updated: Jul 29 '16