Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS topic names ignore namespace configuration when spawning multiple robots of the same model #89

Open
nahueespinosa opened this issue Nov 25, 2022 · 0 comments

Comments

@nahueespinosa
Copy link

Hi! There seems to be a bug in the way ROS topic names are loaded in various plugins.

How to reproduce

Add a laser plugin to a robot model:

plugins:
  - type: Laser
    name: laser_front
    frame: laser_front
    topic: scan2
    body: base2
    broadcast_tf: true
    origin: [0.28, 0, 0]
    range: 20
    angle: {min: -2.356194490192345, max: 2.356194490192345, increment: 0.004363323129985824}
    noise_std_dev: 0.05
    update_rate: 40

Launch a flatland_server node with the following world configuration file and see how both robots publish on the same topic (/scan2):

models:
  - name: turtlebot1
    namespace: robot1
    pose: [0, 0, 0]
    model: "turtlebot.model.yaml"
    
  - name: turtlebot2
    namespace: robot2
    pose: [0, 1, 0]
    model: "turtlebot.model.yaml"

Cause

In flatland_server/src/model.cpp there is a function called NameSpaceTopic used to prepend the namespace to the topic name before creating a publisher.

Currently, this is only used in bool_sensor.cpp but it should probably be added to other plugins, like laser.cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant