From 2c7616ffa8c8cb0c9f2c0b61c11eee944cc9f2ae Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Wed, 4 Dec 2024 16:02:59 +0100 Subject: [PATCH] Fix segfault caused by uninitialized publisher Crash occurs for example when running the demo_warehouse.launch with ROS 1. Debug build + gdb revealed that the issue was this publisher. --- mvsim_node_src/mvsim_node.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mvsim_node_src/mvsim_node.cpp b/mvsim_node_src/mvsim_node.cpp index f756794a..ca9c0b30 100644 --- a/mvsim_node_src/mvsim_node.cpp +++ b/mvsim_node_src/mvsim_node.cpp @@ -1264,6 +1264,8 @@ void MVSimNode::internalOn(const mvsim::VehicleBase& veh, const mrpt::obs::CObse #if PACKAGE_ROS_VERSION == 1 pubImg = mvsim_node::make_shared( n_.advertise(vehVarName(img_topic, veh), publisher_history_len_)); + pubCamInfo = mvsim_node::make_shared( + n_.advertise(vehVarName(camInfo_topic, veh), publisher_history_len_)); #else pubImg = mvsim_node::make_shared>( n_, vehVarName(img_topic, veh), publisher_history_len_);