diff --git a/rbs_bt_executor/src/MoveToPose.cpp b/rbs_bt_executor/src/MoveToPose.cpp index f36d1cd..c81a4af 100644 --- a/rbs_bt_executor/src/MoveToPose.cpp +++ b/rbs_bt_executor/src/MoveToPose.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using namespace BT; using MoveitSendPoseAction = rbs_skill_interfaces::action::MoveitSendPose; @@ -26,9 +27,18 @@ public: bool setGoal(RosActionNode::Goal &goal) override { RCLCPP_INFO(this->logger(), "[%s] Starting send goal [%s]", name().c_str(), this->action_name_.c_str()); - getInput("robot_name", goal.robot_name); - getInput("pose", m_target_pose); - getInput("duration", goal.duration); + if (!getInput("robot_name", goal.robot_name)) { + RCLCPP_FATAL(this->logger(), "[%s] Could not get robot_name from input port", name().c_str()); + return false; + } + if (!getInput("pose", m_target_pose)) { + RCLCPP_FATAL(this->logger(), "[%s] Could not get target_pose from input port", name().c_str()); + return false; + } + if (!getInput("duration", goal.duration)) { + RCLCPP_FATAL(this->logger(), "[%s] Could not get duration from input port", name().c_str()); + return false; + } goal.target_pose = *m_target_pose; return true; }