Robotics StackExchange | Archived questions

How to connect a topic to a node

image description

I have a node /gazebo which publishes the topic /main/imageraw. I have another node /whycon which publishes several topics /whycon/poses etc. But i want the /whycon node to subscribe to the topic /main/imageraw. But I cant find any way to do that can somebody help me solve this problem.

EDIT: The /whycon and the /gazebo node is not made by me. These were already there when I downloaded the whycon and task_1 package.

Asked by alienmonster on 2017-11-12 16:00:06 UTC

Comments

What have you tried so far? Can you please post the code? Also, are you using C++, Python, or another of the supported languages?

Asked by jayess on 2017-11-13 00:02:27 UTC

The whycon node is not made by me so i cant subscribe it to the /main/image_raw topic . So where do I put the new node I make.

Asked by alienmonster on 2017-11-13 00:35:53 UTC

You should update your question with more information because as is it looks like you're trying to subscribe to multiple topics from a node that you wrote. If you're trying to remap then this is a completely different situation.

Asked by jayess on 2017-11-13 00:42:49 UTC

Now this looks like a duplicate of another one of your questions.

Asked by jayess on 2017-11-13 00:43:49 UTC

Yes so how can i remap the topic /main/image_raw in an already made node /whycon node. The /main/inage_raw topic is published by node /gazebo by launching the task_1_1.launch file

Asked by alienmonster on 2017-11-13 00:53:01 UTC

Answers

Have you gone through the tutorials? These tutorials explain how to do just this. Without knowing what you've tried so far we don't know where you're at as far as your understanding of ROS goes (and we can also help you with your code to help you solve the problem).

Asked by jayess on 2017-11-13 00:04:48 UTC

Comments

Yes i have gone through the tutorials i have tried remapping the topic /main/image_raw to /whycon in the whycon.launch file. But it doesnt work.

Asked by alienmonster on 2017-11-13 00:38:00 UTC

What does

doesn't work

mean?

Asked by jayess on 2017-11-13 00:44:23 UTC

Hi, I think, I don't understand your problem completely. You want what topic remapped to what node? In your question, you were talking about to publishers.

Generally, when you want to remappt a topic, use something like this:

rosrun <package_name> <node_name> <old_topicname>:=<new_topicname>

As I understand your question, it should be something like this:

rosrun <package_name> /whycon <old_topicname>:=/main/image_raw

But maybe I didn't understand your question right.

Best regards.

Asked by matt_do on 2017-11-13 01:48:55 UTC

Comments