Skip to content
Snippets Groups Projects
Commit 36fb1269 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge branch '63-ci-cipeline' into 'master'

Resolve "CI cipeline"

Closes #63

See merge request sw/simox/simox!109
parents 4276042d e1d28a53
No related branches found
No related tags found
No related merge requests found
stages:
- build-and-test
build-and-test:
stage: build-and-test
image: git.h2t.iar.kit.edu:5050/sw/armarx/meta/axii:latest-bionic
cache:
# https://docs.gitlab.com/ee/ci/caching/#share-caches-across-jobs-in-different-branches
key: one-key-to-rule-them-all
paths:
- .ccache
before_script:
# Ccache configuration and introspection.
- apt-get install ccache --yes
- ccache --set-config=cache_dir="$CI_PROJECT_DIR/.ccache"
- ccache --max-size=5G
- ccache --show-stats
# Activate Axii.
- source /axii/scripts/install_axii.sh
script:
# Create workspace.
- axii workspace create ~/workspace workspace
- axii workspace activate workspace
- _axii_auto_env_refresh
# Use workspace configuration from project.
- cp "$CI_PROJECT_DIR/.gitlab/ci/armarx-workspace.json" "$ARMARX_WORKSPACE/armarx-workspace.json"
- cat "$ARMARX_WORKSPACE/armarx-workspace.json"
- axii workspace env
- _axii_auto_env_refresh
- echo "Workspace information:"
- axii workspace list-modules
- axii workspace list-modules --deps
- axii workspace info
- export PROJECT_PATH_IN_WORKSPACE="$simox__PATH"
# Symlink project directory into Axii workspace.
- mkdir -p "$(dirname $PROJECT_PATH_IN_WORKSPACE)"
- ln -s "$CI_PROJECT_DIR" "$PROJECT_PATH_IN_WORKSPACE"
# Upgrade.
- axii workspace system --accept-apt-install
- axii workspace update --prefer-https
- _axii_auto_env_refresh
# Upgrade.
- axii workspace upgrade -m simox
- _axii_auto_env_refresh
- ccache --show-stats
# Test.
# ToDo: Add and use `axii ws test -m simox`
- cd "$PROJECT_PATH_IN_WORKSPACE/build"
- ctest . || true
- ctest --rerun-failed --output-on-failure . || true
- cat Temporary/LastTest.log || true
# Once again to make the job fail if an error occurs.
- ctest .
/SimDynamics/ @patrickhegemann @fabian.reister
/VirtualRobot/IK/platform @fabian.reister @dreher
/SimDynamics/ @patrickhegemann @reister
/SimoxUtility/algorithm/get_map_keys_values.h @kartmann
/SimoxUtility/caching/ @kartmann
/SimoxUtility/color/ @kartmann
/SimoxUtility/json/ @kartmann
/SimoxUtility/math/pose/ @kartmann
/SimoxUtility/math/statistics/ @kartmann
/SimoxUtility/math/SoftMinMax.* @kartmann
/SimoxUtility/meta/EnumNames.hpp @kartmann
/SimoxUtility/meta/type_name.* @kartmann
/SimoxUtility/shapes/AxisAlignedBoundingBox.* @kartmann
/SimoxUtility/threads/CountingSemaphore.* @kartmann
/VirtualRobot/IK/platform @reister @dreher
/VirtualRobot/MJCF/ @kartmann
/VirtualRobot/Nodes/HemisphereJoint/ @kartmann
/VirtualRobot/Nodes/RobotNodeHemisphere.* @kartmann
/VirtualRobot/XML/mujoco/ @kartmann
{
"modules": {
"tools/ccache/default": {},
"simox": {},
"# Missing for deps/coin/soqt": {},
"apt/libqt5opengl5-dev": {}
},
"global": {
"prepare": {
"cmake": {
"definitions": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_C_COMPILER_LAUNCHER": "$CCACHE",
"CMAKE_CXX_COMPILER_LAUNCHER": "$CCACHE"
}
}
}
}
}
......@@ -5,16 +5,21 @@
namespace simox::fs
{
//! Return path when appended to a_From will resolve to same as a_To
inline std::filesystem::path make_relative(std::filesystem::path a_From, std::filesystem::path a_To)
inline std::filesystem::path
make_relative(std::filesystem::path a_From, std::filesystem::path a_To)
{
a_From = std::filesystem::canonical(a_From);
a_To = std::filesystem::canonical(a_To);
a_From = std::filesystem::weakly_canonical(a_From);
a_To = std::filesystem::weakly_canonical(a_To);
std::filesystem::path ret;
std::filesystem::path::const_iterator itrFrom(a_From.begin()), itrTo(a_To.begin());
// Find common base
for (std::filesystem::path::const_iterator toEnd(a_To.end()), fromEnd(a_From.end()); itrFrom != fromEnd && itrTo != toEnd && *itrFrom == *itrTo; ++itrFrom, ++itrTo);
for (std::filesystem::path::const_iterator toEnd(a_To.end()), fromEnd(a_From.end());
itrFrom != fromEnd && itrTo != toEnd && *itrFrom == *itrTo;
++itrFrom, ++itrTo)
;
// Navigate backwards in directory to reach previously found base
for (std::filesystem::path::const_iterator fromEnd(a_From.end()); itrFrom != fromEnd; ++itrFrom)
for (std::filesystem::path::const_iterator fromEnd(a_From.end()); itrFrom != fromEnd;
++itrFrom)
{
if ((*itrFrom) != ".")
ret /= "..";
......@@ -25,4 +30,4 @@ namespace simox::fs
ret /= *itrTo;
return ret;
}
}
} // namespace simox::fs
......@@ -74,6 +74,10 @@ BOOST_AUTO_TEST_CASE(testInv)
BOOST_CHECK_CLOSE(vAngle, velocities(2), 0.001);
}
#define VAROUT(var) #var " = " << var
BOOST_AUTO_TEST_CASE(testMoveForward)
{
const VirtualRobot::OmniWheelPlatformKinematicsParams params = ARMAR7_OMNI_PLATFORM_CONFIG;
......@@ -84,14 +88,16 @@ BOOST_AUTO_TEST_CASE(testMoveForward)
const auto wheelVelocities = p.calcWheelVelocity(velForward);
// front wheel should not move
BOOST_CHECK_CLOSE(0.0, wheelVelocities(0), 0.1);
BOOST_TEST_INFO(0.0 << " | " << VAROUT(wheelVelocities(0)));
BOOST_CHECK_LE(std::abs(0.0 - wheelVelocities(0)), 0.02);
// rear wheels should move at the same speed ...
BOOST_CHECK_CLOSE(std::abs(wheelVelocities(1)), std::abs(wheelVelocities(2)), 0.001);
BOOST_TEST_INFO(VAROUT(wheelVelocities(1)) << " | " << VAROUT(wheelVelocities(2)));
BOOST_CHECK_LE(std::abs(std::abs(wheelVelocities(1)) - std::abs(wheelVelocities(2))), 0.02);
// .. but with different signs
BOOST_CHECK_GE(wheelVelocities(1), 0.0);
BOOST_CHECK_LE(wheelVelocities(2), 0.0);
BOOST_CHECK_LE(wheelVelocities(2), 1e-8);
}
BOOST_AUTO_TEST_CASE(testRotate)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment