Run simulation and real system simultaneously?
Hi everyone
Is it possible to run a Gazebo simulation of, lets say, a UR5 robot and the driver for the real UR5 simultaneously in different namespaces? I need to be able to run a trajectory in simulation first for testing, and then on the real system. I don't want to have to start and stop the simulation and the driver alternatingly over and over again.
Thanks
Hendrik
Asked by Hendrik Wiese on 2019-05-13 02:45:53 UTC
Answers
Sure, why not?
That is probably not the answer you were looking for, but your question, as you currently state it, doesn't seem to ask for any specifics. You also don't tell us whether you're expecting any specific problems setting something like that up, so I can't be more specific in my answer.
Asked by gvdhoorn on 2019-05-13 02:57:30 UTC
Comments
The problem is that I seem to have a rostopic name clash between the simulation and the real system. I'm trying to put the real system and the gazebo simulation in their own namespaces. It works for the real system but the simulation does not start correctly when put in a namespace. It seems like it still tries to reach /gazebo/spawn_urdf_model
service without the namespace prefix. The other services seemingly correctly have the namespace prefix.
Asked by Hendrik Wiese on 2019-05-13 03:13:11 UTC
It seems like it still tries to reach
/gazebo/spawn_urdf_model
service without the namespace prefix.
this is a very specific problem that would've been good to mention in your OP.
In any case: according to the code spawn_model
should be able to deal with namespaces. Could you perhaps show a snippet of your .launch
file(s) that show (roughly) how you start your simulation?
Asked by gvdhoorn on 2019-05-13 03:29:21 UTC
I'm sorry, yes, I should have mentioned it. I'm using the ur_gazebo
package, completely unmodified. The only thing I'm doing is launching the simulation by ROS_NAMESPACE=simulation roslaunch ur_gazebo ur5.launch
. So from my point of view nothing special.
Asked by Hendrik Wiese on 2019-05-13 03:42:11 UTC
I'd try with a wrapper-.launch
file that uses a group
with a ns
attribute and include
s the launch files that you want to start in a different namespace. It might not change things, but it's a slightly more reproducable -- and shareable -- setup.
Asked by gvdhoorn on 2019-05-13 04:34:16 UTC
Alright, I'll give it a shot. For the acute situation though I have now performed the moves on the real robot, drastically slowed down in order to be able to react in the case of an imminent collision. If a run turned out working without collision, I executed the trajectory at full speed. A bit of a risk, but no issues were had. Even without using the simulation.
Asked by Hendrik Wiese on 2019-05-13 09:13:13 UTC
Comments