Skip to content

Commit

Permalink
Update moveit::core::error_msg_to_string (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
reidchristopher authored Feb 27, 2024
1 parent 65970f0 commit 4c8e353
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions moveit_core/utils/include/moveit/utils/moveit_error_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ namespace core
class MoveItErrorCode : public moveit_msgs::msg::MoveItErrorCodes
{
public:
MoveItErrorCode()
{
val = 0;
}
MoveItErrorCode(int code)
MoveItErrorCode(int code = 0)
{
val = code;
}
Expand Down Expand Up @@ -104,12 +100,18 @@ inline std::string error_code_to_string(MoveItErrorCode error_code)
return std::string("START_STATE_IN_COLLISION");
case moveit::core::MoveItErrorCode::START_STATE_VIOLATES_PATH_CONSTRAINTS:
return std::string("START_STATE_VIOLATES_PATH_CONSTRAINTS");
case moveit::core::MoveItErrorCode::START_STATE_INVALID:
return std::string("START_STATE_INVALID");
case moveit::core::MoveItErrorCode::GOAL_IN_COLLISION:
return std::string("GOAL_IN_COLLISION");
case moveit::core::MoveItErrorCode::GOAL_VIOLATES_PATH_CONSTRAINTS:
return std::string("GOAL_VIOLATES_PATH_CONSTRAINTS");
case moveit::core::MoveItErrorCode::GOAL_CONSTRAINTS_VIOLATED:
return std::string("GOAL_CONSTRAINTS_VIOLATED");
case moveit::core::MoveItErrorCode::GOAL_STATE_INVALID:
return std::string("GOAL_STATE_INVALID");
case moveit::core::MoveItErrorCode::UNRECOGNIZED_GOAL_TYPE:
return std::string("UNRECOGNIZED_GOAL_TYPE");
case moveit::core::MoveItErrorCode::INVALID_GROUP_NAME:
return std::string("INVALID_GROUP_NAME");
case moveit::core::MoveItErrorCode::INVALID_GOAL_CONSTRAINTS:
Expand All @@ -130,9 +132,14 @@ inline std::string error_code_to_string(MoveItErrorCode error_code)
return std::string("SENSOR_INFO_STALE");
case moveit::core::MoveItErrorCode::COMMUNICATION_FAILURE:
return std::string("COMMUNICATION_FAILURE");
case moveit::core::MoveItErrorCode::CRASH:
return std::string("CRASH");
case moveit::core::MoveItErrorCode::ABORT:
return std::string("ABORT");
case moveit::core::MoveItErrorCode::NO_IK_SOLUTION:
return std::string("NO_IK_SOLUTION");
}
return std::string("Unrecognized MoveItErrorCode. This should never happen!");
}

} // namespace core
Expand Down

0 comments on commit 4c8e353

Please sign in to comment.