Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ $(BUILD_DIR)/.make-uid: | $(BUILD_DIR)
.PHONY: cmake
cmake: $(BUILD_DIR)/.make-cmake

deps = $(sort $(wildcard CMakeList.txt Makefile fpsdk_doc/* Doxyfile \
deps = $(sort $(wildcard CMakeList.txt Makefile fpsdk_doc/* \
fpsdk_common/* fpsdk_common/*/* fpsdk_common/*/*/* fpsdk_common/*/*/*/* \
fpsdk_ros1/* fpsdk_ros1/*/* fpsdk_ros1/*/*/* fpsdk_ros1/*/*/*/* \
fpsdk_ros2/* fpsdk_ros2/*/* fpsdk_ros2/*/*/* fpsdk_ros2/*/*/*/* \
Expand Down Expand Up @@ -222,14 +222,15 @@ endif
.PHONY: doc
doc: $(BUILD_DIR)/.make-doc

$(BUILD_DIR)/.make-doc: $(BUILD_DIR)/.make-cmake
$(BUILD_DIR)/.make-doc: $(BUILD_DIR)/.make-cmake fpsdk_doc/Doxyfile
@echo "$(HLW)***** Doc ($(BUILD_TYPE)) *****$(HLO)"
$(V)( \
cat Doxyfile; \
cat fpsdk_doc/Doxyfile; \
echo "PROJECT_NUMBER = $$(cat $(BUILD_DIR)/FP_VERSION_STRING || echo 'unknown revision')"; \
echo "OUTPUT_DIRECTORY = $(BUILD_DIR)"; \
) | $(DOXYGEN) -
$(V)$(TOUCH) $@
@echo "now run: xdg-open $(BUILD_DIR)/doc/index.html"

# ----------------------------------------------------------------------------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions docker/scripts/install_aptbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ packages=$(awk -v filt=${FPSDK_IMAGE%-*} '$1 ~ filt { print $2 }' <<EOF
noetic.humble.jazzy.bookworm libcurl4-openssl-dev
noetic.humble.jazzy.bookworm libeigen3-dev
..............jazzy.bookworm libgtest-dev
noetic.humble.jazzy.bookworm libpath-tiny-perl
noetic.humble.jazzy.bookworm libsqlite3-dev
noetic.humble.jazzy.bookworm libtiff-dev
noetic.humble.jazzy.bookworm libyaml-cpp-dev
Expand All @@ -29,6 +30,7 @@ packages=$(awk -v filt=${FPSDK_IMAGE%-*} '$1 ~ filt { print $2 }' <<EOF
noetic.humble.jazzy.bookworm python-is-python3
noetic.humble.jazzy.bookworm python3-osrf-pycommon
noetic.humble.jazzy.bookworm python3-pip
noetic.humble.jazzy.bookworm python3-venv
noetic...................... ros-noetic-eigen-conversions
noetic...................... ros-noetic-tf
noetic...................... ros-noetic-tf-conversions
Expand All @@ -38,7 +40,9 @@ packages=$(awk -v filt=${FPSDK_IMAGE%-*} '$1 ~ filt { print $2 }' <<EOF
noetic.humble.jazzy.bookworm sqlite3
noetic.humble.jazzy.bookworm sudo
..............jazzy......... unminimize
noetic.humble.jazzy.bookworm unzip
noetic.humble.jazzy.bookworm zlib1g-dev
noetic.humble.jazzy.bookworm zip
EOF
)

Expand Down
2 changes: 2 additions & 0 deletions docker/scripts/install_aptdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fi
# List of packages, with filter for the different images we make
packages=$(awk -v filt=${FPSDK_IMAGE%-*} '$1 ~ filt { print $2 }' <<EOF
noetic.humble.jazzy.bookworm ack
noetic.humble.jazzy.bookworm aptitude
noetic.humble.jazzy.bookworm bash-completion
noetic.humble.jazzy.bookworm bind9-dnsutils
noetic.humble.jazzy.bookworm bsdmainutils
Expand Down Expand Up @@ -48,6 +49,7 @@ packages=$(awk -v filt=${FPSDK_IMAGE%-*} '$1 ~ filt { print $2 }' <<EOF
noetic.humble.jazzy.bookworm manpages-posix-dev
noetic.humble.jazzy.bookworm moreutils
noetic.humble.jazzy.bookworm ncdu
noetic.humble.jazzy.bookwork net-tools
noetic.humble............... netcat
..............jazzy.bookworm netcat-openbsd
noetic.humble.jazzy.bookworm openssh-client
Expand Down
3 changes: 2 additions & 1 deletion fpsdk.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@
"expected": "cpp",
"format": "cpp",
"stdfloat": "cpp",
"*.ipp": "cpp"
"*.ipp": "cpp",
"forward_list": "cpp"
},
"workbench.remoteIndicator.showExtensionRecommendations": true,
"yaml.extension.recommendations": false
Expand Down
10 changes: 9 additions & 1 deletion fpsdk_apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,21 @@ endif()

# EXECUTABLES ==========================================================================================================

file(GLOB COMMON_CPP_FILES common/*.cpp)

file(GLOB FPLTOOL_CPP_FILES fpltool/*.cpp)
add_executable(fpltool ${FPLTOOL_CPP_FILES})
target_link_libraries(fpltool
fpsdk_common
$<$<BOOL:${FP_USE_ROS1}>:fpsdk_ros1>
)

file(GLOB PARSERTOOL_CPP_FILES parsertool/*.cpp)
add_executable(parsertool ${PARSERTOOL_CPP_FILES} ${COMMON_CPP_FILES})
target_link_libraries(parsertool
fpsdk_common
)

file(GLOB TIMECONV_CPP_FILES timeconv/*.cpp)
add_executable(timeconv ${TIMECONV_CPP_FILES} ${COMMON_CPP_FILES})
target_link_libraries(timeconv
Expand All @@ -91,7 +99,7 @@ set(PROJECT_LIBRARY_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
set(PROJECT_INCLUDE_DIR ${CMAKE_INSTALL_FULL_INCLUDEDIR}/${PROJECT_NAME})
set(PROJECT_DATA_DIR ${CMAKE_INSTALL_FULL_DATAROOTDIR}/${PROJECT_NAME})

install(TARGETS fpltool timeconv yaml2shell
install(TARGETS fpltool parsertool timeconv yaml2shell
EXPORT ${PROJECT_NAME}-targets
LIBRARY DESTINATION ${PROJECT_LIBRARY_DIR}
RUNTIME DESTINATION ${PROJECT_RUNTIME_DIR}
Expand Down
2 changes: 1 addition & 1 deletion fpsdk_apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This contains various apps (tools, utilities). See below for details.
---
## Dependencies

- [Fixposition SDK dependencies](../README.md#dependencies)
- [Fixposition SDK dependencies](../fpsdk_docs/README.md#dependencies)
- [fpsdk_common](../fpsdk_common/README.md)
- [fpsdk_ros1](../fpsdk_common/README.md) -- optional, but recommended, and required for some functionality

Expand Down
84 changes: 84 additions & 0 deletions fpsdk_apps/common/common.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* \verbatim
* ___ ___
* \ \ / /
* \ \/ / Copyright (c) Fixposition AG (www.fixposition.com) and contributors
* / /\ \ License: see the LICENSE file
* /__/ \__\
* \endverbatim
*
* @file
* @brief Fixposition SDK: common app utils
*/

/* LIBC/STL */
#include <cinttypes>
#include <cstdint>
#include <cstdio>

/* EXTERNAL */

/* Fixposition SDK */
#include <fpsdk_common/logging.hpp>
#include <fpsdk_common/string.hpp>

/* PACKAGE */
#include "common.hpp"

namespace fpsdk {
namespace apps {
namespace common {
/* ****************************************************************************************************************** */

using namespace fpsdk::common::string;
using namespace fpsdk::common::parser;

// ---------------------------------------------------------------------------------------------------------------------

void PrintMessageHeader()
{
// Keep in sync with PrintMessage()
std::printf("------- Seq# Offset Size Protocol Message Info\n");
}

// ---------------------------------------------------------------------------------------------------------------------

void PrintMessageData(const ParserMsg& msg, const std::size_t offs, const bool hexdump)
{
msg.MakeInfo();
std::printf("message %06" PRIuMAX " %8" PRIuMAX " %5" PRIuMAX " %-8s %-30s %s\n", msg.seq_, offs, msg.data_.size(),
ProtocolStr(msg.proto_), msg.name_.c_str(), msg.info_.empty() ? "-" : msg.info_.c_str());
if (hexdump) {
for (auto& line : HexDump(msg.data_)) {
std::printf("%s\n", line.c_str());
}
}
}

// ---------------------------------------------------------------------------------------------------------------------

void PrintParserStats(const ParserStats& stats)
{
auto& s = stats;
const double p_n = (s.n_msgs_ > 0 ? 100.0 / (double)s.n_msgs_ : 0.0);
const double p_s = (s.s_msgs_ > 0 ? 100.0 / (double)s.s_msgs_ : 0.0);
std::printf("Stats: Messages Bytes\n");
const char* fmt = "%-8s %10" PRIu64 " (%5.1f%%) %10" PRIu64 " (%5.1f%%)\n";
// clang-format off
std::printf(fmt, "Total", s.n_msgs_, (double)s.n_msgs_ * p_n, s.s_msgs_, (double)s.s_msgs_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::FP_A), s.n_fpa_, (double)s.n_fpa_ * p_n, s.s_fpa_, (double)s.s_fpa_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::FP_B), s.n_fpb_, (double)s.n_fpb_ * p_n, s.s_fpb_, (double)s.s_fpb_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::NMEA), s.n_nmea_, (double)s.n_nmea_ * p_n, s.s_nmea_, (double)s.s_nmea_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::UBX), s.n_ubx_, (double)s.n_ubx_ * p_n, s.s_ubx_, (double)s.s_ubx_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::RTCM3), s.n_rtcm3_, (double)s.n_rtcm3_ * p_n, s.s_rtcm3_, (double)s.s_rtcm3_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::NOV_B), s.n_novb_, (double)s.n_novb_ * p_n, s.s_novb_, (double)s.s_novb_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::UNI_B), s.n_unib_, (double)s.n_unib_ * p_n, s.s_novb_, (double)s.s_unib_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::SPARTN), s.n_spartn_, (double)s.n_spartn_ * p_n, s.s_spartn_, (double)s.s_spartn_ * p_s);
std::printf(fmt, ProtocolStr(Protocol::OTHER), s.n_other_, (double)s.n_other_ * p_n, s.s_other_, (double)s.s_other_ * p_s);
// clang-format on
}

/* ****************************************************************************************************************** */
} // namespace common
} // namespace apps
} // namespace fpsdk
62 changes: 62 additions & 0 deletions fpsdk_apps/common/common.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* \verbatim
* ___ ___
* \ \ / /
* \ \/ / Copyright (c) Fixposition AG (www.fixposition.com) and contributors
* / /\ \ License: see the LICENSE file
* /__/ \__\
* \endverbatim
*
* @file
* @brief Fixposition SDK: common app utils
*/
#ifndef __FPSDK_APPS_PCOMMOM_HPP__
#define __FPSDK_APPS_PCOMMOM_HPP__

/* LIBC/STL */
#include <cstdint>
#include <string>
#include <vector>

/* EXTERNAL */

/* Fixposition SDK */
#include <fpsdk_common/logging.hpp>
#include <fpsdk_common/parser/types.hpp>

/* PACKAGE */

namespace fpsdk {
namespace apps {
/**
* @brief common apps utils
*/
namespace common {
/* ****************************************************************************************************************** */

/**
* @brief Print header for PrintMessageData() to stdout
*/
void PrintMessageHeader();

/**
* @brief Print message summary to stdout
*
* @param[in] msg The message
* @param[in] offs Offset [bytes] of message in data (stream, file)
* @param[in] hexdump Print also hexdump
*/
void PrintMessageData(const ::fpsdk::common::parser::ParserMsg& msg, const std::size_t offs, const bool hexdump);

/**
* @brief Print parser stats to stdout
*
* @param[in] stats The stats
*/
void PrintParserStats(const ::fpsdk::common::parser::ParserStats& stats);

/* ****************************************************************************************************************** */
} // namespace common
} // namespace apps
} // namespace fpsdk
#endif // __FPSDK_APPS_PCOMMOM_HPP__
1 change: 1 addition & 0 deletions fpsdk_apps/doc/doc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace apps {
@section FPSDK_APPS_APPS Apps

- @subpage FPSDK_APPS_FPLTOOL
- @subpage FPSDK_APPS_PARSERTOOL
- @subpage FPSDK_APPS_TIMECONV
- @subpage FPSDK_APPS_YAML2SHELL

Expand Down
4 changes: 2 additions & 2 deletions fpsdk_apps/fpltool/fpltool_rosbag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <fpsdk_common/string.hpp>
#ifdef FP_USE_ROS1
# include <fpsdk_ros1/bagwriter.hpp>
# include <fpsdk_ros1/ext/ros_msgs.hpp>
# include <fpsdk_ros1/msgs.hpp>
#endif

/* PACKAGE */
Expand Down Expand Up @@ -90,7 +90,7 @@ bool DoRosbag(const FplToolOptions& opts)

// Prepare message for stream messages
fpsdk_ros1::ParserMsg stream_msg_ros;
stream_msg_ros.protocol = fpsdk_ros1::ParserMsg::PROTOCOL_UNSPECIFIED;
stream_msg_ros.protocol = fpsdk::ros1::msgs::ParserMsg::PROTOCOL_UNSPECIFIED;
stream_msg_ros.seq = 0;

// Handle SIGINT (C-c) to abort nicely
Expand Down
Loading
Loading