Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segfault caused by uninitialized publisher #59

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
MichaelGrupp committed Dec 4, 2024
commit 2c7616ffa8c8cb0c9f2c0b61c11eee944cc9f2ae
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
Loading