Skip to content

Commit

Permalink
Fix segfault caused by uninitialized publisher
Browse files Browse the repository at this point in the history
Crash occurs for example when running the demo_warehouse.launch with
ROS 1. Debug build + gdb revealed that the issue was this publisher.
  • Loading branch information
MichaelGrupp committed Dec 4, 2024
1 parent 5fb5eac commit 2c7616f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mvsim_node_src/mvsim_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ros::Publisher>(
n_.advertise<Msg_Image>(vehVarName(img_topic, veh), publisher_history_len_));
pubCamInfo = mvsim_node::make_shared<ros::Publisher>(
n_.advertise<Msg_CameraInfo>(vehVarName(camInfo_topic, veh), publisher_history_len_));
#else
pubImg = mvsim_node::make_shared<PublisherWrapper<Msg_Image>>(
n_, vehVarName(img_topic, veh), publisher_history_len_);
Expand Down

0 comments on commit 2c7616f

Please sign in to comment.