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

Remove the default all signal handler to avoid signal_handler message and FULL ROS MESSAGE QUEUE error #456

Merged
merged 7 commits into from
Nov 25, 2024
6 changes: 2 additions & 4 deletions plugins/ROS/src/mc_rtc_ros/ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
# include <sensor_msgs/msg/joint_state.hpp>
# include <std_msgs/msg/string.hpp>

# include <rclcpp/init_options.hpp>
# include <rclcpp/rclcpp.hpp>
#else
# include <geometry_msgs/WrenchStamped.h>
# include <mc_rtc_msgs/JointSensors.h>
# include <nav_msgs/Odometry.h>
# include <sensor_msgs/Imu.h>
# include <sensor_msgs/JointState.h>

Expand Down Expand Up @@ -586,7 +584,7 @@ inline bool ros_init([[maybe_unused]] const std::string & name)
if(ros::ok()) { return true; }
int argc = 0;
#ifdef MC_RTC_ROS_IS_ROS2
rclcpp::init(argc, nullptr);
rclcpp::init(argc, nullptr, rclcpp::InitOptions(), rclcpp::SignalHandlerOptions::SigTerm);
#else
ros::init(argc, nullptr, name.c_str(), ros::init_options::NoSigintHandler);
if(!ros::master::check())
Expand Down
12 changes: 8 additions & 4 deletions src/mc_rtcMacros.in.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,14 @@ macro(find_description_package PACKAGE)
find_package(${PACKAGE} REQUIRED)
if("${${PACKAGE}_INSTALL_PREFIX}" STREQUAL "")
if("${${PACKAGE}_SOURCE_PREFIX}" STREQUAL "")
message(
FATAL_ERROR
"Your ${PACKAGE} does not define where to find the data, please update."
)
if("${${PACKAGE}_DIR}" STREQUAL "")
message(
FATAL_ERROR
"Your ${PACKAGE} does not define where to find the data, please update."
)
else()
set(${PACKAGE_PATH_VAR} "${${PACKAGE}_DIR}/..")
endif()
else()
set(${PACKAGE_PATH_VAR} "${${PACKAGE}_SOURCE_PREFIX}")
endif()
Expand Down
Loading