Skip to content

Commit

Permalink
fix: update tv and tau from rnea and aba only if not given (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjonok authored Feb 13, 2024
1 parent 99ad656 commit e69c924
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions darli/backend/pinocchio.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,18 @@ def update(

if dv is not None:
self._dv = dv
self._tau = pin.rnea(self.__model, self.__data, self._q, self._v, self._dv)
# update _tau only if it not given
if tau is None:
self._tau = pin.rnea(
self.__model, self.__data, self._q, self._v, self._dv
)
if tau is not None:
self._tau = tau
self._dv = pin.aba(self.__model, self.__data, self._q, self._v, self._tau)
# update _dv only if it not given
if dv is None:
self._dv = pin.aba(
self.__model, self.__data, self._q, self._v, self._tau
)

pin.computeAllTerms(self.__model, self.__data, self._q, self._v)
pin.jacobianCenterOfMass(self.__model, self.__data, self._q)
Expand Down

0 comments on commit e69c924

Please sign in to comment.