Skip to content

Commit

Permalink
[force_sensor]
Browse files Browse the repository at this point in the history
add round func in controller and navigator
it is stopgap
  • Loading branch information
Kaneko committed Aug 22, 2024
1 parent 4a3fe65 commit 1c7a9b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion robots/hydrus/src/hydrus_tilted_lqi_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ void HydrusTiltedLQIController::FilterdFtsensorCallBack(geometry_msgs::WrenchSta
torque_at_end[0] = msg.wrench.torque.x;
torque_at_end[1] = msg.wrench.torque.y;
torque_at_end[2] = msg.wrench.torque.z;

for(int i;i<3;i++)
{
if(force_at_end[i]>=4.0)
{
force_at_end[i]=4.0;
}
}

Eigen::Vector3d force_for_root_end_in_cog = aerial_robot_model::kdlToEigen(cog.M.Inverse() * root_end.M) * force_at_end;

filtered_ftsensor_wrench_[0] = force_for_root_end_in_cog[0];
Expand Down Expand Up @@ -225,7 +234,7 @@ void HydrusTiltedLQIController::controlCore()
Eigen::Vector3d target_acc = mass_inv * target_force;
Eigen::Vector3d target_ang_acc = inertia_inv * target_torque;
Eigen::Vector3d feedforward_acc = cog_rot * (target_acc + feedforward_sum_.head(3));
Eigen::Vector3d feedforward_ang_acc = cog_rot * (target_ang_acc + feedforward_sum_.head(3));
Eigen::Vector3d feedforward_ang_acc = cog_rot * (target_ang_acc + feedforward_sum_.tail(3));

if(send_feedforward_switch_flag_ && attaching_flag_)
{
Expand Down
10 changes: 10 additions & 0 deletions robots/hydrus_xi/src/hydrus_xi_under_actuated_navigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ namespace

Eigen::VectorXd thrusts(4), target_wrench(6);
thrusts << x[4], x[5], x[6], x[7];
// thrusts << robot_model->getStaticThrust();
if(using_FTsensor)
{
target_wrench << desire_wrench - filtered_ftsensor_wrench;
Expand Down Expand Up @@ -620,6 +621,15 @@ void HydrusXiUnderActuatedNavigator::FilterdFtsensorCallBack(geometry_msgs::Wren
torque_at_end[0] = msg.wrench.torque.x;
torque_at_end[1] = msg.wrench.torque.y;
torque_at_end[2] = msg.wrench.torque.z;

for(int i;i<3;i++)
{
if(force_at_end[i]>=4.0)
{
force_at_end[i]=4.0;
}
}

Eigen::Vector3d force_for_root_end_in_cog = aerial_robot_model::kdlToEigen(cog.M.Inverse() * root_end.M) * force_at_end;

filtered_ftsensor_wrench_[0] = force_for_root_end_in_cog[0];
Expand Down

0 comments on commit 1c7a9b5

Please sign in to comment.