diff --git a/.clang-format b/.clang-format index 54e2ee3c7..23cf2b63a 100644 --- a/.clang-format +++ b/.clang-format @@ -85,10 +85,6 @@ PenaltyBreakString: 1000 PenaltyExcessCharacter: 150 PenaltyReturnTypeOnItsOwnLine: 300 PointerAlignment: Middle -RawStringFormats: - - Delimiter: pb - Language: TextProto - BasedOnStyle: google ReflowComments: true SortIncludes: true SortUsingDeclarations: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a41914a4..4bbc7a2dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,6 +71,7 @@ jobs: - path: jrl-umi3218/Eigen3ToPython - path: jrl-umi3218/SpaceVecAlg - path: jrl-umi3218/sch-core + options: -DCMAKE_CXX_STANDARD=11 - path: jrl-umi3218/eigen-qld - path: jrl-umi3218/sch-core-python - path: jrl-umi3218/RBDyn diff --git a/.github/workflows/conan.yml b/.github/workflows/conan.yml index 0f36e47a5..4741f42b8 100644 --- a/.github/workflows/conan.yml +++ b/.github/workflows/conan.yml @@ -3,14 +3,14 @@ name: conan packaging for Tasks on: repository_dispatch: types: [conan-master, conan-release] - push: - branches: - - '**' - tags: - - v* - pull_request: - branches: - - '**' +# push: +# branches: +# - '**' +# tags: +# - v* +# pull_request: +# branches: +# - '**' jobs: build: diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 1b540804b..d178ee4f8 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -14,6 +14,9 @@ on: - "**" tags: - v* + pull_request: + branches: + - "**" jobs: check-tag: runs-on: ubuntu-18.04 @@ -230,5 +233,5 @@ jobs: - name: Trigger dependents rebuild run: 'curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.GH_PAGES_TOKEN }}" --request POST --data "{\"event_type\": \"${PACKAGE_JOB}\"}" https://api.github.com/repos/jrl-umi3218/mc_rtc/dispatches - ' +' if: env.PACKAGE_UPLOAD == 'true' diff --git a/.github/workflows/sources/package.yml b/.github/workflows/sources/package.yml index 9564c3c2c..a2bb7cc97 100644 --- a/.github/workflows/sources/package.yml +++ b/.github/workflows/sources/package.yml @@ -30,6 +30,9 @@ on: - '**' tags: - v* + pull_request: + branches: + - '**' jobs: # For a given tag vX.Y.Z, this checks: diff --git a/README.md b/README.md index dee842485..8bb321012 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ You can also choose the head mirror which will have the latest version of this p ``` curl -1sLf \ - 'https://dl.cloudsmith.io/public/mc-rtc/stable/setup.deb.sh' \ + 'https://dl.cloudsmith.io/public/mc-rtc/head/setup.deb.sh' \ | sudo -E bash ``` diff --git a/src/QPTasks.cpp b/src/QPTasks.cpp index 12835485e..d1777c46e 100644 --- a/src/QPTasks.cpp +++ b/src/QPTasks.cpp @@ -553,7 +553,7 @@ JointsSelector JointsSelector::UnactiveJoints( const auto & jDofs = uad.second; const auto & j = mb.joint(mb.jointIndexByName(jN)); int ji = 0; - for(int i = 0; i < jDofs.size(); ++i) + for(size_t i = 0; i < jDofs.size(); ++i) { auto dofStart = jDofs[i][0]; if(dofStart > ji) @@ -741,8 +741,11 @@ PostureTask::PostureTask(const std::vector & mbs, double stiffness, double weight) : Task(weight), pt_(mbs[rI], q), stiffness_(stiffness), damping_(2. * std::sqrt(stiffness)), robotIndex_(rI), - alphaDBegin_(0), jointDatas_(), Q_(mbs[rI].nrDof(), mbs[rI].nrDof()), C_(mbs[rI].nrDof()), alphaVec_(mbs[rI].nrDof()) + alphaDBegin_(0), jointDatas_(), Q_(mbs[rI].nrDof(), mbs[rI].nrDof()), C_(mbs[rI].nrDof()), alphaVec_(mbs[rI].nrDof()), + refVel_(mbs[rI].nrDof()), refAccel_(mbs[rI].nrDof()) { + refVel_.setZero(); + refAccel_.setZero(); } void PostureTask::stiffness(double stiffness) @@ -811,7 +814,9 @@ void PostureTask::update(const std::vector & mbs, int deb = mb.jointPosInDof(1); int end = mb.nrDof() - deb; // joint - C_.segment(deb, end) = -stiffness_ * pt_.eval().segment(deb, end) + damping_ * alphaVec_.segment(deb, end); + C_.segment(deb, end) = -stiffness_ * pt_.eval().segment(deb, end) + + damping_ * (alphaVec_.segment(deb, end) - refVel_.segment(deb, end)) + - refAccel_.segment(deb, end); for(const JointData & pjd : jointDatas_) { diff --git a/src/Tasks/QPTasks.h b/src/Tasks/QPTasks.h index b9d654ab7..7a05c73b9 100644 --- a/src/Tasks/QPTasks.h +++ b/src/Tasks/QPTasks.h @@ -523,6 +523,24 @@ class TASKS_DLLAPI PostureTask : public Task const Eigen::VectorXd & eval() const; + inline void refVel(const Eigen::VectorXd & refVel) noexcept + { + refVel_ = refVel; + } + inline const Eigen::VectorXd & refVel() const noexcept + { + return refVel_; + } + inline void refAccel(const Eigen::VectorXd & refAccel) noexcept + { + assert(refAccel.size() == refAccel_.size()); + refAccel_ = refAccel; + } + inline const Eigen::VectorXd & refAccel() const noexcept + { + return refAccel_; + } + private: struct JointData { @@ -542,6 +560,7 @@ class TASKS_DLLAPI PostureTask : public Task Eigen::MatrixXd Q_; Eigen::VectorXd C_; Eigen::VectorXd alphaVec_; + Eigen::VectorXd refVel_, refAccel_; }; class TASKS_DLLAPI PositionTask : public HighLevelTask