Skip to content

Commit

Permalink
ros2param WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov committed Jun 7, 2024
1 parent 21df44f commit 5d3461c
Show file tree
Hide file tree
Showing 47 changed files with 1,112 additions and 135 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/head_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo make install-deps
- run: $APT fakeroot devscripts build-essential
- run: |
Expand All @@ -30,7 +30,7 @@ jobs:
ROS_CI_DESKTOP: focal

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- run: rosdep update
- run: sudo make install-deps
Expand All @@ -45,7 +45,7 @@ jobs:
clang_noros:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo apt update
- run: sudo make install-deps
- run: make build-tests TYPE=Debug OPTIONS=noros TARGETS="all" TC=clang ARGS=-V
Expand All @@ -54,16 +54,33 @@ jobs:
jammy_gcc_noros:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo apt update
- run: sudo make install-deps
- run: make build-tests TYPE=Debug OPTIONS=noros TARGETS="all" TC=gcc ARGS=-V

jammy_gcc_ros:
runs-on: ubuntu-22.04

env:
ROS_DISTRO: humble
ROS_HOSTNAME: localhost
ROS_CI_DESKTOP: jammy

steps:
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- run: rosdep update
- run: sudo make install-deps
- run: |
source /opt/ros/$ROS_DISTRO/setup.bash
make build-tests TYPE=Debug OPTIONS=ros2 TARGETS="all" TC=gcc ARGS=-V
focal_gcc_noros:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo apt update
- run: sudo make install-deps
- run: make build-tests TYPE=Debug OPTIONS=noros TARGETS="all" TC=gcc ARGS=-V
Expand All @@ -78,7 +95,7 @@ jobs:
ROS_CI_DESKTOP: focal

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- run: rosdep update
- run: sudo make install-deps
Expand All @@ -96,7 +113,7 @@ jobs:
ROS_CI_DESKTOP: focal

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- run: rosdep update
- run: sudo make install-deps
Expand All @@ -109,7 +126,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo apt update
- run: $APT cppcheck
- run: $APT python3-pip python3-setuptools
Expand All @@ -127,7 +144,7 @@ jobs:
ROS_CI_DESKTOP: focal

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- run: rosdep update
- run: sudo make install-deps
Expand All @@ -141,7 +158,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo apt update
- run: sudo make install-deps
- run: $APT clang-tools-14 clang-tidy-14
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
DEB_TARGET: jammy

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo make install-deps
- run: $APT fakeroot devscripts build-essential
- run: make deb-build DEB_TARGET=$DEB_TARGET
Expand All @@ -36,7 +36,7 @@ jobs:
DEB_TARGET: focal

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- run: rosdep update
- run: sudo make install-deps
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ option (ARILES_VERBOSE "Verbose build" ON)
option (ARILES_BUILD_REGRESSION_TESTS "Build regression tests." ON)
option (ARILES_CCACHE "Enable ccache if available" ON)
set (ARILES_DEB_TARGETS "" CACHE STRING "Enable debian package generation.")
set (ARILES_CPP_STANDARD "11" CACHE STRING "14 is required for boost >= 1.82, 11 is still ok for ariles")
set (ARILES_CPP_STANDARD "17" CACHE STRING "must not be older than 17")

# install parameters
set (ARILES_PKGCONFIG_INSTALL_PATH "" CACHE STRING "pkg-config pc-file install path, not installed if empty")
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ test-ros: clean
${MAKE} build-tests TC=${TC} TYPE=Debug OPTIONS=ros TARGETS="${TARGETS}" EXTRA_CMAKE_PARAM="${EXTRA_CMAKE_PARAM}"


test-ros2: clean
#${MAKE} build-tests TC=${TC} TYPE=Debug OPTIONS=default TARGETS="${TARGETS}" EXTRA_CMAKE_PARAM="${EXTRA_CMAKE_PARAM}"
${MAKE} build-tests TC=${TC} TYPE=Debug OPTIONS=ros2 TARGETS="${TARGETS}" EXTRA_CMAKE_PARAM="${EXTRA_CMAKE_PARAM}"


test-noros: clean
${MAKE} build-tests TC=${TC} TYPE=Debug OPTIONS=noros TARGETS="${TARGETS}" EXTRA_CMAKE_PARAM="${EXTRA_CMAKE_PARAM}"
${MAKE} clangcheck SCANBUILD=scan-build15 OPTIONS=noros_tidy
Expand Down
2 changes: 2 additions & 0 deletions cmake/cmakeut_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ function(cmakeut_compiler_flags STANDARD)
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay")
# long functions are ok
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-google-readability-function-size,-readability-function-size,-hicpp-function-size")
# do not enforce nested namespace concatenation
set(CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY},-modernize-concat-nested-namespaces")


# overly restrictive fuchsia stuff
Expand Down
1 change: 1 addition & 0 deletions cmake/options_deb_packages_bionic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ set(ARILES_BUILD_REGRESSION_TESTS "OFF" CACHE STRING "")

set(ARILES_VISITORS_DEFAULT_MODE "ON" CACHE STRING "")
set(ARILES_VISITOR_rosparam "$ENV{ROS_DISTRO}" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
1 change: 1 addition & 0 deletions cmake/options_deb_packages_focal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ set(ARILES_BUILD_REGRESSION_TESTS "OFF" CACHE STRING "")
set(ARILES_VISITORS_DEFAULT_MODE "ON" CACHE STRING "")
set(ARILES_VISITOR_rosparam "$ENV{ROS_DISTRO}" CACHE STRING "")
set(ARILES_VISITOR_msgpack "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
1 change: 1 addition & 0 deletions cmake/options_deb_packages_jammy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ set(ARILES_BUILD_REGRESSION_TESTS "OFF" CACHE STRING "")

set(ARILES_VISITORS_DEFAULT_MODE "ON" CACHE STRING "")
set(ARILES_VISITOR_rosparam "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "$ENV{ROS_DISTRO}" CACHE STRING "")
1 change: 1 addition & 0 deletions cmake/options_deb_packages_xenial.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ set(ARILES_VISITORS_DEFAULT_MODE "ON" CACHE STRING "")
set(ARILES_VISITOR_rosparam "$ENV{ROS_DISTRO}" CACHE STRING "")
set(ARILES_VISITOR_jsonnet "OFF" CACHE STRING "")
set(ARILES_VISITOR_msgpack "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
2 changes: 1 addition & 1 deletion cmake/options_default.cmake
Original file line number Diff line number Diff line change
@@ -1 +1 @@
set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
3 changes: 2 additions & 1 deletion cmake/options_noros.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")

set(ARILES_VISITOR_graphviz "ON" CACHE STRING "")
set(ARILES_VISITOR_pugixml "ON" CACHE STRING "")
Expand All @@ -7,3 +7,4 @@ set(ARILES_VISITOR_jsonnet "ON" CACHE STRING "")
set(ARILES_VISITOR_msgpack "ON" CACHE STRING "")
set(ARILES_VISITOR_yaml_cpp "ON" CACHE STRING "")
set(ARILES_VISITOR_rosparam "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
3 changes: 2 additions & 1 deletion cmake/options_noros_tidy.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
set(ARILES_CPP_CLANG_TIDY "ON" CACHE STRING "")

set(ARILES_VISITOR_graphviz "ON" CACHE STRING "")
Expand All @@ -8,3 +8,4 @@ set(ARILES_VISITOR_jsonnet "ON" CACHE STRING "")
set(ARILES_VISITOR_msgpack "ON" CACHE STRING "")
set(ARILES_VISITOR_yaml_cpp "ON" CACHE STRING "")
set(ARILES_VISITOR_rosparam "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
3 changes: 2 additions & 1 deletion cmake/options_noros_xenial.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#- rapidjson-dev # not found
#- libmsgpack-dev # version is too old

set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")

set(ARILES_VISITOR_graphviz "ON" CACHE STRING "")
set(ARILES_VISITOR_pugixml "ON" CACHE STRING "")
Expand All @@ -10,3 +10,4 @@ set(ARILES_VISITOR_jsonnet "OFF" CACHE STRING "")
set(ARILES_VISITOR_msgpack "OFF" CACHE STRING "")
set(ARILES_VISITOR_yaml_cpp "ON" CACHE STRING "")
set(ARILES_VISITOR_rosparam "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
3 changes: 2 additions & 1 deletion cmake/options_ros.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")

set(ARILES_VISITOR_msgpack "OFF" CACHE STRING "")
set(ARILES_VISITOR_pugixml "OFF" CACHE STRING "")
set(ARILES_VISITOR_rapidjson "OFF" CACHE STRING "")
set(ARILES_VISITOR_jsonnet "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
7 changes: 7 additions & 0 deletions cmake/options_ros2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")

set(ARILES_VISITOR_msgpack "OFF" CACHE STRING "")
set(ARILES_VISITOR_pugixml "OFF" CACHE STRING "")
set(ARILES_VISITOR_rapidjson "OFF" CACHE STRING "")
set(ARILES_VISITOR_jsonnet "OFF" CACHE STRING "")
set(ARILES_VISITOR_rosparam "OFF" CACHE STRING "")
8 changes: 8 additions & 0 deletions cmake/options_ros2_tidy.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
set(ARILES_CPP_CLANG_TIDY "ON" CACHE STRING "")

set(ARILES_VISITOR_msgpack "OFF" CACHE STRING "")
set(ARILES_VISITOR_pugixml "OFF" CACHE STRING "")
set(ARILES_VISITOR_rapidjson "OFF" CACHE STRING "")
set(ARILES_VISITOR_jsonnet "OFF" CACHE STRING "")
set(ARILES_VISITOR_rosparam "OFF" CACHE STRING "")
3 changes: 2 additions & 1 deletion cmake/options_ros_tidy.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
#set(ARILES_CPP_SANITIZERS "ON" CACHE STRING "")
set(ARILES_CPP_CLANG_TIDY "ON" CACHE STRING "")

set(ARILES_VISITOR_msgpack "OFF" CACHE STRING "")
set(ARILES_VISITOR_pugixml "OFF" CACHE STRING "")
set(ARILES_VISITOR_rapidjson "OFF" CACHE STRING "")
set(ARILES_VISITOR_jsonnet "OFF" CACHE STRING "")
set(ARILES_VISITOR_ros2param "OFF" CACHE STRING "")
2 changes: 1 addition & 1 deletion extra_visitors/msgpack/src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace ariles2
{
ARILES2_ASSERT(
impl_->node_stack_.back().index_ < impl_->node_stack_.back().size_,
"Internal error: namevalue.has more elements than expected.");
"Internal error: array has more elements than expected.");
}


Expand Down
4 changes: 2 additions & 2 deletions extra_visitors/msgpack/src/reader_compact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace ariles2
void Reader::endMap()
{
ARILES2_ASSERT(
impl_->node_stack_.back().isAllParsed(),
impl_->node_stack_.back().isCompleted(),
"Some entries were not parsed, which is not allowed by this visitor.");
impl_->node_stack_.pop_back();
}
Expand All @@ -166,7 +166,7 @@ namespace ariles2
{
ARILES2_ASSERT(
impl_->node_stack_.back().index_ < impl_->node_stack_.back().size_,
"Internal error: namevalue.has more elements than expected.");
"Internal error: array has more elements than expected.");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ namespace ariles2
std::string node;
if (node_stack_.back().isArray())
{
node.reserve(node_stack_.back().node_.size() + map_name.size() + 15);
node.reserve(node_stack_.back().node_.size() + map_name.size() + num_chars_for_index_reserve + 3);

node = node_stack_.back().node_;
node += "{";
Expand Down
4 changes: 2 additions & 2 deletions extra_visitors/octave/src/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace ariles2
std::string node;
if (impl_->node_stack_.back().isArray())
{
node.reserve(impl_->node_stack_.back().node_.size() + map_name.size() + 15);
node.reserve(impl_->node_stack_.back().node_.size() + map_name.size() + num_chars_for_index_reserve + 3);

node = impl_->node_stack_.back().node_;
node += "{";
Expand Down Expand Up @@ -153,7 +153,7 @@ namespace ariles2
if (impl_->node_stack_.back().isArray())
{
std::string node;
node.reserve(impl_->node_stack_.back().node_.size() + 15);
node.reserve(impl_->node_stack_.back().node_.size() + num_chars_for_index_reserve + 2);
node = impl_->node_stack_.back().node_;
node += "{";
node += boost::lexical_cast<std::string>(impl_->node_stack_.back().index_ + 1);
Expand Down
2 changes: 1 addition & 1 deletion extra_visitors/pugixml/src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace ariles2
{
ARILES2_ASSERT(
impl_->node_stack_.back().index_ < impl_->node_stack_.back().size_,
"Internal error: namevalue.has more elements than expected.");
"Internal error: array has more elements than expected.");
}


Expand Down
2 changes: 1 addition & 1 deletion extra_visitors/pugixml/src/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace ariles2
{
ARILES2_ASSERT(
impl_->node_stack_.back().index_ < impl_->node_stack_.back().size_,
"Internal error: namevalue.has more elements than expected.");
"Internal error: array has more elements than expected.");
impl_->node_stack_.emplace_back(impl_->getRawNode().append_child("item"));
}

Expand Down
2 changes: 1 addition & 1 deletion extra_visitors/rapidjson/src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace ariles2
{
ARILES2_ASSERT(
impl_->node_stack_.back().index_ < impl_->node_stack_.back().size_,
"Internal error: namevalue.has more elements than expected.");
"Internal error: array has more elements than expected.");
}


Expand Down
2 changes: 1 addition & 1 deletion extra_visitors/rapidjson/src/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace ariles2
ARILES2_TRACE_FUNCTION;
ARILES2_ASSERT(
impl_->node_stack_.back().index_ < impl_->node_stack_.back().size_,
"Internal error: namevalue.has more elements than expected.");
"Internal error: array has more elements than expected.");
}

void Writer::endArrayElement()
Expand Down
21 changes: 21 additions & 0 deletions extra_visitors/ros2param/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set (TGT_ARILES_VISITOR_LIB "${PROJECT_NAME}_visitor_${ARILES_VISITOR}")

if(NOT ARILES_DEB_TARGETS)
cmake_policy(SET CMP0057 NEW) # Support new ``if()`` IN_LIST operator.
find_package(rclcpp REQUIRED)
endif()

add_library(${TGT_ARILES_VISITOR_LIB}
${ARILES_VISITOR_${ARILES_VISITOR}_DIR}/src/reader.cpp
${ARILES_VISITOR_${ARILES_VISITOR}_DIR}/src/writer.cpp
)

if(NOT ARILES_DEB_TARGETS)
target_link_libraries(${TGT_ARILES_VISITOR_LIB} PUBLIC
rclcpp::rclcpp
)
endif()

include(ariles_install_component)
set(ARILES_ROS_DISTRO "${ARILES_VISITOR_ros2param}")
set(DEB_${ARILES_COMPONENT}_DEPENDS "ros-${ARILES_ROS_DISTRO}-rclcpp")
Loading

0 comments on commit 5d3461c

Please sign in to comment.