Skip to content

Commit

Permalink
Cleanup, add launch file, saturate output thrust
Browse files Browse the repository at this point in the history
  • Loading branch information
Mokaz committed Oct 14, 2023
2 parents 8c752ae + 03654d0 commit e8d245f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ class Allocator : public rclcpp::Node {

private:
Eigen::MatrixXd thrust_configuration =
(Eigen::MatrixXd(3, 4) <<
0.70711, 0.70711, 0.70711, 0.70711,
-0.70711, 0.70711, -0.70711, 0.70711,
0.27738, 0.27738, -0.27738, -0.27738)
.finished();
// Hardcoded thruster config matrix for T_pinv
(Eigen::MatrixXd(3, 4) << 0.70711, 0.70711, 0.70711, 0.70711, -0.70711,
0.70711, -0.70711, 0.70711, 0.27738, 0.27738, -0.27738, -0.27738)
.finished();
// Hardcoded thruster config matrix for T_pinv

void wrench_callback(const geometry_msgs::msg::Wrench &msg);
bool healthyWrench(const Eigen::VectorXd &v) const;
Expand Down
6 changes: 3 additions & 3 deletions motion/thruster_allocator/src/allocator_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ Eigen::VectorXd Allocator::wrenchMsgToEigen(const float force_x,
return body_frame_forces;
}

bool Allocator::healthyWrench(const Eigen::VectorXd &v) const {
bool Allocator::healthyWrench(const Eigen::VectorXd &v) const {
// Check for NaN/Inf
if (isInvalidMatrix(v))
return false;

// Check reasonableness
for (unsigned i = 0; i < v.size(); ++i)
if (std::abs(v[i]) > 100) //c_force_range_limit
if (std::abs(v[i]) > 100) // c_force_range_limit
return false;

return true;
}
}

0 comments on commit e8d245f

Please sign in to comment.