Topic remapping using <remap> not working
ROS Kinetic - Ubuntu 16.04
Goal
An app I can't control outputs data on the /point_cloud
topic.
A Laser_scan_matcher node can accept pointcloud data on the /cloud
topic, and can output /PoseStamped
topic.
What I'm doing
I made a launch file which contains:
<launch>
<remap from="tango/point_cloud" to="cloud"/>
<node pkg="laser_scan_matcher" type="laser_scan_matcher_node"
name="laser_scan_matcher_node">
<param name="use_cloud_input" value="true"/>
<param name="publish_pose_stamped" value="true"/>
<param name="use_imu" value="false"/>
<param name="use_vel" value="false"/>
<param name="use_odom" value="false"/>
</node>
</launch>
(This is for live output - not bagfiles.)
Normally, rqt_graph looks something like:
(app) --> [/cloud] --> (laser_scan_matcher_node) --> [/PoseStamped]
What I'm getting
Instead it looks like this:
What am I missing?
I'm not sure about it but maybe you should write
<remap from="cloud" to="tango/point_cloud"/>
if you do the remapping in this launch file or write<remap from="tango/point_cloud" to="cloud"/>
in the launch file that launch your app.@Delb remapping from "cloud" to "tango/point_cloud" worked, funnily enough! Instead of the node using the /cloud input, it started using /point_cloud as input. Thanks!
When you do
<remap from="x" to="y"/>
you ask a node to change its input/output topicx
to a topicy
so when you had your issue you were asking the node to change an unknown input topic which is why it didn't worked. (So I think my other solution would have worked too)@Delb But as I said, I can't control the source node. I can't specify that it has to output to /cloud. I can only edit the launch file of the Laser Scan Matcher node.
Oh yes I ommited that sorry. (You should now mark your question as closed since the problem is solved)
Please don't do that.
@OperationCrossbow: please post what you ended up using that solved your question as an answer. Then accept your own answer.
We tend to not close questions here on ROS Answers. We mark them answered.
@gvdhoorn It says "You should now mark your question as closed since the problem is solved" above your comment. I'm getting conflicting information here. Also, ROS Answers tells me I have insufficient points to accept my own answer.
@OperationCrossbow: @Delb may not be aware of this 'policy'. I did not make this up myself, I'm just passing along what I've observed over the past 5 years (yes, that is a logical fallacy) and has worked well.
An answered question is clearly visible as such: it gets a checkmark. A closed ..