From 09a28ef50605de4b720446dc508e7ea21687ecc7 Mon Sep 17 00:00:00 2001 From: Fabian Paus <fabian.paus@kit.edu> Date: Tue, 24 Aug 2021 11:59:22 +0200 Subject: [PATCH] Reduce boost includes --- .../DebugDrawer/DebugDrawerComponent.cpp | 79 +++++++++---------- .../components/KITHandUnit/KITHandUnit.cpp | 8 +- .../KITProstheticHandUnit.cpp | 16 ++-- .../components/units/ForceTorqueObserver.cpp | 10 +-- .../units/ForceTorqueUnitSimulation.cpp | 6 +- .../RobotAPI/components/units/HeadIKUnit.cpp | 10 +-- .../components/units/KinematicUnit.cpp | 11 +-- .../units/KinematicUnitObserver.cpp | 10 +-- .../units/KinematicUnitSimulation.cpp | 1 - .../units/RobotUnit/BasicControllers.cpp | 27 ++++--- .../CartesianImpedanceController.cpp | 8 +- .../NJointTaskSpaceImpedanceController.cpp | 10 +-- .../components/units/RobotUnit/PDController.h | 11 +-- .../RobotUnitModuleLogging.cpp | 26 +++--- .../RobotUnitModuleRobotData.cpp | 9 +-- .../RobotUnitModuleSelfCollisionChecker.cpp | 7 +- .../util/ControlThreadOutputBuffer.h | 30 ++----- .../components/units/TCPControlUnit.cpp | 11 +-- .../HokuyoLaserUnit/HokuyoLaserUnit.cpp | 5 +- .../ArViz/ArVizWidgetController.cpp | 12 +-- .../DebugDrawerViewerWidgetController.cpp | 6 +- .../ArmarXEtherCAT/DeviceContainer.h | 5 ++ .../BimanualGraspCandidateHelper.h | 7 +- .../GraspingUtility/GraspCandidateHelper.h | 8 +- .../NJointTaskSpaceImpedanceDMPController.cpp | 6 +- .../libraries/SimpleTrajectory/Track.cpp | 4 +- .../libraries/SimpleTrajectory/Trajectory.cpp | 6 +- .../libraries/SimpleTrajectory/Trajectory.h | 2 +- .../libraries/SimpleTrajectory/VariantValue.h | 7 +- .../libraries/SimpleTrajectory/exceptions.cpp | 18 ++--- .../libraries/SimpleTrajectory/exceptions.h | 5 +- .../SimpleTrajectory/interpolate/linear.cpp | 4 +- .../SimpleTrajectory/interpolate/linear.h | 13 +-- .../SimpleTrajectory/test/TrajectoryTest.cpp | 2 +- .../aron/core/test/aronCodeGenerationTest.cpp | 3 - .../aron/core/test/aronExtendsTest.cpp | 3 - .../aron/core/test/aronNavigateTest.cpp | 3 - .../aron/core/test/aronOperatorTest.cpp | 3 - .../aron/core/test/aronRandomizedTest.cpp | 3 - .../libraries/core/RobotStatechartContext.cpp | 14 ++-- source/RobotAPI/libraries/core/Trajectory.h | 6 +- .../core/remoterobot/RemoteRobot.cpp | 25 ++---- .../core/remoterobot/RemoteRobotNode.cpp | 5 +- .../core/remoterobot/RobotStateObserver.cpp | 12 +-- .../libraries/diffik/DiffIKProvider.h | 7 +- .../libraries/diffik/GraspTrajectory.h | 31 +++++--- .../libraries/diffik/RobotPlacement.h | 4 +- 47 files changed, 212 insertions(+), 307 deletions(-) diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp index b59531d4c..198770875 100644 --- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp +++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp @@ -55,8 +55,7 @@ #include <ArmarXCore/core/system/ArmarXDataPath.h> #include <ArmarXCore/core/system/cmake/CMakePackageFinder.h> -#include <boost/algorithm/string/predicate.hpp> -#include <boost/algorithm/string/replace.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> #include <VirtualRobot/Robot.h> #include <VirtualRobot/XML/RobotIO.h> @@ -68,7 +67,7 @@ using namespace VirtualRobot; #define SELECTION_NAME_PREFIX ("selection_" + std::to_string(reinterpret_cast<std::uintptr_t>(this))) #define SELECTION_NAME_SPLITTER "____" -#define SELECTION_NAME(layerName, elementName) boost::replace_all_copy(std::string(SELECTION_NAME_PREFIX + "_" + layerName + SELECTION_NAME_SPLITTER + elementName), " ", "_").c_str() +#define SELECTION_NAME(layerName, elementName) simox::alg::replace_all(std::string(SELECTION_NAME_PREFIX + "_" + layerName + SELECTION_NAME_SPLITTER + elementName), " ", "_").c_str() namespace armarx { @@ -1162,7 +1161,7 @@ namespace armarx return; } - std::string entryName = boost::replace_all_copy(std::string("__" + d.layerName + "__" + d.name + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + d.layerName + "__" + d.name + "__"), " ", "_"); VirtualRobot::RobotPtr robot = activeRobots[entryName]; std::vector<std::string> nodeNameList; @@ -1234,7 +1233,7 @@ namespace armarx auto l = getScopedVisuLock(); auto& layer = requestLayer(d.layerName); - std::string entryName = boost::replace_all_copy(std::string("__" + d.layerName + "__" + d.name + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + d.layerName + "__" + d.name + "__"), " ", "_"); ARMARX_DEBUG << "Requesting robot " << entryName; @@ -1563,7 +1562,7 @@ namespace armarx auto l = getScopedVisuLock(); // process active robots - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + name + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + name + "__"), " ", "_"); ARMARX_DEBUG << "Removing robot " << entryName; if (activeRobots.find(entryName) != activeRobots.end()) @@ -1686,7 +1685,7 @@ namespace armarx Eigen::Matrix4f gp = PosePtr::dynamicCast(globalPose)->toEigen(); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + poseName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + poseName + "__"), " ", "_"); CoordData& d = accumulatedUpdateData.coord[entryName]; d.globalPose = gp; d.layerName = layerName; @@ -1715,7 +1714,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + poseName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + poseName + "__"), " ", "_"); CoordData& d = accumulatedUpdateData.coord[entryName]; d.layerName = layerName; d.name = poseName; @@ -1735,7 +1734,7 @@ namespace armarx VirtualRobot::VisualizationFactory::Color c(color.r, color.g, color.b, 1 - color.a); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + lineName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + lineName + "__"), " ", "_"); LineData& d = accumulatedUpdateData.line[entryName]; d.p1 = p1; d.p2 = p2; @@ -1756,7 +1755,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + lineName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + lineName + "__"), " ", "_"); LineData& d = accumulatedUpdateData.line[entryName]; d.layerName = layerName; d.name = lineName; @@ -1774,7 +1773,7 @@ namespace armarx ARMARX_DEBUG << VAROUT(layerName) << VAROUT(lineSetName); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + lineSetName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + lineSetName + "__"), " ", "_"); LineSetData& d = accumulatedUpdateData.lineSet[entryName]; d.lineSet = lineSet; d.layerName = layerName; @@ -1792,7 +1791,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + lineSetName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + lineSetName + "__"), " ", "_"); LineSetData& d = accumulatedUpdateData.lineSet[entryName]; d.layerName = layerName; d.name = lineSetName; @@ -1811,7 +1810,7 @@ namespace armarx VirtualRobot::VisualizationFactory::Color c(color.r, color.g, color.b, 1 - color.a); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + boxName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + boxName + "__"), " ", "_"); BoxData& d = accumulatedUpdateData.box[entryName]; d.width = dimensions->x; d.height = dimensions->y; @@ -1833,7 +1832,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + boxName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + boxName + "__"), " ", "_"); BoxData& d = accumulatedUpdateData.box[entryName]; d.layerName = layerName; d.name = boxName; @@ -1851,7 +1850,7 @@ namespace armarx ARMARX_DEBUG << VAROUT(layerName) << VAROUT(textName); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + textName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + textName + "__"), " ", "_"); TextData& d = accumulatedUpdateData.text[entryName]; d.text = text; d.position = Vector3Ptr::dynamicCast(globalPosition)->toEigen(); @@ -1872,7 +1871,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + textName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + textName + "__"), " ", "_"); TextData& d = accumulatedUpdateData.text[entryName]; d.layerName = layerName; d.name = textName; @@ -1890,7 +1889,7 @@ namespace armarx ARMARX_DEBUG << VAROUT(layerName) << VAROUT(sphereName); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + sphereName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + sphereName + "__"), " ", "_"); SphereData& d = accumulatedUpdateData.sphere[entryName]; d.radius = radius; d.position = Vector3Ptr::dynamicCast(globalPosition)->toEigen(); @@ -1910,7 +1909,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + sphereName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + sphereName + "__"), " ", "_"); SphereData& d = accumulatedUpdateData.sphere[entryName]; d.layerName = layerName; d.name = sphereName; @@ -1928,7 +1927,7 @@ namespace armarx ARMARX_DEBUG << VAROUT(layerName) << VAROUT(cylinderName); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + cylinderName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + cylinderName + "__"), " ", "_"); CylinderData& d = accumulatedUpdateData.cylinder[entryName]; d.position = Vector3Ptr::dynamicCast(globalPosition)->toEigen(); d.direction = Vector3Ptr::dynamicCast(direction)->toEigen(); @@ -1950,7 +1949,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + cylinderName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + cylinderName + "__"), " ", "_"); CylinderData& d = accumulatedUpdateData.cylinder[entryName]; d.layerName = layerName; d.name = cylinderName; @@ -1968,7 +1967,7 @@ namespace armarx ARMARX_DEBUG << VAROUT(layerName) << VAROUT(pointCloudName); { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); PointCloudData& d = accumulatedUpdateData.pointcloud[entryName]; d.pointCloud = pointCloud; d.layerName = layerName; @@ -1986,7 +1985,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); PointCloudData& d = accumulatedUpdateData.pointcloud[entryName]; d.layerName = layerName; d.name = pointCloudName; @@ -2003,7 +2002,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + polygonName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + polygonName + "__"), " ", "_"); PolygonData& d = accumulatedUpdateData.polygons[entryName]; std::vector< Eigen::Vector3f > points; @@ -2034,7 +2033,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + polygonName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + polygonName + "__"), " ", "_"); PolygonData& d = accumulatedUpdateData.polygons[entryName]; d.layerName = layerName; d.name = polygonName; @@ -2051,7 +2050,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + triMeshName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + triMeshName + "__"), " ", "_"); TriMeshData& d = accumulatedUpdateData.triMeshes[entryName]; d.triMesh = triMesh; d.layerName = layerName; @@ -2069,7 +2068,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + triMeshName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + triMeshName + "__"), " ", "_"); TriMeshData& d = accumulatedUpdateData.triMeshes[entryName]; d.layerName = layerName; d.name = triMeshName; @@ -2086,7 +2085,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + arrowName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + arrowName + "__"), " ", "_"); ArrowData& d = accumulatedUpdateData.arrows[entryName]; d.position = Vector3Ptr::dynamicCast(position)->toEigen(); d.direction = Vector3Ptr::dynamicCast(direction)->toEigen(); @@ -2108,7 +2107,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + arrowName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + arrowName + "__"), " ", "_"); ArrowData& d = accumulatedUpdateData.arrows[entryName]; d.layerName = layerName; d.name = arrowName; @@ -2124,7 +2123,7 @@ namespace armarx void DebugDrawerComponent::setRobotVisu(const std::string& layerName, const std::string& robotName, const std::string& robotFile, const std::string& armarxProject, DrawStyle drawStyle, const Ice::Current&) { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); ARMARX_DEBUG << "setting robot visualization for " << entryName; RobotData& d = accumulatedUpdateData.robots[entryName]; @@ -2140,7 +2139,7 @@ namespace armarx void DebugDrawerComponent::updateRobotPose(const std::string& layerName, const std::string& robotName, const PoseBasePtr& globalPose, const Ice::Current&) { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); ARMARX_DEBUG << "updating robot pose for " << entryName; RobotData& d = accumulatedUpdateData.robots[entryName]; @@ -2157,7 +2156,7 @@ namespace armarx void DebugDrawerComponent::updateRobotConfig(const std::string& layerName, const std::string& robotName, const std::map<std::string, float>& configuration, const Ice::Current&) { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); ARMARX_DEBUG << "updating robot config for " << entryName; RobotData& d = accumulatedUpdateData.robots[entryName]; @@ -2178,7 +2177,7 @@ namespace armarx void DebugDrawerComponent::updateRobotColor(const std::string& layerName, const std::string& robotName, const DrawColor& c, const Ice::Current&) { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); ARMARX_DEBUG << "updating robot color for " << entryName; RobotData& d = accumulatedUpdateData.robots[entryName]; @@ -2203,7 +2202,7 @@ namespace armarx void DebugDrawerComponent::updateRobotNodeColor(const std::string& layerName, const std::string& robotName, const std::string& robotNodeName, const DrawColor& c, const Ice::Current&) { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); ARMARX_DEBUG << "updating robot color for " << entryName; RobotData& d = accumulatedUpdateData.robots[entryName]; @@ -2229,7 +2228,7 @@ namespace armarx void DebugDrawerComponent::removeRobotVisu(const std::string& layerName, const std::string& robotName, const Ice::Current&) { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + robotName + "__"), " ", "_"); ARMARX_DEBUG << "removing robot visu for " << entryName; RobotData& d = accumulatedUpdateData.robots[entryName]; @@ -2760,7 +2759,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); ColoredPointCloudData& d = accumulatedUpdateData.coloredpointcloud[entryName]; d.pointCloud = pointCloud; d.layerName = layerName; @@ -2778,7 +2777,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); ColoredPointCloudData& d = accumulatedUpdateData.coloredpointcloud[entryName]; d.layerName = layerName; d.name = pointCloudName; @@ -2876,7 +2875,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); Colored24BitPointCloudData& d = accumulatedUpdateData.colored24Bitpointcloud[entryName]; d.pointCloud = pointCloud; d.layerName = layerName; @@ -2894,7 +2893,7 @@ namespace armarx { { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + pointCloudName + "__"), " ", "_"); Colored24BitPointCloudData& d = accumulatedUpdateData.colored24Bitpointcloud[entryName]; d.layerName = layerName; d.name = pointCloudName; @@ -2911,7 +2910,7 @@ namespace armarx { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + circleName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + circleName + "__"), " ", "_"); CircleData& d = accumulatedUpdateData.circle[entryName]; d.position = Vector3Ptr::dynamicCast(globalPosition)->toEigen(); d.direction = Vector3Ptr::dynamicCast(directionVec)->toEigen(); @@ -2934,7 +2933,7 @@ namespace armarx { auto l = getScopedAccumulatedDataLock(); - std::string entryName = boost::replace_all_copy(std::string("__" + layerName + "__" + circleName + "__"), " ", "_"); + std::string entryName = simox::alg::replace_all(std::string("__" + layerName + "__" + circleName + "__"), " ", "_"); CircleData& d = accumulatedUpdateData.circle[entryName]; d.layerName = layerName; d.name = circleName; diff --git a/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp b/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp index b3cb24cfd..e7d20106e 100644 --- a/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp +++ b/source/RobotAPI/components/KITHandUnit/KITHandUnit.cpp @@ -20,12 +20,12 @@ * GNU General Public License */ -#include <boost/algorithm/clamp.hpp> - #include "KITHandUnit.h" #include <ArmarXCore/core/ArmarXManager.h> #include <ArmarXGui/libraries/RemoteGui/WidgetBuilder.h> +#include <algorithm> + using namespace KITHand; namespace armarx @@ -163,7 +163,7 @@ namespace armarx { if (pair.first == "Fingers") { - const std::uint64_t pos = boost::algorithm::clamp( + const std::uint64_t pos = std::clamp( static_cast<std::uint64_t>(pair.second * KITHand::ControlOptions::maxPosFingers), 0, KITHand::ControlOptions::maxPosFingers); ARMARX_DEBUG << deactivateSpam(1, std::to_string(pos)) << "set fingers " << pos; @@ -171,7 +171,7 @@ namespace armarx } else if (pair.first == "Thumb") { - const std::uint64_t pos = boost::algorithm::clamp( + const std::uint64_t pos = std::clamp( static_cast<std::uint64_t>(pair.second * KITHand::ControlOptions::maxPosThumb), 0, KITHand::ControlOptions::maxPosThumb); ARMARX_DEBUG << deactivateSpam(1, std::to_string(pos)) << "set thumb " << pos; diff --git a/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp b/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp index b68904c7c..a36bdd9da 100644 --- a/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp +++ b/source/RobotAPI/components/KITProstheticHandUnit/KITProstheticHandUnit.cpp @@ -20,16 +20,14 @@ * GNU General Public License */ -#include <thread> -#include <regex> - -#include <boost/algorithm/clamp.hpp> - -#include <ArmarXCore/core/exceptions/local/ExpressionException.h> +#include "KITProstheticHandUnit.h" #include <ArmarXGui/libraries/RemoteGui/WidgetBuilder.h> +#include <ArmarXCore/core/exceptions/local/ExpressionException.h> -#include "KITProstheticHandUnit.h" +#include <algorithm> +#include <thread> +#include <regex> namespace armarx { @@ -153,7 +151,7 @@ namespace armarx { if (pair.first == "Fingers") { - const std::uint64_t pos = boost::algorithm::clamp( + const std::uint64_t pos = std::clamp( static_cast<std::uint64_t>(pair.second * _driver->getMaxPosFingers()), 0, _driver->getMaxPosFingers()); ARMARX_INFO << "set fingers " << pos; @@ -163,7 +161,7 @@ namespace armarx } else if (pair.first == "Thumb") { - const std::uint64_t pos = boost::algorithm::clamp( + const std::uint64_t pos = std::clamp( static_cast<std::uint64_t>(pair.second * _driver->getMaxPosThumb()), 0, _driver->getMaxPosThumb()); ARMARX_INFO << "set thumb " << pos; diff --git a/source/RobotAPI/components/units/ForceTorqueObserver.cpp b/source/RobotAPI/components/units/ForceTorqueObserver.cpp index 3d44b1046..4a99205ed 100644 --- a/source/RobotAPI/components/units/ForceTorqueObserver.cpp +++ b/source/RobotAPI/components/units/ForceTorqueObserver.cpp @@ -36,7 +36,7 @@ #include <RobotAPI/libraries/core/RobotAPIObjectFactories.h> -#include <boost/algorithm/string/trim.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> #define RAWFORCE "_rawforcevectors" #define OFFSETFORCE "_forceswithoffsetvectors" @@ -85,14 +85,14 @@ namespace armarx auto sensorRobotNodeSplit = armarx::Split(getProperty<std::string>("SensorRobotNodeMapping").getValue(), ","); for (auto& elem : sensorRobotNodeSplit) { - boost::trim(elem); + simox::alg::trim(elem); auto split = armarx::Split(elem, ":"); if (split.size() >= 2) { sensorRobotNodeMapping.emplace( - boost::trim_copy(split.at(0)), - std::make_pair(boost::trim_copy(split.at(1)), - split.size() >= 3 ? boost::trim_copy(split.at(2)) : "")); + simox::alg::trim_copy(split.at(0)), + std::make_pair(simox::alg::trim_copy(split.at(1)), + split.size() >= 3 ? simox::alg::trim_copy(split.at(2)) : "")); } } } diff --git a/source/RobotAPI/components/units/ForceTorqueUnitSimulation.cpp b/source/RobotAPI/components/units/ForceTorqueUnitSimulation.cpp index 6cfb8340d..2a4d495c8 100644 --- a/source/RobotAPI/components/units/ForceTorqueUnitSimulation.cpp +++ b/source/RobotAPI/components/units/ForceTorqueUnitSimulation.cpp @@ -27,7 +27,7 @@ #include <ArmarXCore/core/util/StringHelpers.h> -#include <boost/algorithm/string.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> namespace armarx { @@ -38,10 +38,8 @@ namespace armarx sensorNamesList = Split(getProperty<std::string>("SensorNames").getValue(), ","); for (auto& sensor : sensorNamesList) { - boost::trim(sensor); + simox::alg::trim(sensor); } - //std::vector<std::string> sensorNamesList; - //boost::split(sensorNamesList, sensorNames, boost::is_any_of(",")); for (std::vector<std::string>::iterator s = sensorNamesList.begin(); s != sensorNamesList.end(); s++) { diff --git a/source/RobotAPI/components/units/HeadIKUnit.cpp b/source/RobotAPI/components/units/HeadIKUnit.cpp index 8e3037bad..1bbf0abff 100644 --- a/source/RobotAPI/components/units/HeadIKUnit.cpp +++ b/source/RobotAPI/components/units/HeadIKUnit.cpp @@ -31,14 +31,10 @@ #include <VirtualRobot/IK/GazeIK.h> #include <VirtualRobot/LinkedCoordinate.h> -#include <boost/algorithm/string/trim.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> -#include <boost/shared_ptr.hpp> #include <memory> -using boost::dynamic_pointer_cast; -using std::dynamic_pointer_cast; - namespace armarx { @@ -147,7 +143,7 @@ namespace armarx this->robotNodeSetNames = armarx::Split(robotNodeSetName, ","); for (auto& setName : robotNodeSetNames) { - boost::trim(setName); + simox::alg::trim(setName); } this->targetPosition->x = targetPosition->x; this->targetPosition->y = targetPosition->y; @@ -311,7 +307,7 @@ namespace armarx auto tcpNode = kinematicChain->getTCP(); VirtualRobot::RobotNodePrismaticPtr virtualPrismaticJoint; - virtualPrismaticJoint = dynamic_pointer_cast<VirtualRobot::RobotNodePrismatic>(tcpNode); + virtualPrismaticJoint = std::dynamic_pointer_cast<VirtualRobot::RobotNodePrismatic>(tcpNode); if (!virtualPrismaticJoint) { ARMARX_WARNING << deactivateSpam(10, robotNodeSetName) << "Head IK Kinematic Chain TCP is not a prismatic joint! skipping joint set"; diff --git a/source/RobotAPI/components/units/KinematicUnit.cpp b/source/RobotAPI/components/units/KinematicUnit.cpp index 5df973345..9c046e0c7 100644 --- a/source/RobotAPI/components/units/KinematicUnit.cpp +++ b/source/RobotAPI/components/units/KinematicUnit.cpp @@ -29,13 +29,11 @@ #include <VirtualRobot/XML/RobotIO.h> #include <VirtualRobot/RobotNodeSet.h> #include <VirtualRobot/VirtualRobotException.h> -#include <VirtualRobot/RuntimeEnvironment.h> #include <ArmarXCore/core/system/ArmarXDataPath.h> #include <ArmarXCore/core/application/Application.h> #include <ArmarXCore/core/system/cmake/CMakePackageFinder.h> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> namespace armarx { @@ -68,12 +66,9 @@ namespace armarx if (!project.empty()) { CMakePackageFinder finder(project); - Ice::StringSeq projectIncludePaths; + auto pathsString = finder.getDataDir(); - boost::split(projectIncludePaths, - pathsString, - boost::is_any_of(";,"), - boost::token_compress_on); + Ice::StringSeq projectIncludePaths = simox::alg::split(pathsString, ";,"); includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end()); } std::string robotFile = relativeRobotFile; diff --git a/source/RobotAPI/components/units/KinematicUnitObserver.cpp b/source/RobotAPI/components/units/KinematicUnitObserver.cpp index 1dacd798c..64fcc6bf3 100644 --- a/source/RobotAPI/components/units/KinematicUnitObserver.cpp +++ b/source/RobotAPI/components/units/KinematicUnitObserver.cpp @@ -38,8 +38,7 @@ #include <VirtualRobot/Nodes/RobotNode.h> #include <ArmarXCore/observers/checks/ConditionCheckEqualsWithTolerance.h> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> namespace armarx { @@ -73,12 +72,9 @@ namespace armarx if (!project.empty()) { CMakePackageFinder finder(project); - Ice::StringSeq projectIncludePaths; + auto pathsString = finder.getDataDir(); - boost::split(projectIncludePaths, - pathsString, - boost::is_any_of(";,"), - boost::token_compress_on); + Ice::StringSeq projectIncludePaths = simox::alg::split(pathsString, ";,"); includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end()); } diff --git a/source/RobotAPI/components/units/KinematicUnitSimulation.cpp b/source/RobotAPI/components/units/KinematicUnitSimulation.cpp index 69dbe9ee5..643995773 100644 --- a/source/RobotAPI/components/units/KinematicUnitSimulation.cpp +++ b/source/RobotAPI/components/units/KinematicUnitSimulation.cpp @@ -30,7 +30,6 @@ #include <VirtualRobot/RobotNodeSet.h> #include <VirtualRobot/Nodes/RobotNode.h> #include <VirtualRobot/VirtualRobotException.h> -#include <VirtualRobot/RuntimeEnvironment.h> #include <ArmarXCore/core/system/ArmarXDataPath.h> #include <ArmarXCore/core/time/TimeUtil.h> #include <ArmarXCore/core/util/algorithm.h> diff --git a/source/RobotAPI/components/units/RobotUnit/BasicControllers.cpp b/source/RobotAPI/components/units/RobotUnit/BasicControllers.cpp index e106a9dbb..f779b851b 100644 --- a/source/RobotAPI/components/units/RobotUnit/BasicControllers.cpp +++ b/source/RobotAPI/components/units/RobotUnit/BasicControllers.cpp @@ -22,11 +22,12 @@ #include "BasicControllers.h" -#include <boost/algorithm/clamp.hpp> - #include <ArmarXCore/core/util/algorithm.h> #include <ArmarXCore/core/logging/Logging.h> #include "util/CtrlUtil.h" + +#include <algorithm> + namespace armarx { float velocityControlWithAccelerationBounds( @@ -40,7 +41,7 @@ namespace armarx maxV = std::abs(maxV); acceleration = std::abs(acceleration); deceleration = std::abs(deceleration); - targetV = boost::algorithm::clamp(targetV, -maxV, maxV); + targetV = std::clamp(targetV, -maxV, maxV); //we can have 3 cases: // 1. we directly set v and ignore acc/dec (if |curr - target| <= limit) @@ -67,7 +68,7 @@ namespace armarx return targetV; } - const float deltaVel = boost::algorithm::clamp(sign(currentV) * usedacc * dt, -maxDeltaV, maxDeltaV); + const float deltaVel = std::clamp(sign(currentV) * usedacc * dt, -maxDeltaV, maxDeltaV); const float nextV = currentV + deltaVel; return nextV; } @@ -123,7 +124,7 @@ namespace armarx // s = v²/(2a) <=> a = v²/(2s) const float dec = std::abs(vsquared / 2.f / wayToGo); const float vel = currentV - sign(currentV) * dec * upperDt; - nextv = boost::algorithm::clamp(vel, -maxV, maxV); + nextv = std::clamp(vel, -maxV, maxV); if (sign(currentV) != sign(nextv)) { //stop now @@ -182,9 +183,9 @@ namespace armarx sign(posErrorIfBrakingNow) != signV; // we are moving away from the target const float usedacc = decelerate ? -deceleration : acceleration; const float maxDeltaV = std::abs(usedacc * dt); - const float deltaVel = boost::algorithm::clamp(signV * usedacc * dt, -maxDeltaV, maxDeltaV); + const float deltaVel = std::clamp(signV * usedacc * dt, -maxDeltaV, maxDeltaV); - float newTargetVel = boost::algorithm::clamp(currentV + deltaVel, -maxV, maxV); + float newTargetVel = std::clamp(currentV + deltaVel, -maxV, maxV); bool usePID = std::abs(newTargetVelPController) < std::abs(newTargetVel); // ARMARX_INFO << deactivateSpam(0.01) << VAROUT(usePID) << VAROUT(dt) << VAROUT(decelerate) << VAROUT(usedacc) << VAROUT(maxDeltaV) << VAROUT(deltaVel) << VAROUT(newTargetVel) << VAROUT(newTargetVelPController) // << VAROUT(currentPosition) << VAROUT(targetPosition); @@ -241,7 +242,7 @@ namespace armarx dt, maxDt, currentV, maxV, acceleration, deceleration, - currentPosition, boost::algorithm::clamp(targetPosition, positionLimitLo, positionLimitHi), + currentPosition, std::clamp(targetPosition, positionLimitLo, positionLimitHi), p ); } @@ -345,7 +346,7 @@ namespace armarx return targetV; } - const float deltaVel = boost::algorithm::clamp(sign(currentV) * usedacc * useddt, -maxDeltaV, maxDeltaV); + const float deltaVel = std::clamp(sign(currentV) * usedacc * useddt, -maxDeltaV, maxDeltaV); const float nextV = currentV + deltaVel; return nextV; } @@ -487,7 +488,7 @@ namespace armarx // s = v²/(2a) <=> a = v²/(2s) const float dec = std::abs(vsquared / 2.f / wayToGo); const float vel = currentV - sign(currentV) * dec * upperDt; - nextv = boost::algorithm::clamp(vel, -maxV, maxV); + nextv = std::clamp(vel, -maxV, maxV); // ARMARX_INFO << deactivateSpam(1) << "clamped new Vel: " << VAROUT(nextv); if (sign(currentV) != sign(nextv)) { @@ -579,7 +580,7 @@ namespace armarx const float usedacc = decelerate ? -usedDeceleration : acceleration; const float deltaVel = signV * usedacc * useddt; - float newTargetVelRampCtrl = boost::algorithm::clamp(currentV + deltaVel, -maxV, maxV); + float newTargetVelRampCtrl = std::clamp(currentV + deltaVel, -maxV, maxV); bool PIDActive = /*std::abs(newTargetVelPController) < std::abs(newTargetVelRampCtrl) || std::abs(newTargetVelPController) < pControlVelLimit ||*/ std::abs(positionError) < pControlPosErrorLimit; @@ -960,7 +961,7 @@ namespace armarx sign(posErrorIfBrakingNow) != signV; // we are moving away from the target const double deltaVel = ctrlutil::v(useddt, 0, newAcceleration, usedJerk);//signV * newAcceleration * useddt; double newTargetVelRampCtrl = ctrlutil::v(useddt, currentV, currentAcc, usedJerk);//boost::algorithm::clamp(currentV + deltaVel, -maxV, maxV); - newTargetVelRampCtrl = boost::algorithm::clamp(newTargetVelRampCtrl, -maxV, maxV); + newTargetVelRampCtrl = std::clamp(newTargetVelRampCtrl, -maxV, maxV); bool usePID = std::abs(newTargetVelPController) < std::abs(newTargetVelRampCtrl); //|| // std::abs(newTargetVelPController) < pControlVelLimit && //std::abs(positionError) < pControlPosErrorLimit; @@ -1335,7 +1336,7 @@ namespace armarx // s = v²/(2a) <=> a = v²/(2s) const double dec = std::abs(vsquared / 2.0 / wayToGo); const double vel = currentV - sign(currentV) * dec * upperDt; - nextv = boost::algorithm::clamp(vel, -maxV, maxV); + nextv = std::clamp<double>(vel, -maxV, maxV); // ARMARX_INFO /*<< deactivateSpam(0.1)*/ << "clamped new Vel: " << VAROUT(nextv) << VAROUT(currentV); if (sign(currentV) != sign(nextv)) { diff --git a/source/RobotAPI/components/units/RobotUnit/ControllerParts/CartesianImpedanceController.cpp b/source/RobotAPI/components/units/RobotUnit/ControllerParts/CartesianImpedanceController.cpp index 1af55624f..a2cce575f 100644 --- a/source/RobotAPI/components/units/RobotUnit/ControllerParts/CartesianImpedanceController.cpp +++ b/source/RobotAPI/components/units/RobotUnit/ControllerParts/CartesianImpedanceController.cpp @@ -1,4 +1,5 @@ -#include <boost/algorithm/clamp.hpp> + +#include "CartesianImpedanceController.h" #include <SimoxUtility/math/convert/mat4f_to_pos.h> #include <SimoxUtility/math/convert/mat4f_to_quat.h> @@ -6,7 +7,8 @@ #include <VirtualRobot/MathTools.h> -#include "CartesianImpedanceController.h" +#include <algorithm> + using namespace armarx; @@ -112,7 +114,7 @@ const Eigen::VectorXf& CartesianImpedanceController::run( (I - jacobi.transpose() * jtpinv) * nullspaceTorque; for (int i = 0; i < targetJointTorques.size(); ++i) { - targetJointTorques(i) = boost::algorithm::clamp(targetJointTorques(i), -cfg.torqueLimit, cfg.torqueLimit); + targetJointTorques(i) = std::clamp(targetJointTorques(i), -cfg.torqueLimit, cfg.torqueLimit); } //write debug data { diff --git a/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointTaskSpaceImpedanceController.cpp b/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointTaskSpaceImpedanceController.cpp index 36c2bbdeb..61ff24e37 100644 --- a/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointTaskSpaceImpedanceController.cpp +++ b/source/RobotAPI/components/units/RobotUnit/NJointControllers/NJointTaskSpaceImpedanceController.cpp @@ -19,15 +19,11 @@ * @copyright http://www.gnu.org/licenses/gpl-2.0.txt * GNU General Public License */ -#include <boost/algorithm/clamp.hpp> + +#include "NJointTaskSpaceImpedanceController.h" #include <SimoxUtility/math/convert/mat4f_to_pos.h> #include <SimoxUtility/math/convert/mat4f_to_quat.h> -#include <SimoxUtility/math/compare/is_equal.h> - -#include <VirtualRobot/MathTools.h> - -#include "NJointTaskSpaceImpedanceController.h" using namespace armarx; @@ -100,7 +96,7 @@ void NJointTaskSpaceImpedanceController::rtRun(const IceUtil::Time& /*sensorValu velocitySensors, positionSensors ); - ARMARX_CHECK_EXPRESSION(simox::math::is_equal(targets.size(), jointDesiredTorques.size())); + ARMARX_CHECK_EQUAL(targets.size(), jointDesiredTorques.size()); for (size_t i = 0; i < targets.size(); ++i) { diff --git a/source/RobotAPI/components/units/RobotUnit/PDController.h b/source/RobotAPI/components/units/RobotUnit/PDController.h index e534efd0c..87abee658 100644 --- a/source/RobotAPI/components/units/RobotUnit/PDController.h +++ b/source/RobotAPI/components/units/RobotUnit/PDController.h @@ -23,11 +23,6 @@ #include <algorithm> #include <cmath> -#include <tuple> - -#include <boost/algorithm/clamp.hpp> - -#include <ArmarXCore/core/util/algorithm.h> namespace armarx { @@ -310,7 +305,7 @@ namespace armarx } if (maxError != 0) { - error = boost::algorithm::clamp(error, -maxError, +maxError); + error = std::clamp(error, -maxError, +maxError); } const FloatingType pOut = Kp * error; @@ -328,11 +323,11 @@ namespace armarx if (outRampDelta != 0) { - out = boost::algorithm::clamp(out, lastOutValue - outRampDelta, lastOutValue + outRampDelta); + out = std::clamp(out, lastOutValue - outRampDelta, lastOutValue + outRampDelta); } if (limitOutLo != limitOutHi) { - out = boost::algorithm::clamp(out, limitOutLo, limitOutHi); + out = std::clamp(out, limitOutLo, limitOutHi); } if (lastOutInterpolation != 0) { diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleLogging.cpp b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleLogging.cpp index da2024265..33bdd5efd 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleLogging.cpp +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleLogging.cpp @@ -20,9 +20,6 @@ * GNU General Public License */ -#include <regex> - -#include <boost/iterator/transform_iterator.hpp> #include <ArmarXCore/util/CPPUtility/trace.h> #include <ArmarXCore/util/CPPUtility/Iterator.h> @@ -36,7 +33,8 @@ #include "../util/ControlThreadOutputBuffer.h" -#include <boost/algorithm/string/predicate.hpp> +#include <regex> + namespace armarx::RobotUnitModule::details { struct DoLoggingDurations @@ -122,25 +120,21 @@ namespace armarx::RobotUnitModule ARMARX_TRACE; throwIfInControlThread(BOOST_CURRENT_FUNCTION); Ice::StringSeq result; - const auto getName = [](const auto & fieldData) - { - return fieldData.name; - }; for (const auto& data : sensorDeviceValueMetaData) { - result.insert( - result.end(), - boost::make_transform_iterator(data.fields.begin(), getName), - boost::make_transform_iterator(data.fields.end(), getName)); + for (auto& fieldData : data.fields) + { + result.push_back(fieldData.name); + } } for (const auto& datas : controlDeviceValueMetaData) { for (const auto& data : datas) { - result.insert( - result.end(), - boost::make_transform_iterator(data.fields.begin(), getName), - boost::make_transform_iterator(data.fields.end(), getName)); + for (auto& fieldData : data.fields) + { + result.push_back(fieldData.name); + } } } return result; diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleRobotData.cpp b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleRobotData.cpp index 955a33605..b60019683 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleRobotData.cpp +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleRobotData.cpp @@ -30,9 +30,7 @@ #include "RobotUnitModuleRobotData.h" -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> -#include <boost/algorithm/string/trim.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> namespace armarx::RobotUnitModule { @@ -112,10 +110,7 @@ namespace armarx::RobotUnitModule { CMakePackageFinder finder(robotProjectName); auto pathsString = finder.getDataDir(); - boost::split(includePaths, - pathsString, - boost::is_any_of(";,"), - boost::token_compress_on); + includePaths = simox::alg::split(pathsString, ";,"); ArmarXDataPath::addDataPaths(includePaths); } if (!ArmarXDataPath::getAbsolutePath(robotFileName, robotFileName, includePaths)) diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleSelfCollisionChecker.cpp b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleSelfCollisionChecker.cpp index 1e0ce16e1..e65e6506a 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleSelfCollisionChecker.cpp +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleSelfCollisionChecker.cpp @@ -29,8 +29,7 @@ #include "../NJointControllers/NJointController.h" -#include <boost/algorithm/string/trim.hpp> -#include <boost/algorithm/string/classification.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> #define FLOOR_OBJ_STR "FLOOR" @@ -54,7 +53,7 @@ namespace armarx::RobotUnitModule { ARMARX_DEBUG << "---- group: " << group; // Removing parentheses - boost::trim_if(group, boost::is_any_of(" \t{}")); + simox::alg::trim_if(group, " \t{}"); std::set<std::set<std::string>> setsOfNode; { auto splittedRaw = armarx::Split(group, ",", true, true); @@ -64,7 +63,7 @@ namespace armarx::RobotUnitModule } for (auto& subentry : splittedRaw) { - boost::trim_if(subentry, boost::is_any_of(" \t{}")); + simox::alg::trim_if(subentry, " \t{}"); if (selfCollisionAvoidanceRobot->hasRobotNodeSet(subentry)) { std::set<std::string> nodes; diff --git a/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.h b/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.h index ef9e3aed2..25c81d4ac 100644 --- a/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.h +++ b/source/RobotAPI/components/units/RobotUnit/util/ControlThreadOutputBuffer.h @@ -24,20 +24,18 @@ #include "HeterogenousContinuousContainer.h" -#include <vector> +#include "../SensorValues/SensorValueBase.h" +#include "../ControlTargets/ControlTargetBase.h" -#include <boost/format.hpp> +#include "../Devices/SensorDevice.h" +#include "../Devices/ControlDevice.h" #include <ArmarXCore/core/exceptions/local/ExpressionException.h> #include <ArmarXCore/core/util/StringHelperTemplates.h> #include <ArmarXCore/core/util/PropagateConst.h> #include <ArmarXCore/core/util/TripleBuffer.h> -#include "../SensorValues/SensorValueBase.h" -#include "../ControlTargets/ControlTargetBase.h" - -#include "../Devices/SensorDevice.h" -#include "../Devices/ControlDevice.h" +#include <vector> namespace armarx { @@ -52,23 +50,6 @@ namespace armarx::RobotUnitModule namespace armarx::detail { - inline std::string armarx_sprintf_helper(boost::format& f) - { - return boost::str(f); - } - - template<class T, class... Args> - inline std::string armarx_sprintf_helper(boost::format& f, T&& t, Args&& ... args) - { - return armarx_sprintf_helper(f % std::forward<T>(t), std::forward<Args>(args)...); - } - template<class... Args> - inline std::string armarx_sprintf(const std::string& formatString, Args&& ... args) - { - boost::format f(formatString); - return ::armarx::detail::armarx_sprintf_helper(f, std::forward<Args>(args)...); - } - struct RtMessageLogEntryBase { RtMessageLogEntryBase(): @@ -278,7 +259,6 @@ namespace armarx } #define _detail_ARMARX_RT_REDIRECT( ...) ([&]{ \ - ::armarx::detail::armarx_sprintf(__VA_ARGS__); \ ARMARX_INFO << deactivateSpam(1) << "Redirected RT Logging:\n";\ return &::armarx::detail::RtMessageLogEntryNull::Instance;}()) diff --git a/source/RobotAPI/components/units/TCPControlUnit.cpp b/source/RobotAPI/components/units/TCPControlUnit.cpp index 9c434042b..4f79878ee 100644 --- a/source/RobotAPI/components/units/TCPControlUnit.cpp +++ b/source/RobotAPI/components/units/TCPControlUnit.cpp @@ -31,10 +31,9 @@ #include <VirtualRobot/XML/RobotIO.h> #include <VirtualRobot/MathTools.h> -#include <Eigen/Core> +#include <SimoxUtility/algorithm/string/string_tools.h> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> +#include <Eigen/Core> #include <memory> #include <cfloat> @@ -101,11 +100,7 @@ namespace armarx } else { - std::vector<std::string> nodesetNames; - boost::split(nodesetNames, - nodesetsString, - boost::is_any_of(","), - boost::token_compress_on); + std::vector<std::string> nodesetNames = simox::alg::split(nodesetsString, ","); for (auto& name : nodesetNames) { diff --git a/source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.cpp b/source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.cpp index af108e0e0..52af2c8dd 100644 --- a/source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.cpp +++ b/source/RobotAPI/drivers/HokuyoLaserUnit/HokuyoLaserUnit.cpp @@ -24,10 +24,11 @@ #include <ArmarXCore/observers/variant/TimestampVariant.h> -#include <boost/algorithm/string/replace.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> #include <HokuyoLaserScannerDriver/urg_utils.h> + using namespace armarx; @@ -277,7 +278,7 @@ void HokuyoLaserScanDevice::run() durations["update_ms"] = new Variant((time_update - time_measure).toMilliSecondsDouble()); durations["topic_sensor_ms"] = new Variant((time_topicSensor - time_update).toMilliSecondsDouble()); durations["topic_health_ms"] = new Variant((time_topicHeartbeat - time_topicSensor).toMilliSecondsDouble()); - debugObserver->setDebugChannel("LaserScannerDuration_" + boost::replace_all_copy(ip, ".", "_"), durations); + debugObserver->setDebugChannel("LaserScannerDuration_" + simox::alg::replace_all(ip, ".", "_"), durations); if (duration.toSecondsDouble() > 0.1) { diff --git a/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp b/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp index c379eed20..4b34e9a3a 100644 --- a/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp +++ b/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp @@ -24,19 +24,15 @@ #include <RobotAPI/components/ArViz/Coin/VisualizationObject.h> #include <RobotAPI/components/ArViz/Coin/VisualizationRobot.h> -#include <string> - #include <ArmarXCore/core/ArmarXManager.h> +#include <ArmarXCore/observers/variant/Variant.h> + +#include <SimoxUtility/algorithm/string/string_tools.h> #include <QLineEdit> #include <QMessageBox> #include <QTimer> - -#include <ArmarXCore/observers/variant/Variant.h> - - #include <QFileDialog> -#include <boost/algorithm/string/predicate.hpp> #define ENABLE_INTROSPECTION 1 @@ -1065,7 +1061,7 @@ namespace armarx { return; } - if (!boost::algorithm::ends_with(s, ".wrl")) + if (!simox::alg::ends_with(s, ".wrl")) { s += ".wrl"; } diff --git a/source/RobotAPI/gui-plugins/DebugDrawerViewer/DebugDrawerViewerWidgetController.cpp b/source/RobotAPI/gui-plugins/DebugDrawerViewer/DebugDrawerViewerWidgetController.cpp index f4a9f5673..9c437484c 100644 --- a/source/RobotAPI/gui-plugins/DebugDrawerViewer/DebugDrawerViewerWidgetController.cpp +++ b/source/RobotAPI/gui-plugins/DebugDrawerViewer/DebugDrawerViewerWidgetController.cpp @@ -23,9 +23,9 @@ #include <ArmarXCore/core/ArmarXManager.h> -#include <QTimer> +#include <SimoxUtility/algorithm/string/string_tools.h> -#include <boost/algorithm/string/join.hpp> +#include <QTimer> #include <string> @@ -282,7 +282,7 @@ namespace armarx { std::stringstream itemText; itemText << layer.layerName - << " (" << boost::algorithm::join(annotations, ", ") << ")"; + << " (" << simox::alg::join(annotations, ", ") << ")"; return { itemText.str().c_str() }; } } diff --git a/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h b/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h index 52288ccc8..538c1b5cb 100644 --- a/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h +++ b/source/RobotAPI/libraries/ArmarXEtherCAT/DeviceContainer.h @@ -26,6 +26,11 @@ #include <memory> #include <VirtualRobot/VirtualRobot.h> +// These includes are only here because Armar6RT is currently locked (missing include in Slave.cpp) +// TODO: Remove once Armar6RT includes the needed headers +#include <boost/core/demangle.hpp> +#include <boost/optional.hpp> + namespace armarx { class MultiNodeRapidXMLReader; diff --git a/source/RobotAPI/libraries/GraspingUtility/BimanualGraspCandidateHelper.h b/source/RobotAPI/libraries/GraspingUtility/BimanualGraspCandidateHelper.h index 19a474878..1b2e9b10c 100644 --- a/source/RobotAPI/libraries/GraspingUtility/BimanualGraspCandidateHelper.h +++ b/source/RobotAPI/libraries/GraspingUtility/BimanualGraspCandidateHelper.h @@ -23,17 +23,18 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <RobotAPI/interface/units/GraspCandidateProviderInterface.h> +#include <RobotAPI/libraries/core/Pose.h> #include <VirtualRobot/Robot.h> -#include <RobotAPI/libraries/core/Pose.h> +#include <memory> + namespace armarx { - typedef boost::shared_ptr<class BimanualGraspCandidateHelper> BimanualGraspCandidateHelperPtr; + typedef std::shared_ptr<class BimanualGraspCandidateHelper> BimanualGraspCandidateHelperPtr; class BimanualGraspCandidateHelper { diff --git a/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h b/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h index 050958f91..0fa9fe1ea 100644 --- a/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h +++ b/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h @@ -23,17 +23,17 @@ #pragma once -#include <boost/shared_ptr.hpp> - #include <RobotAPI/interface/units/GraspCandidateProviderInterface.h> +#include <RobotAPI/libraries/core/Pose.h> #include <VirtualRobot/Robot.h> -#include <RobotAPI/libraries/core/Pose.h> +#include <memory> + namespace armarx { - typedef boost::shared_ptr<class GraspCandidateHelper> GraspCandidateHelperPtr; + typedef std::shared_ptr<class GraspCandidateHelper> GraspCandidateHelperPtr; class GraspCandidateHelper { diff --git a/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointTaskSpaceImpedanceDMPController.cpp b/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointTaskSpaceImpedanceDMPController.cpp index 0a08c5396..90e2cb1f2 100644 --- a/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointTaskSpaceImpedanceDMPController.cpp +++ b/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointTaskSpaceImpedanceDMPController.cpp @@ -741,7 +741,7 @@ namespace armarx void NJointTaskSpaceImpedanceDMPController::setNullspaceVelocityKd(const Eigen::VectorXf& kd, const Ice::Current&) { - ARMARX_CHECK_EQUAL(kd.size(), targets.size()); + ARMARX_CHECK_EQUAL((std::size_t)kd.size(), targets.size()); ARMARX_INFO << "set nullspace kd " << VAROUT(kd); LockGuardType guard(controllerMutex); ctrlParams.getWriteBuffer().dnull = kd; @@ -750,7 +750,7 @@ namespace armarx void NJointTaskSpaceImpedanceDMPController::setNullspaceVelocityKp(const Eigen::VectorXf& kp, const Ice::Current&) { - ARMARX_CHECK_EQUAL(kp.size(), targets.size()); + ARMARX_CHECK_EQUAL((std::size_t)kp.size(), targets.size()); ARMARX_INFO << "set linear kp " << VAROUT(kp); LockGuardType guard(controllerMutex); ctrlParams.getWriteBuffer().knull = kp; @@ -761,7 +761,7 @@ namespace armarx void NJointTaskSpaceImpedanceDMPController::setDefaultNullSpaceJointValues(const Eigen::VectorXf& jointValues, const Ice::Current&) { - ARMARX_CHECK_EQUAL(jointValues.size(), targets.size()); + ARMARX_CHECK_EQUAL((std::size_t)jointValues.size(), targets.size()); defaultNullSpaceJointValues.getWriteBuffer() = jointValues; defaultNullSpaceJointValues.commitWrite(); diff --git a/source/RobotAPI/libraries/SimpleTrajectory/Track.cpp b/source/RobotAPI/libraries/SimpleTrajectory/Track.cpp index 6f6bd2970..88258722f 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/Track.cpp +++ b/source/RobotAPI/libraries/SimpleTrajectory/Track.cpp @@ -7,9 +7,9 @@ namespace armarx::trajectory template <> void Track<VariantValue>::checkValueType(const VariantValue& value) { - if (!empty() && value.type() != keyframes.front().value.type()) + if (!empty() && value.index() != keyframes.front().value.index()) { - throw error::WrongValueTypeInKeyframe(id, value.type(), keyframes.front().value.type()); + throw error::WrongValueTypeInKeyframe(id, value.index(), keyframes.front().value.index()); } } diff --git a/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.cpp b/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.cpp index 5211a5044..3dad90458 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.cpp +++ b/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.cpp @@ -82,7 +82,7 @@ namespace armarx { return [func](VariantValue value) { - func(boost::get<float>(value)); + func(std::get<float>(value)); }; } @@ -90,7 +90,7 @@ namespace armarx { return [func](VariantValue value) { - func(boost::get<Eigen::MatrixXf>(value)); + func(std::get<Eigen::MatrixXf>(value)); }; } @@ -98,7 +98,7 @@ namespace armarx { return [func](VariantValue value) { - func(boost::get<Eigen::Quaternionf>(value)); + func(std::get<Eigen::Quaternionf>(value)); }; } diff --git a/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.h b/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.h index 5600a669f..f79148ab1 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.h +++ b/source/RobotAPI/libraries/SimpleTrajectory/Trajectory.h @@ -90,7 +90,7 @@ namespace armarx::trajectory { return [&v](VariantValue value) { - v = boost::get<ValueT>(value); + v = std::get<ValueT>(value); }; } diff --git a/source/RobotAPI/libraries/SimpleTrajectory/VariantValue.h b/source/RobotAPI/libraries/SimpleTrajectory/VariantValue.h index c7e6db669..ec4f5086b 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/VariantValue.h +++ b/source/RobotAPI/libraries/SimpleTrajectory/VariantValue.h @@ -1,15 +1,16 @@ #pragma once -#include <boost/variant.hpp> +#include <Eigen/Core> +#include <Eigen/Geometry> -#include <Eigen/Eigen> +#include <variant> namespace armarx::trajectory { /// Variant for trajectory values. - using VariantValue = boost::variant<float, Eigen::MatrixXf, Eigen::Quaternionf>; + using VariantValue = std::variant<float, Eigen::MatrixXf, Eigen::Quaternionf>; /// ID of tracks. using TrackID = std::string; diff --git a/source/RobotAPI/libraries/SimpleTrajectory/exceptions.cpp b/source/RobotAPI/libraries/SimpleTrajectory/exceptions.cpp index 0a1bbdbc9..8af3f984e 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/exceptions.cpp +++ b/source/RobotAPI/libraries/SimpleTrajectory/exceptions.cpp @@ -34,18 +34,18 @@ namespace armarx::trajectory::error return ss.str(); } - WrongValueTypeInKeyframe::WrongValueTypeInKeyframe( - const TrackID& trackID, const std::type_info& type, const std::type_info& expected) : - TrajectoryException(makeMsg(trackID, type, expected)) - {} - - std::string WrongValueTypeInKeyframe::makeMsg( - const TrackID& id, const std::type_info& type, const std::type_info& expected) + static std::string makeMsg(const TrackID& id, int typeIndex, int expectedTypeIndex) { std::stringstream ss; - ss << "Tried to add keyframe with value type '" << type.name() << "' to non-empty track '" - << id << "' containing values of type '" << expected.name() << "'. \n" + ss << "Tried to add keyframe with value type '" << typeIndex << "' to non-empty track '" + << id << "' containing values of type '" << expectedTypeIndex << "'. \n" << "Only one value type per track is allowed."; return ss.str(); } + + WrongValueTypeInKeyframe::WrongValueTypeInKeyframe(const TrackID& trackID, int typeIndex, int expectedTypeIndex) : + TrajectoryException(makeMsg(trackID, typeIndex, expectedTypeIndex)) + {} + + } diff --git a/source/RobotAPI/libraries/SimpleTrajectory/exceptions.h b/source/RobotAPI/libraries/SimpleTrajectory/exceptions.h index 6235ef3f7..131c5fea4 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/exceptions.h +++ b/source/RobotAPI/libraries/SimpleTrajectory/exceptions.h @@ -38,10 +38,7 @@ namespace armarx::trajectory::error struct WrongValueTypeInKeyframe : public TrajectoryException { - WrongValueTypeInKeyframe(const TrackID& trackID, const std::type_info& type, - const std::type_info& expected); - static std::string makeMsg(const TrackID& trackID, const std::type_info& type, - const std::type_info& expected); + WrongValueTypeInKeyframe(const TrackID& trackID, int typeIndex, int expectedTypeIndex); }; diff --git a/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.cpp b/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.cpp index c4b41c638..4736420d3 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.cpp +++ b/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.cpp @@ -7,8 +7,8 @@ namespace armarx::trajectory template <> VariantValue interpolate::linear<VariantValue>(float t, const VariantValue& lhs, const VariantValue& rhs) { - // dont use boost::get - return boost::apply_visitor(Linear {t}, lhs, rhs); + // dont use std::get + return std::visit(Linear {t}, lhs, rhs); } } diff --git a/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.h b/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.h index 4cf381844..20fc87cc9 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.h +++ b/source/RobotAPI/libraries/SimpleTrajectory/interpolate/linear.h @@ -10,7 +10,7 @@ namespace armarx::trajectory::interpolate /** * @brief Linear interpolation visitor: Interpolates between the given values linearly. */ - class Linear : public boost::static_visitor<> + class Linear { public: @@ -25,22 +25,22 @@ namespace armarx::trajectory::interpolate Linear(float t) : t(t) {} template <typename U, typename V> - float operator()(const U&, const V&) const + VariantValue operator()(const U&, const V&) const { throw error::InterpolateDifferentTypesError(); } - float operator()(const float& lhs, const float& rhs) const + VariantValue operator()(const float& lhs, const float& rhs) const { return (1 - t) * lhs + t * rhs; } - Eigen::MatrixXf operator()(const Eigen::MatrixXf& lhs, const Eigen::MatrixXf& rhs) const + VariantValue operator()(const Eigen::MatrixXf& lhs, const Eigen::MatrixXf& rhs) const { return (1 - t) * lhs + t * rhs; } - Eigen::Quaternionf operator()(const Eigen::Quaternionf& lhs, const Eigen::Quaternionf& rhs) const + VariantValue operator()(const Eigen::Quaternionf& lhs, const Eigen::Quaternionf& rhs) const { return lhs.slerp(t, rhs); } @@ -55,7 +55,8 @@ namespace armarx::trajectory::interpolate template <typename ReturnT> ReturnT linear(float t, const VariantValue& lhs, const VariantValue& rhs) { - return boost::get<ReturnT>(boost::apply_visitor(Linear {t}, lhs, rhs)); + VariantValue result = std::visit(Linear {t}, lhs, rhs); + return std::get<ReturnT>(result); } template <> diff --git a/source/RobotAPI/libraries/SimpleTrajectory/test/TrajectoryTest.cpp b/source/RobotAPI/libraries/SimpleTrajectory/test/TrajectoryTest.cpp index 6f0553c52..73afd8c56 100644 --- a/source/RobotAPI/libraries/SimpleTrajectory/test/TrajectoryTest.cpp +++ b/source/RobotAPI/libraries/SimpleTrajectory/test/TrajectoryTest.cpp @@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE(testDifferentTypes) { for (std::size_t j = 0; j < i; ++j) { - BOOST_CHECK_NE(values[i].type(), values[j].type()); + BOOST_CHECK_NE(values[i].index(), values[j].index()); } } diff --git a/source/RobotAPI/libraries/aron/core/test/aronCodeGenerationTest.cpp b/source/RobotAPI/libraries/aron/core/test/aronCodeGenerationTest.cpp index c1db4b859..f2867d76e 100644 --- a/source/RobotAPI/libraries/aron/core/test/aronCodeGenerationTest.cpp +++ b/source/RobotAPI/libraries/aron/core/test/aronCodeGenerationTest.cpp @@ -30,9 +30,6 @@ #include <ctime> #include <numeric> -// Boost -#include <boost/algorithm/string.hpp> - // Test #include <RobotAPI/Test.h> diff --git a/source/RobotAPI/libraries/aron/core/test/aronExtendsTest.cpp b/source/RobotAPI/libraries/aron/core/test/aronExtendsTest.cpp index c9feaee39..4cef5c63f 100644 --- a/source/RobotAPI/libraries/aron/core/test/aronExtendsTest.cpp +++ b/source/RobotAPI/libraries/aron/core/test/aronExtendsTest.cpp @@ -30,9 +30,6 @@ #include <ctime> #include <numeric> -// Boost -#include <boost/algorithm/string.hpp> - // Test #include <RobotAPI/Test.h> diff --git a/source/RobotAPI/libraries/aron/core/test/aronNavigateTest.cpp b/source/RobotAPI/libraries/aron/core/test/aronNavigateTest.cpp index 233814ffd..70adfc5e7 100644 --- a/source/RobotAPI/libraries/aron/core/test/aronNavigateTest.cpp +++ b/source/RobotAPI/libraries/aron/core/test/aronNavigateTest.cpp @@ -30,9 +30,6 @@ #include <ctime> #include <numeric> -// Boost -#include <boost/algorithm/string.hpp> - // Test #include <RobotAPI/Test.h> diff --git a/source/RobotAPI/libraries/aron/core/test/aronOperatorTest.cpp b/source/RobotAPI/libraries/aron/core/test/aronOperatorTest.cpp index 539b6fb04..6c1e44fdb 100644 --- a/source/RobotAPI/libraries/aron/core/test/aronOperatorTest.cpp +++ b/source/RobotAPI/libraries/aron/core/test/aronOperatorTest.cpp @@ -30,9 +30,6 @@ #include <ctime> #include <numeric> -// Boost -#include <boost/algorithm/string.hpp> - // Test #include <RobotAPI/Test.h> diff --git a/source/RobotAPI/libraries/aron/core/test/aronRandomizedTest.cpp b/source/RobotAPI/libraries/aron/core/test/aronRandomizedTest.cpp index d579f3a6d..395de492c 100644 --- a/source/RobotAPI/libraries/aron/core/test/aronRandomizedTest.cpp +++ b/source/RobotAPI/libraries/aron/core/test/aronRandomizedTest.cpp @@ -43,9 +43,6 @@ #include <pcl/point_cloud.h> #include <pcl/point_types.h> -// Boost -#include <boost/algorithm/string.hpp> - // Test #include <RobotAPI/Test.h> diff --git a/source/RobotAPI/libraries/core/RobotStatechartContext.cpp b/source/RobotAPI/libraries/core/RobotStatechartContext.cpp index bef441657..0aa460711 100644 --- a/source/RobotAPI/libraries/core/RobotStatechartContext.cpp +++ b/source/RobotAPI/libraries/core/RobotStatechartContext.cpp @@ -28,9 +28,7 @@ #include <ArmarXCore/core/system/ImportExportComponent.h> #include <ArmarXCore/statechart/Statechart.h> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> -#include <boost/algorithm/string/trim.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> namespace armarx { @@ -51,12 +49,11 @@ namespace armarx if (!getProperty<std::string>("HandUnits").getValue().empty()) { std::string handUnitsProp = getProperty<std::string>("HandUnits").getValue(); - std::vector<std::string> handUnitList; - boost::split(handUnitList, handUnitsProp, boost::is_any_of(",")); + std::vector<std::string> handUnitList = simox::alg::split(handUnitsProp, ","); for (size_t i = 0; i < handUnitList.size(); i++) { - boost::algorithm::trim(handUnitList.at(i)); + simox::alg::trim(handUnitList.at(i)); usingProxy(handUnitList.at(i)); } } @@ -96,12 +93,11 @@ namespace armarx if (!getProperty<std::string>("HandUnits").getValue().empty()) { std::string handUnitsProp = getProperty<std::string>("HandUnits").getValue(); - std::vector<std::string> handUnitList; - boost::split(handUnitList, handUnitsProp, boost::is_any_of(",")); + std::vector<std::string> handUnitList = simox::alg::split(handUnitsProp, ","); for (size_t i = 0; i < handUnitList.size(); i++) { - boost::algorithm::trim(handUnitList.at(i)); + simox::alg::trim(handUnitList.at(i)); HandUnitInterfacePrx handPrx = getProxy<HandUnitInterfacePrx>(handUnitList.at(i)); handUnits[handUnitList.at(i)] = handPrx; ARMARX_INFO << "Fetched handUnit proxy " << handUnitList.at(i) << ": " << handPrx << flush; diff --git a/source/RobotAPI/libraries/core/Trajectory.h b/source/RobotAPI/libraries/core/Trajectory.h index 990de647c..774b324ee 100644 --- a/source/RobotAPI/libraries/core/Trajectory.h +++ b/source/RobotAPI/libraries/core/Trajectory.h @@ -30,15 +30,11 @@ #include <ArmarXCore/core/util/StringHelpers.h> #include <ArmarXCore/observers/variant/Variant.h> -#include <boost/tokenizer.hpp> -#include <boost/unordered_map.hpp> #include <boost/multi_index_container.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/random_access_index.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/member.hpp> -#include <boost/typeof/typeof.hpp> -#include <boost/type_traits/is_arithmetic.hpp> #include <Eigen/Core> @@ -200,7 +196,7 @@ namespace armarx Trajectory() {} Trajectory(const Trajectory& source); template <typename T> - Trajectory(const std::vector<T>& data, const Ice::DoubleSeq timestamps = Ice::DoubleSeq(), const std::string& dimensionName = "", typename boost::enable_if<boost::is_arithmetic< T > >::type* t = 0) + Trajectory(const std::vector<T>& data, const Ice::DoubleSeq timestamps = Ice::DoubleSeq(), const std::string& dimensionName = "", typename std::enable_if_t<std::is_arithmetic_v< T > >* t = 0) { if (data.size() == 0) { diff --git a/source/RobotAPI/libraries/core/remoterobot/RemoteRobot.cpp b/source/RobotAPI/libraries/core/remoterobot/RemoteRobot.cpp index 65db64e87..60577ef2d 100644 --- a/source/RobotAPI/libraries/core/remoterobot/RemoteRobot.cpp +++ b/source/RobotAPI/libraries/core/remoterobot/RemoteRobot.cpp @@ -23,11 +23,6 @@ */ #include "RemoteRobot.h" -#include <boost/foreach.hpp> -#include <boost/format.hpp> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> - #include <VirtualRobot/VirtualRobot.h> #include <VirtualRobot/XML/RobotIO.h> #include <VirtualRobot/RobotConfig.h> @@ -43,6 +38,8 @@ #include <RobotAPI/libraries/core/FramedPose.h> #include <ArmarXCore/core/logging/Logging.h> +#include <SimoxUtility/algorithm/string/string_tools.h> + #include <Eigen/Geometry> //#define DMES(Obj) cout << format("[%1%|%2%|%3%] %4%") % __FILE__ % __LINE__ % __func__ % Obj; @@ -153,7 +150,7 @@ namespace armarx } NameList nodes = _robot->getRobotNodes(); - BOOST_FOREACH(std::string name, nodes) + for (std::string const& name : nodes) { storeNodes.push_back(this->getRobotNode(name)); } @@ -177,7 +174,7 @@ namespace armarx { NameList sets = _robot->getRobotNodeSets(); - BOOST_FOREACH(std::string name, sets) + for (std::string const& name : sets) { storeNodeSet.push_back(this->getRobotNodeSet(name)); } @@ -312,13 +309,6 @@ namespace armarx { SharedRobotNodeInterfacePrx rnRemote = _robot->getRobotNode(childrenBase[i]); VirtualRobot::RobotNodePtr localNode = createLocalNode(rnRemote, allNodes, childrenMap, robo); - /* boost::shared_ptr< RemoteRobotNode<VirtualRobotNodeType> > rnRemote = boost::dynamic_pointer_cast<RemoteRobotNode>(rnRemoteBase); - if (!rnRemote) - { - ARMARX_ERROR_S << "RemoteRobot does not know robot node with name " << children[i]; - continue; - }*/ - if (!localNode) { @@ -413,13 +403,10 @@ namespace armarx } CMakePackageFinder project(projectName); - Ice::StringSeq projectIncludePaths; + auto pathsString = project.getDataDir(); ARMARX_DEBUG_S << "Data paths of ArmarX package " << projectName << ": " << pathsString; - boost::split(projectIncludePaths, - pathsString, - boost::is_any_of(";,"), - boost::token_compress_on); + Ice::StringSeq projectIncludePaths = simox::alg::split(pathsString, ";,"); ARMARX_DEBUG_S << "Result: Data paths of ArmarX package " << projectName << ": " << projectIncludePaths; includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end()); diff --git a/source/RobotAPI/libraries/core/remoterobot/RemoteRobotNode.cpp b/source/RobotAPI/libraries/core/remoterobot/RemoteRobotNode.cpp index 2c259eafc..3452cb938 100644 --- a/source/RobotAPI/libraries/core/remoterobot/RemoteRobotNode.cpp +++ b/source/RobotAPI/libraries/core/remoterobot/RemoteRobotNode.cpp @@ -22,7 +22,6 @@ * GNU General Public License */ #include "RemoteRobot.h" -#include <boost/foreach.hpp> #include <VirtualRobot/VirtualRobot.h> @@ -166,7 +165,7 @@ namespace armarx vector<RobotNodePtr> result; RobotPtr robot = this->robot.lock(); - BOOST_FOREACH(string name, nodes) + for (std::string const& name : nodes) { result.push_back(robot->getRobotNode(name)); } @@ -201,7 +200,7 @@ namespace armarx { NameList nodes = _node->getChildren(); vector<SceneObjectPtr> result; - BOOST_FOREACH(string name, nodes) + for (string const& name : nodes) { result.push_back(this->robot.lock()->getRobotNode(name)); } diff --git a/source/RobotAPI/libraries/core/remoterobot/RobotStateObserver.cpp b/source/RobotAPI/libraries/core/remoterobot/RobotStateObserver.cpp index 9f2dc660d..a140749a9 100644 --- a/source/RobotAPI/libraries/core/remoterobot/RobotStateObserver.cpp +++ b/source/RobotAPI/libraries/core/remoterobot/RobotStateObserver.cpp @@ -39,9 +39,7 @@ #include <ArmarXCore/observers/variant/DatafieldRef.h> #include <VirtualRobot/IK/DifferentialIK.h> -#include <boost/algorithm/string/trim.hpp> -#include <boost/algorithm/string/split.hpp> -#include <boost/algorithm/string/classification.hpp> +#include <SimoxUtility/algorithm/string/string_tools.h> #define TCP_POSE_CHANNEL "TCPPose" #define TCP_TRANS_VELOCITIES_CHANNEL "TCPVelocities" @@ -350,15 +348,11 @@ void RobotStateObserver::setRobot(RobotPtr robot) } else { - std::vector<std::string> nodesetNames; - boost::split(nodesetNames, - nodesetsString, - boost::is_any_of(","), - boost::token_compress_on); + std::vector<std::string> nodesetNames = simox::alg::split(nodesetsString, ","); for (auto name : nodesetNames) { - boost::trim(name); + simox::alg::trim(name); auto node = robot->getRobotNode(name); if (node) diff --git a/source/RobotAPI/libraries/diffik/DiffIKProvider.h b/source/RobotAPI/libraries/diffik/DiffIKProvider.h index a75434af4..afa25c9cc 100644 --- a/source/RobotAPI/libraries/diffik/DiffIKProvider.h +++ b/source/RobotAPI/libraries/diffik/DiffIKProvider.h @@ -23,12 +23,13 @@ #pragma once -#include <boost/shared_ptr.hpp> -#include <Eigen/Dense> +#include <Eigen/Core> + +#include <memory> namespace armarx { - typedef boost::shared_ptr<class DiffIKProvider> DiffIKProviderPtr; + typedef std::shared_ptr<class DiffIKProvider> DiffIKProviderPtr; struct DiffIKResult { diff --git a/source/RobotAPI/libraries/diffik/GraspTrajectory.h b/source/RobotAPI/libraries/diffik/GraspTrajectory.h index 3e5633d59..8cc0a7cad 100644 --- a/source/RobotAPI/libraries/diffik/GraspTrajectory.h +++ b/source/RobotAPI/libraries/diffik/GraspTrajectory.h @@ -23,31 +23,38 @@ #pragma once -#include <boost/shared_ptr.hpp> -#include <Eigen/Dense> -#include <VirtualRobot/math/AbstractFunctionR1R6.h> -#include <VirtualRobot/math/Helpers.h> -#include <map> -#include <ArmarXCore/core/exceptions/Exception.h> -#include <ArmarXCore/core/rapidxml/wrapper/RapidXmlReader.h> -#include <ArmarXCore/core/rapidxml/wrapper/RapidXmlWriter.h> + + #include <RobotAPI/libraries/SimpleJsonLogger/SimpleJsonLogger.h> -#include <ArmarXGui/libraries/StructuralJson/JPathNavigator.h> -#include <ArmarXGui/libraries/StructuralJson/StructuralJsonParser.h> #include <RobotAPI/libraries/diffik/SimpleDiffIK.h> #include <RobotAPI/interface/units/GraspCandidateProviderInterface.h> + +#include <ArmarXGui/libraries/StructuralJson/JPathNavigator.h> +#include <ArmarXGui/libraries/StructuralJson/StructuralJsonParser.h> + +#include <ArmarXCore/core/exceptions/Exception.h> +#include <ArmarXCore/core/rapidxml/wrapper/RapidXmlReader.h> +#include <ArmarXCore/core/rapidxml/wrapper/RapidXmlWriter.h> #include <ArmarXCore/core/system/cmake/CMakePackageFinder.h> #include <ArmarXCore/interface/serialization/Eigen.h> +#include <VirtualRobot/math/AbstractFunctionR1R6.h> +#include <VirtualRobot/math/Helpers.h> + +#include <Eigen/Core> + +#include <vector> +#include <map> + namespace armarx { - typedef boost::shared_ptr<class GraspTrajectory> GraspTrajectoryPtr; + typedef std::shared_ptr<class GraspTrajectory> GraspTrajectoryPtr; class GraspTrajectory { public: class Keypoint; - typedef boost::shared_ptr<Keypoint> KeypointPtr; + typedef std::shared_ptr<Keypoint> KeypointPtr; class Keypoint { diff --git a/source/RobotAPI/libraries/diffik/RobotPlacement.h b/source/RobotAPI/libraries/diffik/RobotPlacement.h index a677a7a11..0eb34d3f3 100644 --- a/source/RobotAPI/libraries/diffik/RobotPlacement.h +++ b/source/RobotAPI/libraries/diffik/RobotPlacement.h @@ -26,11 +26,11 @@ #include "DiffIKProvider.h" #include "GraspTrajectory.h" -#include <boost/shared_ptr.hpp> +#include <memory> namespace armarx { - typedef boost::shared_ptr<class RobotPlacement> RobotPlacementPtr; + typedef std::shared_ptr<class RobotPlacement> RobotPlacementPtr; class RobotPlacement { -- GitLab