Skip to content

Commit

Permalink
Rename catkin -> ws to avoid confusion.
Browse files Browse the repository at this point in the history
  • Loading branch information
asherikov committed Jul 20, 2024
1 parent 0d4f928 commit 5ee26ae
Show file tree
Hide file tree
Showing 65 changed files with 733 additions and 219 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/catkin_2.yml → .github/workflows/ws_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
repository: asherikov/ccws
- uses: actions/checkout@v4
with:
path: src/ariles_catkin
path: src/ariles_ws
- run: make bp_install_build BUILD_PROFILE=reldebug
- run: make dep_install PKG=ariles2_ros2param_catkin
- run: make ariles2_ros2param_catkin
- run: make dep_install PKG=ariles2_ros2param_ws
- run: make ariles2_ros2param_ws
32 changes: 16 additions & 16 deletions .make/ros.mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PROJECT=ariles2

CATKIN_PKGS= \
ariles2_core_catkin \
ariles2_namevalue_catkin \
ariles2_graphviz_catkin \
ariles2_octave_catkin \
ariles2_rapidjson_catkin \
ariles2_yamlcpp_catkin \
ariles2_rosparam_catkin \
ariles2_pugixml_catkin

CATKIN_DEPENDENCY_TEST_PKG=ariles2_catkin_demo
WS_PKGS= \
ariles2_core_ws \
ariles2_namevalue2_ws \
ariles2_graphviz_ws \
ariles2_octave_ws \
ariles2_rapidjson_ws \
ariles2_yamlcpp_ws \
ariles2_rosparam_ws \
ariles2_pugixml_ws

CATKIN_DEPENDENCY_TEST_PKG=ariles2_ws_demo
CATKIN_ARGS=--cmake-args -DARILES_ROS_ENABLE_TESTS=ON
CATKIN_TARGETS=all test

Expand All @@ -28,7 +28,7 @@ ros_release:
# 0. Add Forthcoming section to the changelog
${MAKE} update_version VERSION=${VERSION}
-git commit -a
catkin_prepare_release -t 'catkin-' --version "${VERSION}" -y
catkin_prepare_release -t 'ws-' --version "${VERSION}" -y
# initial release -> https://wiki.ros.org/bloom/Tutorials/FirstTimeRelease
# subsequent releases -> bloom-release --rosdistro melodic --track melodic ${PKG}

Expand Down Expand Up @@ -73,7 +73,7 @@ catkin_test_deb: clean
${MAKE} catkin_prepare_workspace
${MAKE} catkin_fake_rosdep
mkdir -p build/dependency_test
echo ${CATKIN_PKGS} | tr " " "\n" | xargs -I {} ${MAKE} catkin_test_deb_pkg PKG="{}" ROS_DISTRO=${ROS_DISTRO}
echo ${WS_PKGS} | tr " " "\n" | xargs -I {} ${MAKE} catkin_test_deb_pkg PKG="{}" ROS_DISTRO=${ROS_DISTRO}
bash -c 'source /opt/ros/${ROS_DISTRO}/setup.bash; \
cd build/dependency_test; \
cmake ../../${DEPENDENCY_PATH}/; \
Expand All @@ -88,14 +88,14 @@ catkin_fake_rosdep:
# https://answers.ros.org/question/280213/generate-deb-from-dependent-res-package-locally/#280235
sudo /bin/sh -c 'echo "yaml file:///tmp/rosdep.yaml" > /etc/ros/rosdep/sources.list.d/50-ariles2.list'
sudo rm -Rf /tmp/rosdep.yaml
echo ${CATKIN_PKGS} | tr " " "\n" | \
echo ${WS_PKGS} | tr " " "\n" | \
xargs -I {} sudo /bin/sh -c 'echo "{}:" >> /tmp/rosdep.yaml; echo " ubuntu: [ros-${ROS_DISTRO}-{}]" | tr "_" "-" >> /tmp/rosdep.yaml'
rosdep update


catkin_old_build: catkin_prepare_workspace
cd ${CATKIN_WORKING_DIR}/src; catkin_init_workspace
cd ${CATKIN_WORKING_DIR}; catkin_make_isolated --pkg ${CATKIN_PKGS} ${CATKIN_ARGS} --make-args ${CATKIN_TARGETS} # old
cd ${CATKIN_WORKING_DIR}; catkin_make_isolated --pkg ${WS_PKGS} ${CATKIN_ARGS} --make-args ${CATKIN_TARGETS} # old

catkin_old_build_with_dependent: catkin_prepare_workspace
cd ${CATKIN_WORKING_DIR}/src; catkin_init_workspace
Expand All @@ -113,7 +113,7 @@ catkin_old_deb: catkin_prepare_workspace

catkin_new_build: catkin_prepare_workspace
cd ${CATKIN_WORKING_DIR}; catkin init
cd ${CATKIN_WORKING_DIR}; catkin build -i --verbose --summary ${CATKIN_PKGS} --make-args ${CATKIN_TARGETS} ${CATKIN_ARGS}
cd ${CATKIN_WORKING_DIR}; catkin build -i --verbose --summary ${WS_PKGS} --make-args ${CATKIN_TARGETS} ${CATKIN_ARGS}

catkin_new_build_with_dependent: catkin_prepare_workspace
cd ${CATKIN_PKGS_PATH}/demo; mv package.xml.disable package.xml
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
This is a proxy catkin package for Ariles serialization/configuration library,
see https://github.com/asherikov/ariles for more information.
This is a proxy ROS1/ROS2 package for Ariles serialization/configuration
library, see <https://github.com/asherikov/ariles> for more information.

Available data formats:
- yaml
- json
- ROS parameter server
- ROS2 parameters
- Octave script (output)
- array (flattened key-value pairs)
- namevalue2 (flattened key-value pairs)
- ...

Note: ariles is not a catkin package, use `catkin(DEPENDS ariles2_core_catkin)`
in your CMakeLists.txt, `find_package(catkin REQUIRED ariles2_core_catkin)`
Expand Down
12 changes: 3 additions & 9 deletions ariles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,19 @@ Ariles
<a href="https://github.com/asherikov/ariles/tree/pkg_catkin_2">pkg_catkin_2</a><br/>
(ROS/ROS2 packages)
</td>
<td align="center">
<a href="https://github.com/asherikov/ariles/tree/pkg_freebsd_2">pkg_freebsd_2</a><br/>
(FreeBSD package)
</td>
</tr>
<tr>
<th>CI status</th>
<td align="center">
<a href="https://github.com/asherikov/ariles/actions?query=workflow%3A.github%2Fworkflows%2Fhead_2.yml+branch%3Ahead_2">
<img src="https://github.com/asherikov/ariles/workflows/.github/workflows/head_2.yml/badge.svg?branch=head_2" alt="Build Status">
<img src="https://github.com/asherikov/ariles/actions/workflows/.github/workflows/head_2.yml/badge.svg?branch=head_2" alt="Build Status">
</a>
</td>
<td align="center">
<a href="https://github.com/asherikov/ariles/actions?query=workflow%3A.github%2Fworkflows%2Fcatkin_2.yml+branch%3Apkg_catkin_2">
<img src="https://github.com/asherikov/ariles/workflows/.github/workflows/catkin_2.yml/badge.svg?branch=pkg_catkin_2" alt="Build Status">
<img src="https://github.com/asherikov/ariles/actions/workflows/.github/workflows/catkin_2.yml/badge.svg?branch=pkg_catkin_2" alt="Build Status">
</a>
</td>
<td align="center"></td>
</tr>
<tr>
<th>package</th>
Expand All @@ -45,7 +40,6 @@ Ariles
</a>
</td>
<td align="center"></td>
<td align="center"></td>
</tr>
</table>

Expand Down Expand Up @@ -187,7 +181,7 @@ representation formats, in particular:
<https://asherikov.github.io/ariles/2/group__rosparam.html>

* A set of flattened key-value pairs, output only, no dependencies:
<https://asherikov.github.io/ariles/2/group__namevalue.html>
<https://asherikov.github.io/ariles/2/group__namevalue2.html>

* `graphviz` dot files for diagram generation:
<https://asherikov.github.io/ariles/2/group__graphviz.html>
Expand Down
2 changes: 1 addition & 1 deletion ariles/cmake/cmakeut_compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function(cmakeut_compiler_flags STANDARD)


if (CMAKEUT_CLANG_TIDY)
find_program(CLANG_TIDY_EXECUTABLE NAMES clang-tidy clang-tidy18 clang-tidy15 clang-tidy-14 clang-tidy-12 REQUIRED)
find_program(CLANG_TIDY_EXECUTABLE NAMES clang-tidy clang-tidy18 clang-tidy15 clang-tidy-15 clang-tidy-14 clang-tidy-12 REQUIRED)

set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE};-warnings-as-errors=*;-checks=*")

Expand Down
12 changes: 6 additions & 6 deletions ariles/extra_visitors/graphviz/ariles2/visitors/graphviz.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ namespace ariles2
void endArrayElement();
void endArray();


template <class t_Ariles>
const Parameters getParameters(const t_Ariles &ariles_class) const
{
return (ariles_class.arilesGetParameters(*this));
}
/*
template <class t_Ariles>
const Parameters getParameters(const t_Ariles &ariles_class) const
{
return (ariles_class.arilesGetParameters(*this));
}*/

template <class t_Entry>
void startMap(t_Entry &, const Parameters &parameters)
Expand Down
2 changes: 1 addition & 1 deletion ariles/extra_visitors/msgpack/src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace ariles2
}
catch (const std::exception &e)
{
CPPUT_THROW(std::string("Failed to parse the configuration file: ") + e.what());
CPPUT_THROW("Failed to parse the configuration file: ", e.what());
}

nameless_counter_ = 0;
Expand Down
2 changes: 1 addition & 1 deletion ariles/extra_visitors/msgpack/src/reader_compact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace ariles2
}
catch (const std::exception &e)
{
CPPUT_THROW(std::string("Failed to parse the configuration file: ") + e.what());
CPPUT_THROW("Failed to parse the configuration file: ", e.what());
}
}

Expand Down
2 changes: 2 additions & 0 deletions ariles/extra_visitors/namevalue/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deprecated, use namevalue2.

7 changes: 7 additions & 0 deletions ariles/extra_visitors/namevalue2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set (TGT_ARILES_VISITOR_LIB "${PROJECT_NAME}_visitor_${ARILES_VISITOR}")

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

include(ariles_install_component)
104 changes: 104 additions & 0 deletions ariles/extra_visitors/namevalue2/ariles2/visitors/namevalue2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
@file
@author Alexander Sherikov
@copyright 2018-2024 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
(see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
@brief
*/

/**
@defgroup namevalue2 NameValue2
@ingroup config
@brief Generates a set of <std::string, double> pairs with flattened member names,
e.g., <"ariles_class.class_member.real_member", 3.4>.
*/


#pragma once

#define ARILES2_VISITOR_INCLUDED_namevalue2

#include <ariles2/internal/helpers.h>
#include <ariles2/visitors/config.h>

#include <string>
#include <memory>


namespace ariles2
{
namespace ns_namevalue2
{
class NameValueContainer
{
public:
virtual ~NameValueContainer() = default;

virtual std::string &name(const std::size_t index) = 0;
virtual double &value(const std::size_t index) = 0;
virtual std::size_t size() const = 0;
virtual void reserve(const std::size_t size) = 0;
virtual void resize(const std::size_t size) = 0;
};


/**
* @brief Configuration writer class
*/
class ARILES2_VISIBILITY_ATTRIBUTE Writer
: public ariles2::write::Visitor,
public serialization::NodeStackBase<serialization::Node<std::string>>
{
protected:
bool initialize_names_;
std::size_t index_;
std::shared_ptr<NameValueContainer> name_value_pairs_;

const std::string separator_ = ".";
const std::string bracket_left_ = "{";
const std::string bracket_right_ = "}";


public:
explicit Writer(const std::shared_ptr<NameValueContainer> &container, const std::size_t reserve = 0);
virtual void startRoot(const std::string &name, const Parameters &param);
void flush();
virtual void startMap(const Parameters &, const std::size_t num_entries);
virtual void startMapEntry(const std::string &map_name);
virtual void endMapEntry();
virtual void endMap();
virtual bool startIteratedMap(const std::size_t /*num_entries*/, const Parameters &);
virtual void startArray(const std::size_t size, const bool /*compact*/ = false);
virtual void endArrayElement();
virtual void endArray();


#define ARILES2_BASIC_TYPE(type) void writeElement(const type &element, const Parameters &);

CPPUT_MACRO_SUBSTITUTE(ARILES2_BASIC_NUMERIC_TYPES_LIST)

#undef ARILES2_BASIC_TYPE


void writeElement(const std::string &element, const Parameters &parameters);
virtual const Parameters &getDefaultParameters() const;
};
} // namespace ns_namevalue2
} // namespace ariles2


namespace ariles2
{
/**
* @brief NameValue2 visitor.
* @ingroup namevalue2
*/
struct ARILES2_VISIBILITY_ATTRIBUTE namevalue2
{
using NameValueContainer = ns_namevalue2::NameValueContainer;
using Writer = ns_namevalue2::Writer;
};
} // namespace ariles2
Loading

0 comments on commit 5ee26ae

Please sign in to comment.