From b70ae1ec0b0f4a48c93d8d17f16b434036aaa2b1 Mon Sep 17 00:00:00 2001 From: Cosmoslip <37982167+Cosmoflips@users.noreply.github.com> Date: Fri, 14 Apr 2023 16:57:26 +0800 Subject: [PATCH] feat: is_down (#35) --- sdk/include/lebai/robot.hh | 6 ++++++ sdk/src/robot.cc | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/sdk/include/lebai/robot.hh b/sdk/include/lebai/robot.hh index 32da580..b068e5f 100644 --- a/sdk/include/lebai/robot.hh +++ b/sdk/include/lebai/robot.hh @@ -407,6 +407,12 @@ namespace lebai * @return 是否已断开连接 */ bool is_disconnected(); + /** + * @brief 手臂是否已下电 + * + * @return 是否已下电 + */ + bool is_down(); /** * @brief 获取机械臂关节当前反馈位置 * diff --git a/sdk/src/robot.cc b/sdk/src/robot.cc index 4c45e17..4ed9313 100644 --- a/sdk/src/robot.cc +++ b/sdk/src/robot.cc @@ -454,6 +454,11 @@ bool Robot::is_disconnected() return impl_->getRobotState() == 0; } +bool Robot::is_down() +{ + return impl_->getRobotState() < 4; +} + std::vector Robot::get_actual_joint_positions() { std::map ret;