ros-perception / point_cloud_transport

Point Cloud Compression for ROS
BSD 3-Clause "New" or "Revised" License
77 stars 7 forks source link

Out topic remap not taken #78

Closed ggari-robotnik closed 5 months ago

ggari-robotnik commented 6 months ago

Hello, I'm trying run the republisher remapping the output topic in humble using the following command:

ros2 run point_cloud_transport republish \
--out_transport draco \
--in_transport raw \
--ros-args \
--log-level info \
 --ros-args \
-r __node:=point_cloud_republisher \
--remap in:=/point_cloud \
--remap out:=/poincloud_draco

But the out topic seems that is not taken and is defaulting to /out/draco

[INFO] [1713198597.475201657] [point_cloud_republisher]: The 'in_transport' parameter is set to: raw
[INFO] [1713198597.475261540] [point_cloud_republisher]: The 'out_transport' parameter is set to: draco
[INFO] [1713198597.476097114] [point_cloud_republisher]: Loading point_cloud_transport/draco_pub publisher
[INFO] [1713198597.477814567] [point_cloud_republisher]: out topic2: /out/draco
[INFO] [1713198597.477827048] [point_cloud_republisher]: Loading /in subscriber
[INFO] [1713198597.478279231] [point_cloud_republisher]: Subscribing to: /point_cloud

[INFO] [1713198597.478294071] [point_cloud_republisher]: in topic: /point_cloud

Any idea how to solve this?

ggari-robotnik commented 6 months ago

Any ideas?

john-maidbot commented 5 months ago

Hello,

Two things to address

  1. this syntax
--out_transport draco \
--in_transport raw \

is no longer recognized in our humble/iron/rolling builds. in_transport and out_transport are now expected to provided as ros2 params.

ros2 run point_cloud_transport republish --ros-args -p in_transport:=raw -p out_transport:=draco

but if you are on an older version, you can ignore this. just fyi

  1. --remap is working very literally. please replace
--remap out:=/poincloud_draco

with the specific output topic for the transport you are using, e.g.

--remap out/draco:=/poincloud_draco

To summarize, the updated version of your command that should work (worked on my end at least) is

ros2 run point_cloud_transport republish \
--ros-args -p out_transport:=draco \
-p in_transport:=raw \
--ros-args \
--log-level info \
 --ros-args \
-r __node:=point_cloud_republisher \
--remap in:=/point_cloud \
--remap out/draco:=/pointcloud_draco

Testing on my end:

Terminal 1:

jjdang@jjdang:~/Desktop/experiment_ws$ ros2 run point_cloud_transport republish \
--ros-args -p out_transport:=draco \
-p in_transport:=raw \
--ros-args \
--log-level info \
 --ros-args \
-r __node:=point_cloud_republisher \
--remap in:=/point_cloud \
--remap out/draco:=/pointcloud_draco
[INFO] [1715448387.242843853] [point_cloud_republisher]: The 'in_transport' parameter is set to: raw
[INFO] [1715448387.243097507] [point_cloud_republisher]: The 'out_transport' parameter is set to: draco
[INFO] [1715448387.252981209] [point_cloud_republisher]: Loading point_cloud_transport/draco_pub publisher
[INFO] [1715448387.257361519] [point_cloud_republisher]: out topic2: /poincloud_draco
[INFO] [1715448387.257388017] [point_cloud_republisher]: Loading /in subscriber
[INFO] [1715448387.258394772] [point_cloud_republisher]: Subscribing to: /point_cloud

[INFO] [1715448387.258431445] [point_cloud_republisher]: in topic: /point_cloud

Terminal 2:

jjdang@jjdang:~/Desktop/experiment_ws$ ros2 topic list
/parameter_events
/point_cloud
/pointcloud_draco
/rosout
john-maidbot commented 5 months ago

TL;DR for the remap, replace out with out/<out_transport>. in your case, that is out/draco

ggari-robotnik commented 5 months ago

Thanks!

it works