Skip to content

Commit

Permalink
ros2param WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov committed Jun 11, 2024
1 parent 21df44f commit c6c69ee
Show file tree
Hide file tree
Showing 49 changed files with 1,306 additions and 169 deletions.
56 changes: 42 additions & 14 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,9 +30,8 @@ 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
- run: $APT fakeroot devscripts build-essential
- run: |
Expand All @@ -45,7 +44,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 +53,31 @@ 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_CI_DESKTOP: jammy

steps:
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- 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,9 +92,8 @@ 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
- run: |
source /opt/ros/$ROS_DISTRO/setup.bash
Expand All @@ -96,9 +109,8 @@ 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
- run: |
source /opt/ros/$ROS_DISTRO/setup.bash
Expand All @@ -109,7 +121,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,21 +139,37 @@ 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
- run: $APT clang-tools-12 clang-tidy-12
- run: |
source /opt/ros/$ROS_DISTRO/setup.bash
make clangcheck SCANBUILD=scan-build-12 OPTIONS=ros_tidy TC=gcc
jammy_gcc_ros_scanbuild:
runs-on: ubuntu-22.04

env:
ROS_DISTRO: humble
ROS_CI_DESKTOP: jammy

steps:
- uses: actions/checkout@v4
- run: sudo make install-ros ROS_DISTRO=$ROS_DISTRO UBUNTU_DISTRO=$ROS_CI_DESKTOP
- run: sudo make install-deps
- run: $APT clang-tools-15 clang-tidy-15
- run: |
source /opt/ros/$ROS_DISTRO/setup.bash
make clangcheck SCANBUILD=scan-build-15 OPTIONS=ros_tidy TC=gcc
jammy_gcc_noros_scanbuild:
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
35 changes: 19 additions & 16 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 Expand Up @@ -179,27 +184,25 @@ dox: doxclean clean


install-ros:
sh -c "echo \"deb http://packages.ros.org/ros/ubuntu ${UBUNTU_DISTRO} main\" > /etc/apt/sources.list.d/ros-latest.list"
sh -c "apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \
|| apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \
|| apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654"
sh -c "apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 6B05F25D762E3157 \
|| apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 6B05F25D762E3157 \
|| apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 6B05F25D762E3157"
apt update -qq
${APT_INSTALL} dpkg
${APT_INSTALL} ros-${ROS_DISTRO}-ros-base
wget -qO- https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo tee /etc/apt/trusted.gpg.d/ros.asc
${MAKE} install-ros-${ROS_DISTRO}
${APT_INSTALL} dpkg
${APT_INSTALL} python3-rosdep python3-rosinstall python3-rosinstall-generator build-essential
bash -c 'source /opt/ros/${ROS_DISTRO}/setup.bash; rosdep init'
rosdep update

install-ros-%:
${APT_INSTALL} python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
install-ros-noetic:
sh -c 'test -f /etc/apt/sources.list.d/ros-latest.list \
|| (echo "deb http://packages.ros.org/ros/ubuntu ${UBUNTU_DISTRO} main" > /etc/apt/sources.list.d/ros-latest.list)'
apt update -qq
${APT_INSTALL} ros-${ROS_DISTRO}-ros-base

install-ros-melodic: install-ros-kinetic
#
install-ros-humble:
sh -c 'test -f /etc/apt/sources.list.d/ros2-latest.list \
|| (echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main ${UBUNTU_DISTRO} main" > /etc/apt/sources.list.d/ros2-latest.list)'
apt update -qq
${APT_INSTALL} ros-${ROS_DISTRO}-rclcpp

install-ros-kinetic:
${APT_INSTALL} python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential

install-deps:
${APT_INSTALL} cmake libboost-all-dev libeigen3-dev
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 "")
5 changes: 3 additions & 2 deletions extra_visitors/graphviz/src/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ namespace ariles2


public:
explicit NodeWrapper(const std::string &node, const Base::Type type = Base::GENERIC) : Base(node, type)
explicit NodeWrapper(const std::string &node, const Base::Type type = Base::Type::GENERIC)
: Base(node, type)
{
label_ = node;
actual_id_ = node;
Expand All @@ -42,7 +43,7 @@ namespace ariles2
explicit NodeWrapper(
const std::string &node,
const std::string &label,
const Base::Type type = Base::GENERIC)
const Base::Type type = Base::Type::GENERIC)
: Base(node, type)
{
label_ = label;
Expand Down
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
Loading

0 comments on commit c6c69ee

Please sign in to comment.