Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #444

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: check-useless-excludes
- id: check-hooks-apply
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.3
rev: v19.1.7
hooks:
- id: clang-format
'types_or': [c++, c]
Expand All @@ -22,7 +22,7 @@ repos:
utils/mc_bin_flatbuffers/.*
)$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand Down Expand Up @@ -52,7 +52,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 25.1.0
hooks:
- id: black
exclude: |
Expand All @@ -61,7 +61,7 @@ repos:
utils/mc_log_gui/mc_log_ui/ui/.*
)$
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
args:
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export ROS_PYTHON_VERSION:=$(shell . /opt/ros/${ROS_DISTRO}/setup.sh && echo $$R
ifeq (${ROS_PYTHON_VERSION}, 3)
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python3/dist-packages:${PYTHONPATH}
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python$(shell python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}');")/site-packages:${PYTHONPATH}
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/local/lib/python$(shell python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}');")/dist-packages:${PYTHONPATH}
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/local/lib/python$(shell python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}');")/dist-packages:${PYTHONPATH}
export MC_LOG_UI_PYTHON_EXECUTABLE:=python3
else
export PYTHONPATH:=/opt/ros/${ROS_DISTRO}/lib/python2.7/dist-packages:${PYTHONPATH}
Expand Down
6 changes: 3 additions & 3 deletions include/mc_rtc/Schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ struct Operations
std::function<void(const void * self, Configuration & out)> save = [](const void *, Configuration &) {};

/** Write to a MessagePackBuilder */
std::function<void(const void * self, MessagePackBuilder & builder)> write = [](const void *, MessagePackBuilder &) {
};
std::function<void(const void * self, MessagePackBuilder & builder)> write = [](const void *,
MessagePackBuilder &) {};

/** Load from a configuration object */
std::function<void(void * self, const Configuration & in)> load = [](void *, const Configuration &) {};
Expand Down Expand Up @@ -297,7 +297,7 @@ struct Operations
*
* \param choices Possible choices when \tparam HasChoices is true
*/
template<typename T, typename Schema, T Schema::*ptr, ValueFlag Flags = ValueFlag::All, bool HasChoices = false>
template<typename T, typename Schema, T Schema::* ptr, ValueFlag Flags = ValueFlag::All, bool HasChoices = false>
bool registerValue(details::MemberPointerWrapper<ptr>,
const std::string & name,
const std::string & description,
Expand Down
4 changes: 2 additions & 2 deletions include/mc_rtc/gui/Arrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }

Expand Down Expand Up @@ -72,7 +72,7 @@ struct ArrowImpl : public ArrowROImpl<GetStart, GetEnd>
}

/** Invalid element */
ArrowImpl(){};
ArrowImpl() {};

void write(mc_rtc::MessagePackBuilder & builder) { ArrowROImpl<GetStart, GetEnd>::write(builder, false); }

Expand Down
3 changes: 2 additions & 1 deletion include/mc_rtc/log/iterate_binary_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down
4 changes: 1 addition & 3 deletions include/mc_solver/utils/Update.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ namespace mc_solver
namespace utils
{

struct MC_SOLVER_DLLAPI UpdateTag
{
};
struct MC_SOLVER_DLLAPI UpdateTag{};

template<typename UpdateNrVars>
struct Update : public UpdateNrVars, UpdateTag
Expand Down
4 changes: 2 additions & 2 deletions include/mc_tasks/lipm_stabilizer/StabilizerTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ struct MC_TASKS_DLLAPI StabilizerTask : public MetaTask
* @param offset_gamma [out] - Com offset
* @param coef_alpha [out] - ZmP coefficient
*/
template<sva::ForceVecd ExternalWrench::*TargetOrMeasured>
template<sva::ForceVecd ExternalWrench::* TargetOrMeasured>
void computeWrenchOffsetAndCoefficient(const mc_rbdyn::Robot & robot,
Eigen::Vector3d & offset_gamma,
double & coef_kappa) const;
Expand All @@ -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<sva::ForceVecd ExternalWrench::*TargetOrMeasured>
template<sva::ForceVecd ExternalWrench::* TargetOrMeasured>
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/mc_rbdyn/gui/RobotConvex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/mc_tasks/lipm_stabilizer/StabilizerTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ void StabilizerTask::setExternalWrenches(const std::vector<std::string> & surfac
computeWrenchOffsetAndCoefficient<&ExternalWrench::target>(robot(), comOffsetTarget_, zmpCoefTarget_);
}

template<sva::ForceVecd StabilizerTask::ExternalWrench::*TargetOrMeasured>
template<sva::ForceVecd StabilizerTask::ExternalWrench::* TargetOrMeasured>
void StabilizerTask::computeWrenchOffsetAndCoefficient(const mc_rbdyn::Robot & robot,
Eigen::Vector3d & offset_gamma,
double & coef_kappa) const
Expand Down Expand Up @@ -669,7 +669,7 @@ void StabilizerTask::computeWrenchOffsetAndCoefficient(const mc_rbdyn::Robot & r
offset_gamma /= zeta;
}

template<sva::ForceVecd StabilizerTask::ExternalWrench::*TargetOrMeasured>
template<sva::ForceVecd StabilizerTask::ExternalWrench::* TargetOrMeasured>
sva::ForceVecd StabilizerTask::computeExternalWrenchSum(const mc_rbdyn::Robot & robot,
const Eigen::Vector3d & com) const
{
Expand Down
7 changes: 3 additions & 4 deletions tests/controllers/TestObserverController.in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading