How to avoid collision among two sensor drivers or more than?
Hello, I'm using ROS kinetic on Ubuntu 16.04.
I'd like to implement AMCL with turtlebot2 and there are no problems with following tutorials wrt the theme. To give a brief explanation, the AMCL is a kind of localization with sensor data.
But because I'm trying to do AMCL with other detection packages (using sensor data), I've suffered from a collision between the same sensor driver. In other words, in the case of when I launch openni2_launch
for the AMCL package, the next openni2_launch
should be launched to detect something. And here is the right place where the collision takes place.
At first, I simply thought if I comment out those kinds of codes in detection packages or AMCL packages, this trouble would be resolved. Unfortunately, I realized right away the AMCL and the detection packages need sensor data, so JUST ignore corresponding codes should not be a solution.
So I'm planning to modify the codes to get sensor data in AMCL and the right SAME data in the detection package after doing above. (In detail, I'll launch AMCL first, and detection packages next. )
In short, I'd like to know whether I could make two different nodes(or packages) subscribe to the rightly same topic.
If it is possible, are there any other operations I must do to make it?
Thanks in advance :)
Your question is a bit confusing to me, If I get it right you want to use two instances of AMCL? This is something that can easily be solved with adding namespace like here
Thank you for your nice reply and sorry about the late response. I eventually deleted AMCL's driver because AMCL only needs LaserScan topic for localization. In fact, a laser scan sensor driver is launched as I launch my robot( roslaunch turtlebot_bringup minimal.launch, Of course, I already modified it.). What I wanted to say was that; the same sensor driver is launched twice but the real sensor is just one. But your advice was very interesting to me, and I'm planning to use it later. Thank you :)