Skip to content

Commit 0e90d60

Browse files
committed
Pull request #256: Fix/zero jacobian calculation
Merge in MOCTRL/libfranka from fix/zero-jacobian-calculation to main * commit '9e56a6f1ee73e644da38d453c1a49a9ae567803d': hotfix/fixes zero Jacobian calculation for robot model
2 parents 2eaeb67 + 9e56a6f commit 0e90d60

File tree

6 files changed

+284
-111
lines changed

6 files changed

+284
-111
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ All notable changes to libfranka and pylibfranka will be documented in this file
77
### libfranka - C++
88
#### Changed
99
- The libfranka library is built with static links - removing the need for dynamic dependencies at runtime
10+
- Fix the acceleration link addition bug and robot model link parsing [github](https://github.com/frankarobotics/libfranka/issues/213)
11+
- Update the test urdf with the acceleration links and joint
1012

1113
### pylibfranka - Python
1214
#### Added

include/franka/robot_model.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ class RobotModel : public RobotModelBase {
228228
const std::array<double, 3>& g_earth,
229229
std::array<double, 7>& g_ne) const;
230230

231+
static constexpr const char* kLastLinkName = "link8";
232+
231233
pinocchio::Inertia initial_last_link_inertia_;
232234
pinocchio::FrameIndex last_link_frame_index_;
233235
pinocchio::JointIndex last_joint_index_;

src/robot_model.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ namespace franka {
88
RobotModel::RobotModel(const std::string& urdf) {
99
pinocchio::urdf::buildModelFromXML(urdf, pinocchio_model_);
1010

11-
last_joint_index_ = // NOLINT(cppcoreguidelines-prefer-member-initializer)
12-
pinocchio_model_.joints.back().id(); // NOLINT(cppcoreguidelines-prefer-member-initializer)
13-
last_link_frame_index_ = pinocchio_model_.getFrameId(pinocchio_model_.frames.back().name);
11+
last_link_frame_index_ = pinocchio_model_.getFrameId(kLastLinkName);
12+
last_joint_index_ = // NOLINT(cppcoreguidelines-prefer-member-initializer)
13+
pinocchio_model_.frames[last_link_frame_index_]
14+
.parentJoint; // NOLINT(cppcoreguidelines-prefer-member-initializer)
15+
1416
initial_last_link_inertia_ = pinocchio_model_.inertias[last_joint_index_];
1517

1618
cached_f_x_ctotal_.fill(-1.0);

0 commit comments

Comments
 (0)