Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
51964dd
Allow building of qt4 and qt5 version side-by-side
pierrewillenbrockdfki Apr 5, 2023
fa31e0a
Actually build both versions, fix .pc files
pierrewillenbrockdfki Aug 11, 2023
8cd166a
New source dep install (#63)
planthaber Apr 11, 2024
506cce7
use cmake targets for boost
planthaber Apr 15, 2024
1065a09
Remove qt5-svg dependency
pierrewillenbrockdfki May 15, 2024
1bbf1ee
Create build_and_test.yml for github actions
planthaber Aug 2, 2024
98af7d2
Update build_and_test.yml
planthaber Aug 2, 2024
741d6c6
Update build_and_test.yml
planthaber Aug 2, 2024
d3cf2ee
Update build_and_test.yml
planthaber Aug 2, 2024
64f08b7
fix pkg-config deps
planthaber Sep 25, 2024
490e3bd
Add missing .pc.in for EnvireGraph2DStructureVisualization-qt5
pierrewillenbrockdfki Sep 27, 2024
2019cc3
add qt5svg dependency
planthaber Jan 6, 2025
1448444
Switch to seperate version of class_loader
malter Dec 4, 2024
c59ccfc
use DEPS_TARGET for cmake targets
planthaber Jan 6, 2025
ef678e1
remove boost libs from pc.in file
planthaber Jan 6, 2025
f36de10
fix circleci
planthaber Jan 6, 2025
ceaafd4
update ci image version
planthaber Jan 6, 2025
edf8eba
add libpoco to deps
planthaber Jan 6, 2025
ec4dae7
fix class loader warning
planthaber Jan 20, 2025
b70660f
use cmake targets for boost
planthaber Apr 15, 2024
a3c93b6
add boost_serialization dependency
planthaber Feb 4, 2025
1df5330
Switch to seperate version of class_loader
malter Dec 4, 2024
fba57bd
[buildfix] find the class_loader in the new install path
Rauldg Feb 19, 2025
cce131c
fix circleci
planthaber Jan 6, 2025
7e34ddd
update ci image version
planthaber Jan 6, 2025
226a374
add libpoco to deps
planthaber Jan 6, 2025
9432c1b
Add missing `<deque>` include
chhtz Feb 21, 2025
75afcb9
utils EnvireManager: allow recreation
planthaber Mar 24, 2025
cbe5a26
don't touch shared_ptr on recreate
planthaber Mar 26, 2025
946d436
add removeFrame and addItem to ThreadSaveGraph
planthaber Mar 26, 2025
3a4be46
add visitItems to Thread save graph util interface
planthaber Apr 2, 2025
9be4b2c
add lamda callback mode to Grapheventdispatcher
planthaber May 15, 2025
3543b6f
Use RockQt macros for visualisation
pierrewillenbrockdfki Aug 26, 2025
19f3a45
fix: Do not build visualization when a qt dep(vizkit3d) is missing
pierrewillenbrockdfki Aug 27, 2025
ea30482
Merge remote-tracking branch 'autobuild/master' into feature/qt4-qt5
pierrewillenbrockdfki Sep 25, 2025
721b8c6
Merge remote-tracking branch 'autobuild/feature/qt4-qt5' into mars2_n…
skasperski Jan 22, 2026
429f36e
Missed during merge.
skasperski Jan 28, 2026
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ version: 2
jobs:
build:
docker:
- image: ubuntu:18.04
- image: ubuntu:22.04
steps:
- run:
name: apt-get
command: apt update && apt -y install build-essential gcc g++ cmake git wget libgoogle-glog-dev libboost-test-dev libboost-filesystem-dev libboost-serialization-dev libboost-system-dev pkg-config libeigen3-dev libclass-loader-dev libtinyxml-dev librosconsole-bridge-dev
- run:
name: fix-class-loader-pkg-config
command: "sed -i '/Libs:/c\\Libs: -lclass_loader -lboost_filesystem -lboost_thread -lboost_system -lpthread -lPocoFoundation -ldl -lconsole_bridge' /usr/lib/x86_64-linux-gnu/pkgconfig/class_loader.pc"
command: apt update && apt -y install build-essential gcc g++ cmake git wget libgoogle-glog-dev libboost-test-dev libboost-filesystem-dev libboost-serialization-dev libboost-system-dev pkg-config libeigen3-dev libtinyxml-dev librosconsole-bridge-dev libpoco-dev
# - run:
# name: fix-class-loader-pkg-config
# command: "sed -i '/Libs:/c\\Libs: -lclass_loader -lboost_filesystem -lboost_thread -lboost_system -lpthread -lPocoFoundation -ldl -lconsole_bridge' /usr/lib/x86_64-linux-gnu/pkgconfig/class_loader.pc"
- checkout
- run:
name: chmod install script
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: CMake on a single platform

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: apt-get
run: sudo apt update && sudo apt install -y build-essential gcc g++ cmake git wget libgoogle-glog-dev libboost-test-dev libboost-filesystem-dev libboost-serialization-dev libboost-system-dev pkg-config libeigen3-dev libclass-loader-dev libtinyxml-dev librosconsole-bridge-dev

- name: fix-class-loader-pkg-config
run: "sudo sed -i '/Libs:/c\\Libs: -lclass_loader -lboost_filesystem -lboost_thread -lboost_system -lpthread -lPocoFoundation -ldl -lconsole_bridge' /usr/lib/x86_64-linux-gnu/pkgconfig/class_loader.pc"

- name: cmake and dep install
run: mkdir build && cd build && cmake -DINSTALL_DEPS=ON -DROCK_TEST_ENABLED=ON ..

- name: compile lib
run: cd build && make -j2 install

- name: test_suit
run: ./test/test_suite

- name: test_plugins
run: export LD_LIBRARY_PATH=/usr/local/lib && ./test/test_plugins

12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@
# executed from 'project/build' with 'cmake ../'.
cmake_minimum_required(VERSION 3.9)
project(envire_core VERSION 0.1 DESCRIPTION "Envire Graph Core Library")


if(INSTALL_DEPS)
execute_process(COMMAND bash build.bash ${CMAKE_INSTALL_PREFIX}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/source_dependencies)
set(ENV{PKG_CONFIG_PATH} ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/)
set(ENV{CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX}/share/rock/cmake/)
endif()


find_package(Rock)
set(ROCK_TEST_ENABLED ON CACHE BOOL "set to ON to enable the unit tests")
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

option(COVERAGE "Enable code coverage. run 'make test && make coverage' to generate the coverage report. The report will be in ${CMAKE_BINARY_DIR}/cov" OFF)


find_package(PkgConfig REQUIRED)
pkg_check_modules(PLUGIN_LIBS plugin_manager class_loader_melodic)
if(PLUGIN_LIBS_FOUND)
Expand Down Expand Up @@ -38,5 +49,6 @@ if(COVERAGE)
endif()

rock_init()
rock_feature(NOCURDIR)
rock_standard_layout()

31 changes: 25 additions & 6 deletions README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,46 @@ apt install build-essential gcc g++ cmake git wget libgoogle-glog-dev libboost-t
----

Some dependencies need to be build from source. A script is provided to install those:

==== Install Dependencies Automatically when building envire core

Defining -DINSTALL_DEPS=ON for cmake builds and isntalls the source dependencies automatically.

[source,bash]
----
mkdir build
cd build
cmake -DINSTALL_DEPS=ON ..
make install
----

When -DCMAKE_INSTALL_PREFIX is used, the dependencies are also installed there.

The install script generates an `env.sh` file in the CMAKE_INSTALL_PREFIX folder. If you did not install system wide, source this file before building and running code. It exports all neccessary environment variables.

==== Install Dependencies Manually

[source,bash]
----
chmod +x install_dependencies.sh
sudo ./install_dependencies.sh [path_to_prefix]
cd source_dependencies
sudo bash ./build.bash [path_to_prefix]
----
If no prefix is provided, the dependencies will be installed system-wide.
The install script generates an `env.sh` file. Source this file before building. It exports all neccessary environment variables.

----
source env.sh
source [path_to_prefix]/env.sh
----

After all dependencies have been installed, build and install like any other cmake project.
After all dependencies have been installed, go to the main folder build and install like any other cmake project.
----
cd ..
mkdir build
cd build
cmake ..
make install
----



=== Test Coverage and API Documentation
Run `make doc` to generate the API documentation.

Expand Down
1 change: 1 addition & 0 deletions install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ build https://github.com/rock-core/base-logging.git master base-logging "$PREFIX
build https://github.com/rock-core/base-types.git master base-types "-DBINDINGS_RUBY=OFF -DUSE_SISL=OFF -DROCK_VIZ_ENABLED=FALSE $PREFIX"
build https://github.com/envire/base-numeric.git master base-numeric "$PREFIX"
build https://github.com/envire/base-boost_serialization.git master base-boost_serialization "$PREFIX"
build https://github.com/dfki-ric/class_loader melodic-devel class_loader_melodic "$PREFIX"

#plugins
build https://github.com/envire/tools-plugin_manager.git master tools-plugin_manager "$PREFIX"
Expand Down
4 changes: 2 additions & 2 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<depend package="tools/plugin_manager" optional="1"/>
<depend package="graphviz" />
<depend package="poco" />
<depend package="qt5" optional="1"/>
<depend package="qt5-svg" optional="1"/>
<depend package="qt5" />
<depend package="qt5svg" />

<activity>active</activity>

Expand Down
73 changes: 73 additions & 0 deletions source_dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@


cmake_minimum_required(VERSION 3.10)

#https://stackoverflow.com/questions/15175318/cmake-how-to-build-external-projects-and-include-their-targets
#https://crascit.com/2015/07/25/cmake-gtest/

include(ExternalProject)

ExternalProject_Add(base-cmake
GIT_REPOSITORY https://github.com/rock-core/base-cmake.git
GIT_TAG master
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_CACHE_ARGS -DENV{PKG_CONFIG_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/
-DENV{CMAKE_PREFIX_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/share/rock/cmake/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
)

ExternalProject_Add(base-logging
GIT_REPOSITORY https://github.com/rock-core/base-logging.git
GIT_TAG master
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_CACHE_ARGS -DENV{PKG_CONFIG_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/
-DENV{CMAKE_PREFIX_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/share/rock/cmake/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
)
add_dependencies(base-logging base-cmake)

ExternalProject_Add(base-types
GIT_REPOSITORY https://github.com/rock-core/base-types.git
GIT_TAG master
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_CACHE_ARGS -DENV{PKG_CONFIG_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/
-DENV{CMAKE_PREFIX_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/share/rock/cmake/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DBINDINGS_RUBY=OFF
-DUSE_SISL=OFF
-DROCK_VIZ_ENABLED=FALSE
)
add_dependencies(base-types base-logging)

ExternalProject_Add(base-numeric
GIT_REPOSITORY https://github.com/envire/base-numeric.git
GIT_TAG master
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_CACHE_ARGS -DENV{PKG_CONFIG_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/
-DENV{CMAKE_PREFIX_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/share/rock/cmake/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
)
add_dependencies(base-numeric base-types)

ExternalProject_Add(base-boost_serialization
GIT_REPOSITORY https://github.com/envire/base-boost_serialization.git
GIT_TAG master
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_CACHE_ARGS -DENV{PKG_CONFIG_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/
-DENV{CMAKE_PREFIX_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/share/rock/cmake/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
)
add_dependencies(base-boost_serialization base-numeric)

ExternalProject_Add(tools-plugin_manager
GIT_REPOSITORY https://github.com/envire/tools-plugin_manager.git
GIT_TAG master
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CMAKE_CACHE_ARGS -DENV{PKG_CONFIG_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/
-DENV{CMAKE_PREFIX_PATH}:STRING=${CMAKE_INSTALL_PREFIX}/share/rock/cmake/
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
)
add_dependencies(tools-plugin_manager base-boost_serialization)

configure_file(env.sh.in ${PROJECT_SOURCE_DIR}/env.sh)
install(FILES ${PROJECT_SOURCE_DIR}/env.sh DESTINATION ${CMAKE_INSTALL_PREFIX})
31 changes: 31 additions & 0 deletions source_dependencies/build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

if [ "$#" -ne 1 ]; then
echo
echo "Please specify a prefix. If you want system wide installation use '/usr/local' as prefix. for a local install use e.g. './install'"
echo "In case you use a local prefix, please source the generated env.sh script in this folder to set up the paths before building the main library"
echo
exit -1
fi

if [[ $1 != .* && $1 != /* ]]; then
echo
echo -e "\033[1;33mPlease specify a global path or a local path with '/' or './' \033[1;0m"
echo
exit -1
fi

#download and build (in subshell to return to original folder)

INSTALLPATH=$(realpath $1)

mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${INSTALLPATH} ..
make -j install

if [[ $1 = .* ]]; then
echo
echo -e "\033[1;33m'source ${INSTALLPATH}/env.sh' in this folder before building the main library \033[1;0m"
echo
fi
4 changes: 4 additions & 0 deletions source_dependencies/env.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@/share/rock/cmake/
export PKG_CONFIG_PATH=@CMAKE_INSTALL_PREFIX@/lib/pkgconfig/
export LD_LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:@CMAKE_INSTALL_PREFIX@/lib64:$LD_LIBRARY_PATH
export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH
3 changes: 3 additions & 0 deletions source_dependencies/install_os_dependencies.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

sudo apt install build-essential gcc g++ cmake git wget libgoogle-glog-dev libboost-test-dev libboost-filesystem-dev libboost-serialization-dev libboost-system-dev pkg-config libeigen3-dev libclass-loader-dev libtinyxml-dev librosconsole-bridge-dev
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ rock_library(envire_core
SOURCES ${sources}
DEPS_CMAKE Glog
DEPS_PKGCONFIG ${deps_pkg_config}
DEPS
DEPS_TARGET
Boost::filesystem
Boost::serialization
Boost::system
Expand Down
59 changes: 59 additions & 0 deletions src/events/GraphEventDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,65 @@ void GraphEventDispatcher::waitForFrame(const std::string &framename)
waitingForFrames.push_back(framename);
}

void GraphEventDispatcher::addEdgeAddedEventCallback(std::function<void (const envire::core::EdgeAddedEvent&)> cb) {
edgeAddedCallbacks.push_back(cb);
}
void GraphEventDispatcher::addEdgeRemovedEventCallback(std::function<void (const envire::core::EdgeRemovedEvent&)> cb) {
edgeRemovedCallbacks.push_back(cb);
}
void GraphEventDispatcher::addEdgeModifiedEventCallback(std::function<void (const envire::core::EdgeModifiedEvent&)> cb) {
edgeModifiedCallbacks.push_back(cb);
}
void GraphEventDispatcher::addFrameAddedEventCallback(std::function<void (const envire::core::FrameAddedEvent&)> cb) {
frameAddedCallbacks.push_back(cb);
}
void GraphEventDispatcher::addFrameRemovedEventCallback(std::function<void (const envire::core::FrameRemovedEvent&)> cb) {
frameRemovedCallbacks.push_back(cb);
}
void GraphEventDispatcher::addItemAddedEventCallback(std::function<void (const envire::core::ItemAddedEvent&)> cb) {
itemAddedCallbacks.push_back(cb);
}
void GraphEventDispatcher::addItemRemovedEventCallback(std::function<void (const envire::core::ItemRemovedEvent&)> cb) {
itemRemovedCallbacks.push_back(cb);
}


void GraphEventDispatcher::edgeAdded(const envire::core::EdgeAddedEvent& e) {
for (const auto& cb : edgeAddedCallbacks){
cb(e);
}
}
void GraphEventDispatcher::edgeRemoved(const envire::core::EdgeRemovedEvent& e) {
for (const auto& cb : edgeRemovedCallbacks){
cb(e);
}
}
void GraphEventDispatcher::edgeModified(const envire::core::EdgeModifiedEvent& e) {
for (const auto& cb : edgeModifiedCallbacks){
cb(e);
}
}
void GraphEventDispatcher::frameAdded(const envire::core::FrameAddedEvent& e) {
for (const auto& cb : frameAddedCallbacks){
cb(e);
}
}
void GraphEventDispatcher::frameRemoved(const envire::core::FrameRemovedEvent& e) {
for (const auto& cb : frameRemovedCallbacks){
cb(e);
}
}
void GraphEventDispatcher::itemAdded(const envire::core::ItemAddedEvent& e) {
for (const auto& cb : itemAddedCallbacks){
cb(e);
}
}
void GraphEventDispatcher::itemRemoved(const envire::core::ItemRemovedEvent& e) {
for (const auto& cb : itemRemovedCallbacks){
cb(e);
}
}

bool GraphEventDispatcher::checkWaitingForFrames(const FrameAddedEvent& frameAddedEvent)
{
// check if all frames are available, delete entires if they are
Expand Down
Loading