Skip to content

Commit c6f9e37

Browse files
authored
Bugfix: included the velocity limits in the Talos legs (Gepetto#96)
* [bugfix] Included the velocity limits in the talos-legs model
1 parent fe98128 commit c6f9e37

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ INCLUDE(cmake/python.cmake)
2222

2323
# Print initial message
2424
MESSAGE(STATUS "${PROJECT_DESCRIPTION}, version ${PROJECT_VERSION}")
25-
MESSAGE(STATUS "Copyright (C) 2018-2020 LAAS-CNRS / University of Edinburgh")
25+
MESSAGE(STATUS "Copyright (C) 2018-2021 LAAS-CNRS, University of Edinburgh")
2626
MESSAGE(STATUS "All rights reserved.")
2727
MESSAGE(STATUS "Released under the BSD 3-Clause License.")
2828

Diff for: python/example_robot_data/robots_loader.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,11 @@ def __init__(self):
162162
for j, M, name, parent, Y in zip(m1.joints, m1.jointPlacements, m1.names, m1.parents, m1.inertias):
163163
if j.id < legMaxId:
164164
jid = m2.addJoint(parent, getattr(pin, j.shortname())(), M, name)
165-
upperPos = m2.upperPositionLimit
166-
lowerPos = m2.lowerPositionLimit
167-
effort = m2.effortLimit
168-
upperPos[m2.joints[jid].idx_q:m2.joints[jid].idx_q + j.nq] = m1.upperPositionLimit[j.idx_q:j.idx_q +
169-
j.nq]
170-
lowerPos[m2.joints[jid].idx_q:m2.joints[jid].idx_q + j.nq] = m1.lowerPositionLimit[j.idx_q:j.idx_q +
171-
j.nq]
172-
effort[m2.joints[jid].idx_v:m2.joints[jid].idx_v + j.nv] = m1.effortLimit[j.idx_v:j.idx_v + j.nv]
173-
m2.upperPositionLimit = upperPos
174-
m2.lowerPositionLimit = lowerPos
175-
m2.effortLimit = effort
165+
idx_q, idx_v = m2.joints[jid].idx_q, m2.joints[jid].idx_v
166+
m2.upperPositionLimit[idx_q:idx_q + j.nq] = m1.upperPositionLimit[j.idx_q:j.idx_q + j.nq]
167+
m2.lowerPositionLimit[idx_q:idx_q + j.nq] = m1.lowerPositionLimit[j.idx_q:j.idx_q + j.nq]
168+
m2.velocityLimit[idx_v:idx_v + j.nv] = m1.velocityLimit[j.idx_v:j.idx_v + j.nv]
169+
m2.effortLimit[idx_v:idx_v + j.nv] = m1.effortLimit[j.idx_v:j.idx_v + j.nv]
176170
assert jid == j.id
177171
m2.appendBodyToJoint(jid, Y, pin.SE3.Identity())
178172

0 commit comments

Comments
 (0)