Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Service to unregister workcells #53

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion nexus_endpoints.redf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ endpoints:
description: Register a workcell
type: service
service_name: /register_workcell
# Robot Arm Controller
service_type: nexus_orchestrator_msgs/srv/RegisterWorkcell
- title: Unregister Workcell Service
description: Unregister a workcell
type: service
service_name: /unregister_workcell
service_type: nexus_orchestrator_msgs/srv/UnregisterWorkcell
# Robot Arm Controller
- title: Controller Robot Trajectory Action
description: Send a controller action goal to a robot arm
type: action
Expand Down
21 changes: 21 additions & 0 deletions nexus_endpoints/nexus_endpoints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <nexus_orchestrator_msgs/srv/register_workcell.hpp>
#include <nexus_orchestrator_msgs/srv/remove_pending_task.hpp>
#include <nexus_orchestrator_msgs/srv/signal_workcell.hpp>
#include <nexus_orchestrator_msgs/srv/unregister_workcell.hpp>
#include <nexus_transporter_msgs/action/transport.hpp>
#include <nexus_transporter_msgs/srv/is_transporter_available.hpp>
#include <trajectory_msgs/msg/joint_trajectory.hpp>
Expand Down Expand Up @@ -255,6 +256,26 @@ class RegisterWorkcellService {
}
};

class UnregisterWorkcellService {
public:
using ServiceType = nexus_orchestrator_msgs::srv::UnregisterWorkcell;

static inline std::string service_name() {
const std::string name = "/unregister_workcell";
return name;
}

template<typename NodePtrT, typename CallbackT>
static rclcpp::Service<UnregisterWorkcellService::ServiceType>::SharedPtr create_service(NodePtrT node, CallbackT&& callback) {
return node->template create_service<UnregisterWorkcellService::ServiceType>(UnregisterWorkcellService::service_name(), std::forward<CallbackT>(callback));
}

template<typename NodePtrT>
static rclcpp::Client<UnregisterWorkcellService::ServiceType>::SharedPtr create_client(NodePtrT node) {
return node->template create_client<UnregisterWorkcellService::ServiceType>(UnregisterWorkcellService::service_name());
}
};

class ControllerRobotTrajectoryAction {
public:
using ActionType = control_msgs::action::FollowJointTrajectory;
Expand Down
1 change: 1 addition & 0 deletions nexus_msgs/nexus_orchestrator_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ set(srv_files
"srv/RegisterWorkcell.srv"
"srv/RemovePendingTask.srv"
"srv/SignalWorkcell.srv"
"srv/UnregisterWorkcell.srv"
)

rosidl_generate_interfaces(${PROJECT_NAME}
Expand Down
19 changes: 19 additions & 0 deletions nexus_msgs/nexus_orchestrator_msgs/srv/UnregisterWorkcell.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Service to unregister a workcell with the system orchestrator

# Description provided by the workcell for unregistration
WorkcellDescription description

---

# True if workcell is removed successfully
bool success

int32 error_code
int32 ERROR_UNKNOWN=0
# System orchestrator is not ready
int32 ERROR_NOT_READY=1
# The workcell was not registered
int32 ERROR_NOT_REGISTERED=2

# [OPTIONAL] message for debugging or indicating cause of success/failure
string message
Loading