File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,14 @@ target_include_directories(${PROJECT_NAME} PUBLIC
43
43
target_compile_definitions (${PROJECT_NAME} PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS" )
44
44
target_compile_definitions (${PROJECT_NAME} PRIVATE "OCTOMAP_RVIZ_PLUGINS_BUILDING_LIBRARY" )
45
45
46
+ # Check version of rclcpp to switch between features (message_lost_callback):
47
+ # - Foxy is on rclcpp 2.x
48
+ # - Galactic is on rclcpp 9.x
49
+ # - Rolling (currently) is on rclcpp 14.x
50
+ if (${rclcpp_VERSION_MAJOR} VERSION_LESS "3.0.0" )
51
+ target_compile_definitions (${PROJECT_NAME} PRIVATE "FOXY" )
52
+ endif ()
53
+
46
54
pluginlib_export_plugin_description_file (rviz_common plugins_description.xml )
47
55
48
56
if (BUILD_TESTING )
Original file line number Diff line number Diff line change @@ -235,6 +235,7 @@ void OccupancyMapDisplay::subscribeToUpdateTopic()
235
235
{
236
236
try {
237
237
rclcpp::SubscriptionOptions sub_opts;
238
+ #ifndef FOXY
238
239
sub_opts.event_callbacks .message_lost_callback =
239
240
[&](rclcpp::QOSMessageLostInfo & info)
240
241
{
@@ -246,6 +247,7 @@ void OccupancyMapDisplay::subscribeToUpdateTopic()
246
247
rviz_common::properties::StatusProperty::Warn, " Update Topic" ,
247
248
QString (sstm.str ().c_str ()));
248
249
};
250
+ #endif
249
251
250
252
update_subscription_ =
251
253
rviz_ros_node_.lock ()->get_raw_node ()->
You can’t perform that action at this time.
0 commit comments