Skip to content

Commit 242069e

Browse files
committed
c++14 in CML for ros-noetic & fix fisrt time not displayed
1 parent 01d4e2b commit 242069e

9 files changed

Lines changed: 94 additions & 76 deletions

File tree

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
1+
/opt/ros/noetic/share/catkin/cmake/toplevel.cmake

src/map_gen/map_generator/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.3)
22
project(map_generator)
33

44
set(CMAKE_BUILD_TYPE "Release")
5-
set(CMAKE_CXX_FLAGS "-std=c++11")
5+
set(CMAKE_CXX_FLAGS "-std=c++14")
66
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g")
77

88
find_package(catkin REQUIRED COMPONENTS

src/map_gen/mockamap/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.3)
22
project(mockamap)
33

44
## Compile as C++11, supported in ROS Kinetic and newer
5-
add_compile_options(-std=c++11)
5+
add_compile_options(-std=c++14)
66

77
## Find catkin macros and libraries
88
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)

src/occ_grid/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.3)
22
project(occ_grid)
33

44
set(CMAKE_BUILD_TYPE "Release")
5-
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS} -O3 -Wall")
5+
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS} -O3 -Wall")
66

77
find_package(catkin REQUIRED COMPONENTS
88
roscpp

src/path_finder/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.0.2)
22
project(path_finder)
33

4-
add_compile_options(-std=c++11)
4+
add_compile_options(-std=c++14)
55
set(CMAKE_BUILD_TYPE "Release")
66
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -fPIC")
77

src/path_finder/include/visualization/visualization.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,15 @@ namespace visualization
510510
}
511511
publisher_map_[topic].publish(path_list_msg);
512512
}
513+
514+
template <class TOPIC_TYPE, class TOPIC>
515+
void registe(const TOPIC& topic) {
516+
auto got = publisher_map_.find(topic);
517+
if (got == publisher_map_.end()) {
518+
ros::Publisher pub = nh_.advertise<TOPIC_TYPE>(topic, 10);
519+
publisher_map_[topic] = pub;
520+
}
521+
}
513522
};
514523

515524
} // namespace visualization

0 commit comments

Comments
 (0)