Skip to content

Commit

Permalink
fix the has_limits logic for different interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed May 3, 2024
1 parent 48bbef3 commit 9d08858
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hardware_interface/src/component_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ void set_custom_interface_values(const InterfaceInfo & itr, joint_limits::JointL
{
limits.max_acceleration = std::fabs(limits.max_deceleration);
}
limits.has_deceleration_limits = true && itr.enable_limits;
limits.has_deceleration_limits = itr.enable_limits;
}
if (std::isfinite(max_accel))
{
Expand All @@ -680,7 +680,7 @@ void set_custom_interface_values(const InterfaceInfo & itr, joint_limits::JointL
{
limits.max_deceleration = std::fabs(limits.max_acceleration);
}
limits.has_acceleration_limits = true && itr.enable_limits;
limits.has_acceleration_limits = itr.enable_limits;
}
}
}
Expand All @@ -699,7 +699,7 @@ void set_custom_interface_values(const InterfaceInfo & itr, joint_limits::JointL
std::isfinite(max_jerk))
{
limits.max_jerk = std::abs(max_jerk);
limits.has_jerk_limits = true && itr.enable_limits;
limits.has_jerk_limits = itr.enable_limits;
}
}
else
Expand Down Expand Up @@ -799,7 +799,7 @@ void copy_interface_limits(
{
limits.min_position = std::max(min_pos, limits.min_position);
limits.max_position = std::min(max_pos, limits.max_position);
limits.has_position_limits = true && itr.enable_limits;
limits.has_position_limits = itr.enable_limits;
}
else
{
Expand All @@ -814,7 +814,7 @@ void copy_interface_limits(
if (detail::retrieve_min_max_interface_values(itr, min_vel, max_vel))
{
limits.max_velocity = std::min(std::abs(min_vel), max_vel);
limits.has_velocity_limits = true && itr.enable_limits;
limits.has_velocity_limits = itr.enable_limits;
}
else
{
Expand All @@ -828,7 +828,7 @@ void copy_interface_limits(
if (detail::retrieve_min_max_interface_values(itr, min_eff, max_eff))
{
limits.max_effort = std::min(std::abs(min_eff), max_eff);
limits.has_effort_limits = true && itr.enable_limits;
limits.has_effort_limits = itr.enable_limits;
}
else
{
Expand Down

0 comments on commit 9d08858

Please sign in to comment.