print action id in logger
This commit is contained in:
parent
3460f4eae9
commit
3eda33fc8b
2 changed files with 9 additions and 3 deletions
|
@ -23,6 +23,8 @@ 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("joint_state", goal.joint_values);
|
||||
getInput("duration", goal.duration);
|
||||
|
@ -30,7 +32,8 @@ public:
|
|||
}
|
||||
|
||||
NodeStatus onResultReceived(const WrappedResult &wr) override {
|
||||
RCLCPP_INFO(this->logger(), "Starting get response %s with status %b", this->action_name_.c_str(), wr.result->success);
|
||||
RCLCPP_INFO(this->logger(), "[%s] Starting get response %s with status %b",
|
||||
name().c_str(), this->action_name_.c_str(), wr.result->success);
|
||||
if (!wr.result->success) {
|
||||
return NodeStatus::FAILURE;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@ public:
|
|||
}
|
||||
|
||||
bool setGoal(RosActionNode::Goal &goal) override {
|
||||
RCLCPP_INFO(this->logger(), "Starting send request");
|
||||
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);
|
||||
|
@ -34,12 +35,14 @@ public:
|
|||
|
||||
NodeStatus onResultReceived(const WrappedResult &wr) override {
|
||||
|
||||
RCLCPP_INFO(this->logger(), "Starting get response %s with status %b", this->action_name_.c_str(), wr.result->success);
|
||||
RCLCPP_INFO(this->logger(), "[%s] Starting get response %s with status %b",
|
||||
name().c_str(), this->action_name_.c_str(), wr.result->success);
|
||||
if (!wr.result->success) {
|
||||
return NodeStatus::FAILURE;
|
||||
}
|
||||
return NodeStatus::SUCCESS;
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<geometry_msgs::msg::Pose> m_target_pose;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue