Improve Error Handling, Add Named Pose Service, Optimize Motion Planning, and Enhance Feedback Mechanisms

- Set success flags on results when actions complete successfully in both `mtp_jeet_cart.cpp` and `mtp_jtc.cpp`, providing proper feedback to clients.
- Increased trajectory planning granularity by adjusting the divisor from 0.01 to 0.001 in `mtp_jtc_cart.cpp`, resulting in smoother robot movements.
- Introduced a new service `GetNamedPose` defined in `GetNamedPose.srv`, allowing nodes to request specific poses by name, enhancing modularity and reusability.
- Optimized motion planning in `mtp_jtc.cpp` by immediately succeeding when no movement is needed, reducing unnecessary computations.
- Updated `CMakeLists.txt` to include the new service
This commit is contained in:
Ilya Uraev 2025-03-03 16:16:06 +03:00
parent 1e63fa4c6e
commit d7f1c0cb1b
7 changed files with 28 additions and 10 deletions

View file

@ -18,17 +18,19 @@ public:
static PortsList providedPorts() {
return providedBasicPorts({InputPort<std::string>("robot_name"),
InputPort<std::vector<double>>("JointState")});
InputPort<std::vector<double>>("joint_state"),
InputPort<double>("duration")});
}
bool setGoal(RosActionNode::Goal &goal) override {
getInput("robot_name", goal.robot_name);
getInput("JointState", goal.joint_values);
getInput("joint_state", goal.joint_values);
getInput("duration", goal.duration);
return true;
}
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);
if (!wr.result->success) {
return NodeStatus::FAILURE;
}

View file

@ -34,7 +34,7 @@ public:
NodeStatus onResultReceived(const WrappedResult &wr) override {
RCLCPP_INFO(this->logger(), "Starting get response");
RCLCPP_INFO(this->logger(), "Starting get response %s with status %b", this->action_name_.c_str(), wr.result->success);
if (!wr.result->success) {
return NodeStatus::FAILURE;
}