From 91ebffafba76d31a15680abd888ec9eb7b671bbe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 21:59:48 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/mc_rtc/Schema.h | 6 +++--- include/mc_rtc/gui/Arrow.h | 4 ++-- include/mc_rtc/log/iterate_binary_log.h | 3 ++- include/mc_solver/utils/Update.h | 4 +--- include/mc_tasks/lipm_stabilizer/StabilizerTask.h | 4 ++-- .../Admittance/src/mc_admittance_sample_controller.cpp | 7 +++---- .../ExternalForces/src/mc_external_forces_controller.cpp | 7 +++---- src/mc_rbdyn/gui/RobotConvex.cpp | 3 ++- src/mc_tasks/lipm_stabilizer/StabilizerTask.cpp | 4 ++-- tests/controllers/TestObserverController.in.cpp | 7 +++---- 10 files changed, 23 insertions(+), 26 deletions(-) diff --git a/include/mc_rtc/Schema.h b/include/mc_rtc/Schema.h index 7b6e0d2bea..36db7392cb 100644 --- a/include/mc_rtc/Schema.h +++ b/include/mc_rtc/Schema.h @@ -259,8 +259,8 @@ struct Operations std::function save = [](const void *, Configuration &) {}; /** Write to a MessagePackBuilder */ - std::function write = [](const void *, MessagePackBuilder &) { - }; + std::function write = [](const void *, + MessagePackBuilder &) {}; /** Load from a configuration object */ std::function load = [](void *, const Configuration &) {}; @@ -297,7 +297,7 @@ struct Operations * * \param choices Possible choices when \tparam HasChoices is true */ - template + template bool registerValue(details::MemberPointerWrapper, const std::string & name, const std::string & description, diff --git a/include/mc_rtc/gui/Arrow.h b/include/mc_rtc/gui/Arrow.h index 92e8f4a711..15c9f52fce 100644 --- a/include/mc_rtc/gui/Arrow.h +++ b/include/mc_rtc/gui/Arrow.h @@ -38,7 +38,7 @@ struct ArrowROImpl : public Element } /** Invalid element */ - ArrowROImpl(){}; + ArrowROImpl() {}; constexpr static size_t write_size() { return Element::write_size() + 3 + ArrowConfig::write_size(); } @@ -72,7 +72,7 @@ struct ArrowImpl : public ArrowROImpl } /** Invalid element */ - ArrowImpl(){}; + ArrowImpl() {}; void write(mc_rtc::MessagePackBuilder & builder) { ArrowROImpl::write(builder, false); } diff --git a/include/mc_rtc/log/iterate_binary_log.h b/include/mc_rtc/log/iterate_binary_log.h index 8e72ce5ae1..e47cba9c58 100644 --- a/include/mc_rtc/log/iterate_binary_log.h +++ b/include/mc_rtc/log/iterate_binary_log.h @@ -67,7 +67,8 @@ inline bool iterate_binary_log(const std::string & fpath, { return iterate_binary_log( fpath, - [&callback](IterateBinaryLogData data) { + [&callback](IterateBinaryLogData data) + { return callback(data.keys, data.records, data.time.value_or(-1), data.copy_cb, data.raw_data, data.raw_data_size); }, diff --git a/include/mc_solver/utils/Update.h b/include/mc_solver/utils/Update.h index 8003d87a4c..0d0d7df9f0 100644 --- a/include/mc_solver/utils/Update.h +++ b/include/mc_solver/utils/Update.h @@ -13,9 +13,7 @@ namespace mc_solver namespace utils { -struct MC_SOLVER_DLLAPI UpdateTag -{ -}; +struct MC_SOLVER_DLLAPI UpdateTag{}; template struct Update : public UpdateNrVars, UpdateTag diff --git a/include/mc_tasks/lipm_stabilizer/StabilizerTask.h b/include/mc_tasks/lipm_stabilizer/StabilizerTask.h index 9dad4c361f..fa3e2b82c6 100644 --- a/include/mc_tasks/lipm_stabilizer/StabilizerTask.h +++ b/include/mc_tasks/lipm_stabilizer/StabilizerTask.h @@ -782,7 +782,7 @@ struct MC_TASKS_DLLAPI StabilizerTask : public MetaTask * @param offset_gamma [out] - Com offset * @param coef_alpha [out] - ZmP coefficient */ - template + template void computeWrenchOffsetAndCoefficient(const mc_rbdyn::Robot & robot, Eigen::Vector3d & offset_gamma, double & coef_kappa) const; @@ -793,7 +793,7 @@ struct MC_TASKS_DLLAPI StabilizerTask : public MetaTask * @param robot Robot used to transform surface wrenches (control robot or real robot) * @param com Robot CoM */ - template + template sva::ForceVecd computeExternalWrenchSum(const mc_rbdyn::Robot & robot, const Eigen::Vector3d & com) const; /** @brief Compute the position, force, and moment of the external contacts in the world frame. diff --git a/src/mc_control/samples/Admittance/src/mc_admittance_sample_controller.cpp b/src/mc_control/samples/Admittance/src/mc_admittance_sample_controller.cpp index 23fb381f99..bbf760d513 100644 --- a/src/mc_control/samples/Admittance/src/mc_admittance_sample_controller.cpp +++ b/src/mc_control/samples/Admittance/src/mc_admittance_sample_controller.cpp @@ -10,10 +10,9 @@ AdmittanceSampleController::AdmittanceSampleController(mc_rbdyn::RobotModulePtr Backend backend) : mc_control::fsm::Controller(rm, dt, config, backend) { - datastore().make_call("KinematicAnchorFrame::" + robot().name(), - [](const mc_rbdyn::Robot & robot) { - return sva::interpolate(robot.surfacePose("LeftFoot"), robot.surfacePose("RightFoot"), 0.5); - }); + datastore().make_call( + "KinematicAnchorFrame::" + robot().name(), [](const mc_rbdyn::Robot & robot) + { return sva::interpolate(robot.surfacePose("LeftFoot"), robot.surfacePose("RightFoot"), 0.5); }); } void AdmittanceSampleController::reset(const mc_control::ControllerResetData & reset_data) diff --git a/src/mc_control/samples/ExternalForces/src/mc_external_forces_controller.cpp b/src/mc_control/samples/ExternalForces/src/mc_external_forces_controller.cpp index 0d3bd444f3..694a99bc51 100644 --- a/src/mc_control/samples/ExternalForces/src/mc_external_forces_controller.cpp +++ b/src/mc_control/samples/ExternalForces/src/mc_external_forces_controller.cpp @@ -10,10 +10,9 @@ ExternalForcesController::ExternalForcesController(mc_rbdyn::RobotModulePtr rm, Backend backend) : mc_control::fsm::Controller(rm, dt, config, backend) { - datastore().make_call("KinematicAnchorFrame::" + robot().name(), - [](const mc_rbdyn::Robot & robot) { - return sva::interpolate(robot.surfacePose("LeftFoot"), robot.surfacePose("RightFoot"), 0.5); - }); + datastore().make_call( + "KinematicAnchorFrame::" + robot().name(), [](const mc_rbdyn::Robot & robot) + { return sva::interpolate(robot.surfacePose("LeftFoot"), robot.surfacePose("RightFoot"), 0.5); }); } void ExternalForcesController::reset(const mc_control::ControllerResetData & reset_data) diff --git a/src/mc_rbdyn/gui/RobotConvex.cpp b/src/mc_rbdyn/gui/RobotConvex.cpp index fcbd400fc4..11644d8557 100644 --- a/src/mc_rbdyn/gui/RobotConvex.cpp +++ b/src/mc_rbdyn/gui/RobotConvex.cpp @@ -79,7 +79,8 @@ void addConvexToGUI(mc_rtc::gui::StateBuilder & gui, { publish_object(mc_rtc::gui::Cylinder( publishName.value_or(name), - [cylinder]() { + [cylinder]() + { return mc_rtc::gui::CylinderParameters{cylinder->getRadius(), (cylinder->getP2() - cylinder->getP1()).norm()}; }, get_pose, mc_rtc::gui::Color::Green)); diff --git a/src/mc_tasks/lipm_stabilizer/StabilizerTask.cpp b/src/mc_tasks/lipm_stabilizer/StabilizerTask.cpp index 351d41f113..f0a1a39095 100644 --- a/src/mc_tasks/lipm_stabilizer/StabilizerTask.cpp +++ b/src/mc_tasks/lipm_stabilizer/StabilizerTask.cpp @@ -636,7 +636,7 @@ void StabilizerTask::setExternalWrenches(const std::vector & surfac computeWrenchOffsetAndCoefficient<&ExternalWrench::target>(robot(), comOffsetTarget_, zmpCoefTarget_); } -template +template void StabilizerTask::computeWrenchOffsetAndCoefficient(const mc_rbdyn::Robot & robot, Eigen::Vector3d & offset_gamma, double & coef_kappa) const @@ -669,7 +669,7 @@ void StabilizerTask::computeWrenchOffsetAndCoefficient(const mc_rbdyn::Robot & r offset_gamma /= zeta; } -template +template sva::ForceVecd StabilizerTask::computeExternalWrenchSum(const mc_rbdyn::Robot & robot, const Eigen::Vector3d & com) const { diff --git a/tests/controllers/TestObserverController.in.cpp b/tests/controllers/TestObserverController.in.cpp index b87107a96b..47e50173e2 100644 --- a/tests/controllers/TestObserverController.in.cpp +++ b/tests/controllers/TestObserverController.in.cpp @@ -199,10 +199,9 @@ struct MC_CONTROL_DLLAPI TestObserverController : public MCController BOOST_REQUIRE(allclose(realRobot().posW().rotation(), robot().posW().rotation())); // Add anchor frame - datastore().make_call("KinematicAnchorFrame::" + robot().name(), - [](const mc_rbdyn::Robot & robot) { - return sva::interpolate(robot.surfacePose("LeftFoot"), robot.surfacePose("RightFoot"), 0.5); - }); + datastore().make_call( + "KinematicAnchorFrame::" + robot().name(), [](const mc_rbdyn::Robot & robot) + { return sva::interpolate(robot.surfacePose("LeftFoot"), robot.surfacePose("RightFoot"), 0.5); }); } private: