Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/sdu_controllers/math/rnea.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ namespace sdu_controllers::math
Eigen::MatrixXd coriolis(const Eigen::VectorXd &q, const Eigen::VectorXd &dq);
Eigen::VectorXd velocity_product(const Eigen::VectorXd &q, const Eigen::VectorXd &dq);
Eigen::VectorXd gravity(const Eigen::VectorXd &q);

// Get complete reaction dynamics of every joint/frame
const Eigen::Matrix3Xd& get_reaction_forces_frames() const { return f_; }
const Eigen::Matrix3Xd& get_reaction_moments_frames() const { return mu_; }

/**
* @brief Classical joint friction torque \f$ \tau_{f} \f$.
Expand Down
12 changes: 11 additions & 1 deletion python/sdu_controllers/_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,17 @@ namespace sdu_controllers
"set_z0",
&math::RecursiveNewtonEuler::set_z0,
"Set the z-axis of the base frame",
nb::arg("z0"));
nb::arg("z0"))
.def(
"get_reaction_forces_frames",
&math::RecursiveNewtonEuler::get_reaction_forces_frames,
"Get reaction forces from the most recent inverse dynamics call"
)
.def(
"get_reaction_moments_frames",
&math::RecursiveNewtonEuler::get_reaction_moments_frames,
"Get reaction moments from the most recent inverse dynamics call"
);

// Linear algebra utilities
m.def(
Expand Down
7 changes: 0 additions & 7 deletions src/models/parameter_robot_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,6 @@ namespace sdu_controllers::models
params.g0 = Eigen::Vector3d(0.0, 0.0, -9.81);
}

// Basic validation: sizes must match dof if provided
if (params.dof != 0 && params.dof != static_cast<uint16_t>(n_links))
{
std::cerr << "YAML validation error: declared dof (" << params.dof << ") "
<< "does not match number of inertial entries (" << n_links << ") in " << filepath << std::endl;
return std::nullopt;
}
// set dof if not set
if (params.dof == 0)
params.dof = static_cast<uint16_t>(n_links);
Expand Down
Loading