Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 17, 2024
1 parent bbfae44 commit aa58b39
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 24 deletions.
8 changes: 5 additions & 3 deletions examples/walk_without_think/walk_ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@
q0 = robot.x0[: robot.model.nq]
print(
"Start from q0=",
"half_sitting"
if norm(q0 - robot.model.referenceConfigurations["half_sitting"]) < 1e-9
else q0,
(
"half_sitting"
if norm(q0 - robot.model.referenceConfigurations["half_sitting"]) < 1e-9
else q0
),
)

# #####################################################################################
Expand Down
4 changes: 2 additions & 2 deletions include/sobec/crocomplements/activation-quad-ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class ActivationModelQuadRefTpl : public ActivationModelAbstractTpl<_Scalar> {
typedef typename MathBase::MatrixXs MatrixXs;

explicit ActivationModelQuadRefTpl(const VectorXs& reference)
: Base(static_cast<std::size_t>(reference.size())), ref(reference){};
virtual ~ActivationModelQuadRefTpl(){};
: Base(static_cast<std::size_t>(reference.size())), ref(reference) {};
virtual ~ActivationModelQuadRefTpl() {};

virtual void calc(const boost::shared_ptr<ActivationDataAbstract>& data,
const Eigen::Ref<const VectorXs>& r) {
Expand Down
2 changes: 1 addition & 1 deletion include/sobec/crocomplements/activation-weighted-log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ActivationModelWeightedLogTpl
<< "alpha should be a positive value");
}
};
virtual ~ActivationModelWeightedLogTpl(){};
virtual ~ActivationModelWeightedLogTpl() {};

virtual void calc(const boost::shared_ptr<ActivationDataAbstract> &data,
const Eigen::Ref<const VectorXs> &r) {
Expand Down
2 changes: 1 addition & 1 deletion include/sobec/crocomplements/lowpassfilter/action.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ void IntegratedActionModelLPFTpl<Scalar>::calcDiff(
}
#endif
} // tauLim !=0
} // tau integration
} // tau integration

// // TAU PLUS INTEGRATION
// else {
Expand Down
4 changes: 1 addition & 3 deletions python/sobec/pinbullet.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ def setPinocchioFinalizationTricks(self):
self.rmodel.upperPositionLimit[:7] = 1
self.rmodel.lowerPositionLimit[:7] = -1

self.rmodel.armature = (
self.rmodel.rotorInertia * self.rmodel.rotorGearRatio**2
)
self.rmodel.armature = self.rmodel.rotorInertia * self.rmodel.rotorGearRatio**2
self.rmodel.q0 = self.rmodel.referenceConfigurations["half_sitting"]
self.rdata = self.rmodel.createData()

Expand Down
22 changes: 12 additions & 10 deletions python/sobec/walk_without_think/ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,16 +434,18 @@ def __init__(self, robotWrapper, ddp):
np.concatenate(
[
(
d.differential.multibody.contacts.contacts[
"%s_contact" % robotWrapper.model.frames[cid].name
].jMf.inverse()
* d.differential.multibody.contacts.contacts[
"%s_contact" % robotWrapper.model.frames[cid].name
].f
).vector
if "%s_contact" % robotWrapper.model.frames[cid].name
in d.differential.multibody.contacts.contacts
else np.zeros(6)
(
d.differential.multibody.contacts.contacts[
"%s_contact" % robotWrapper.model.frames[cid].name
].jMf.inverse()
* d.differential.multibody.contacts.contacts[
"%s_contact" % robotWrapper.model.frames[cid].name
].f
).vector
if "%s_contact" % robotWrapper.model.frames[cid].name
in d.differential.multibody.contacts.contacts
else np.zeros(6)
)
for cid in robotWrapper.contactIds
]
)
Expand Down
4 changes: 1 addition & 3 deletions python/sobec/walk_without_think/weight_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ def switch_tanh(x, **kwargs):
return (
0
if x <= 0
else 1
if x >= 1
else (np.tanh(-1.0 / x + 1.0 / (1.0 - x)) + 1.0) / 2.0
else 1 if x >= 1 else (np.tanh(-1.0 / x + 1.0 / (1.0 - x)) + 1.0) / 2.0
)


Expand Down
1 change: 0 additions & 1 deletion tests/python/test_mpccpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""


import numpy as np

# from numpy.linalg import norm
Expand Down

0 comments on commit aa58b39

Please sign in to comment.