diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp index b59531d4c840f9d7bbfb773f2a5da361bedbcf39..1987708750187cc7a7e212b6c2c105157707b6ff 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 b3cb24cfd9d4249aeecbd474f5c040ed488861cd..e7d20106efb18cad009e22a32e3528d6c8197e06 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 b68904c7c60a2790bc59d8174b1af6283f55f82e..a36bdd9da8f92a45213f4b8a388893e03a5f7f9d 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 3d44b10468505f79ee518d54cf4a59c7b7ea83ae..4a99205ed9f2fd841ce793a5a5794ec4c948b660 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 6cfb8340d95092343a8fa14eb1ba0818ad67ae29..2a4d495c80c135afa06ba12be235f4b81754affe 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 8e3037badb78a49b9cd6ef2847460c70995f448b..1bbf0abff5599b23ff0ca01acaa4087bdeac1704 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 5df97334511a6d3621242ec38b3840232645a38f..9c046e0c714b556b67f2273ed8327b69f1340ae1 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 1dacd798cc3feb30b0fb04b283b0d9ebb3eb2ae4..64fcc6bf313220e49c6b79d998213962f04ddc12 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 69dbe9ee5ed0c7e455ccf7859e9b42d69924fde2..643995773e1ec95b58862c4fee5cf753c95a24ca 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 e106a9dbb943dabd9bd23a05e9d8320b6e415b82..f779b851b17ecfdeb4316013234b62b7696e8cea 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 1af55624f1e5bd9f261e5ba4a0addf2ba71d31ff..a2cce575f38d3bb3f015fd3decdbcb30d3d816bb 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 36c2bbdeb1335ba1523585997bc01897f24f2772..61ff24e37fc43900f46ba2e74680b30787239759 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 e534efd0ca0426daabf74b7bb04408e676c0a412..87abee65875d8827f49dbd1426ec20965cdb8ad8 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 da20242655d43b949313fe1d295036e3e43fe282..33bdd5efd8d0671e25191e9b9f6020286eed846d 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 955a336053a4b7d605ea19cb70ba993b00b517a7..b60019683741f988d4eefcf131cd44df44b1be9c 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 1e0ce16e1da5103672893f829883630ec186eb6d..e65e6506a5312346f4409f68a09880c3aa77b939 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 ef9e3aed23402c1fc0ed6670a22886d9d770167b..25c81d4ac78aff9057daf6fb9dc318ed753eead6 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 9c434042b75b23ab4393ed3e7c3a65a0658181e5..4f79878eef58dbe407b744780f8b50203ca26a04 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 af108e0e0839fe4b8d1d6c912163e67e0ffeaec9..52af2c8dd81679509f7aaf965caa91e3b49349eb 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 c379eed20745f6f77472c2faf6b943aba23464cd..4b34e9a3a6248223fadafcf4af4b54af9a069eaa 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 f4a9f5673d6d782a774fe27333f449fee5cb57b6..9c437484cb636ac16705c5a16d5303501a828361 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 52288ccc8797644cf80038d71f2eacfd97d02cb1..538c1b5cb5c5b47222b97f13d6417706d4b8a746 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 19a474878ee3c0f8f622122164810958320c455d..1b2e9b10cf81e17240e09af578468a12c13c4b40 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 050958f91cb13e5ad34f1a87110e759bc5402b1e..0fa9fe1ea3d713e090dda9d3a529050e1b9f82d1 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 67cfa8a337add22efcf3adc552ddb475dcaa09b5..e5077dbad6abca53970f20a82f2b4c7534333cc7 100644 --- a/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointTaskSpaceImpedanceDMPController.cpp +++ b/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointTaskSpaceImpedanceDMPController.cpp @@ -744,7 +744,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; @@ -753,7 +753,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; @@ -764,7 +764,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 6f6bd2970e4f0233510753e1ea6c5354e5fbff0a..88258722f663c186ae3aabe393bcf710c11c12c4 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 5211a504403ce4dff2feca568998ac4cd88ca555..3dad904583eca19ac645d364ec045851f1045805 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 5600a669fa6bf6afce56ff08d3f2a947912fd139..f79148ab16b1d8ca6a0cc4d2ccc33ed92ba44ffe 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 c7e6db669445a95033f304da8d4eb0da0fb9890b..ec4f5086b8944f12ad22ad096ba8cd9253941a2d 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 0a1bbdbc953456e391c7d8b1f918c9a2863b503a..8af3f984e0005d1e3f6b8ce1271135d0662fb57d 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 6235ef3f737fe97359f4da72c25ec6c870a49da2..131c5fea4a33436bb28c7f63188b9caf4a6719d2 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 c4b41c638d9ae8f3c5100d9f60f1d47743bcb99d..4736420d31260a9e25ad69b23f2e90a793c3535b 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 4cf381844ec819550b1a3bc857b28ee713705a5c..20fc87cc935a751fa2ce9a344f114276c8c1685e 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 6f0553c521f68f8a583736d7b12ac59632cffb46..73afd8c5616497db533115bacbbe6a90ef92f1cf 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 c1db4b859aa464794c3bba2e1025feb5436a5bba..f2867d76e57bc81c17e00eeb56caf14a8a558743 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 c9feaee398008091d3ef9e97161fec750e0b95ac..4cef5c63fa14fcee4121851458802ddd0338bb77 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 233814ffd7c60a09fa9588093c7d1e2f726e282e..70adfc5e7647f7a4118d750ca060c5804ae8d84a 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 539b6fb0449f1ba3e7258c502e28602a07a5b796..6c1e44fdb6c6164c74dbe73ab067f0526dea7317 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 d579f3a6dab0e0a432b8a383f47be4496dcca137..395de492cc22ef4e80665f4477e648046d329cf8 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 bef441657c7653bfb75458789516a13074576a9d..0aa460711fa83b19dc8902bd0c4cfd604d8b633b 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 990de647c0bb74092d96a7774830cd1fb6f96f98..774b324ee1d50515576625900555a8ef15510758 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 65db64e872112548b72048542cfdecb7835cd81f..60577ef2dfb7b01eaf648a1a86008f7a969061dd 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 2c259eafc983fc5b78cdffb42c5471578f2ac3c8..3452cb93862066c3409e35004a2b8f26ed8eca90 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 9f2dc660d9945879bf66c7d5d37e9d15a0865926..a140749a911bcf68bf4ba0c84417509ae8b21101 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 a75434af401538fc92697010ee6fc3d6b43e9071..afa25c9cc4d7b3b19606ee5b756033cfd569d68d 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 3e5633d59e9a2f2c8ad533735370a1f008694089..8cc0a7cad1046733e4e7d52a4fe2d69eff28b660 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 a677a7a1181b1a88dc731da6f4859c188453f5bf..0eb34d3f3c4cbf43c8b50c78e7e8c9a41a179ec6 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 {