Skip to content

Commit 006b1ab

Browse files
authored
fix closed-set rosbag recorder and relabel syntax (#21)
1 parent c6b611c commit 006b1ab

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

semantic_inference_ros/app/closed_set_rosbag_writer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ CvImage::Ptr ClosedSetRosbagWriter::runSegmentation(const CvImage& image,
371371
const auto derotated = rotator.derotate(result.labels);
372372
auto labels = std::make_shared<cv_bridge::CvImage>();
373373
labels->header = image.header;
374+
labels->encoding = "16SC1"; // 16-bit signed, single channel
374375
derotated.convertTo(labels->image, CV_16S);
375376
return labels;
376377
}

semantic_inference_ros/launch/closed_set.launch.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ launch:
5555
- node: # Remapping pre-recorded labels
5656
if: $(var use_prerecorded)
5757
pkg: semantic_inference_ros
58-
exec: recolor_node
58+
exec: relabel_node
5959
name: semantic_inference
6060
on_exit: shutdown
6161
args: |
6262
$(if $(not $(var verbose)) --disable-stdout-logs)
63-
--config-utilities-file $(find-pkg-share semantic_inference_ros)/config/label_groupings/$(var labelspace_name).yaml
63+
--config-utilities-file $(find-pkg-share semantic_inference_ros)/config/label_groupings/$(var labelspace_name).yaml@output/recolor
6464
--config-utilities-yaml {worker: {max_queue_size: $(var max_image_queue_size), image_separation_s: $(var min_separation_s)}}
65+
--config-utilities-yaml {output: {recolor: {colormap_path: $(var colormap_path)}}}
6566
- arg: {name: run_backprojection, default: 'false', description: Triggers decompression for RGB stream}
6667
- arg: {name: backprojection_config, default: '{}', description: Extra parameters for backprojection}
6768
- node: # 2D semantic segmentation

semantic_inference_ros/src/relabel_nodelet.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
* * -------------------------------------------------------------------------- */
3131

32+
#include <config_utilities/config_utilities.h>
33+
#include <config_utilities/parsing/commandline.h>
3234
#include <config_utilities/printing.h>
3335
#include <config_utilities/validation.h>
3436
#include <ianvs/image_subscription.h>
@@ -87,7 +89,10 @@ void declare_config(RelabelNode::Config& config) {
8789
}
8890

8991
RelabelNode::RelabelNode(const rclcpp::NodeOptions& options)
90-
: Node("recolor_node", options), color_sub_(*this), label_sub_(*this) {
92+
: Node("recolor_node", options),
93+
config_(config::fromCLI<Config>(options.arguments())),
94+
color_sub_(*this),
95+
label_sub_(*this) {
9196
logging::Logger::addSink("ros", std::make_shared<RosLogSink>(get_logger()));
9297
logging::setConfigUtilitiesLogger();
9398

0 commit comments

Comments
 (0)