Skip to content

Commit

Permalink
Clean up ROS 2 topic, fix frontend api call
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Mar 27, 2024
1 parent e49a3c2 commit 9f76d37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 46 deletions.
42 changes: 0 additions & 42 deletions packages/api-server/api_server/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from rmf_fleet_msgs.msg import DeliveryAlertAction as RmfDeliveryAlertAction
from rmf_fleet_msgs.msg import DeliveryAlertCategory as RmfDeliveryAlertCategory
from rmf_fleet_msgs.msg import DeliveryAlertTier as RmfDeliveryAlertTier
from rmf_fleet_msgs.msg import InterruptRequest as RmfInterruptRequest
from rmf_ingestor_msgs.msg import IngestorState as RmfIngestorState
from rmf_lift_msgs.msg import LiftRequest as RmfLiftRequest
from rmf_lift_msgs.msg import LiftState as RmfLiftState
Expand Down Expand Up @@ -110,17 +109,6 @@ def __init__(
),
)

self._decommission_robot_request = ros_node().create_publisher(
RmfInterruptRequest,
"robot_decommission_request",
rclpy.qos.QoSProfile(
history=rclpy.qos.HistoryPolicy.KEEP_LAST,
depth=10,
reliability=rclpy.qos.ReliabilityPolicy.RELIABLE,
durability=rclpy.qos.DurabilityPolicy.TRANSIENT_LOCAL,
),
)

self.cached_files = cached_files
self.logger = logger or base_logger.getChild(self.__class__.__name__)
self._subscriptions: List[Subscription] = []
Expand Down Expand Up @@ -294,36 +282,6 @@ def respond_to_delivery_alert(
msg.message = message
self._delivery_alert_response.publish(msg)

def decommission_robot(
self,
fleet_name: str,
robot_name: str,
request_id: str,
labels: List[str],
):
msg = RmfInterruptRequest()
msg.fleet_name = fleet_name
msg.robot_name = robot_name
msg.interrupt_id = request_id
msg.labels = labels
msg.type = RmfInterruptRequest.TYPE_INTERRUPT
self._decommission_robot_request.publish(msg)

def recommission_robot(
self,
fleet_name: str,
robot_name: str,
request_id: str,
labels: List[str],
):
msg = RmfInterruptRequest()
msg.fleet_name = fleet_name
msg.robot_name = robot_name
msg.interrupt_id = request_id
msg.labels = labels
msg.type = RmfInterruptRequest.TYPE_RESUME
self._decommission_robot_request.publish(msg)


_rmf_gateway: RmfGateway

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export function RobotDecommissionButton({
if (!rmf) {
throw new Error('fleets api not available');
}
const id = `decommission-${fleet}-${robotState.name}-${Date.now()}`;
await rmf.fleetsApi?.decommissionRobotFleetsNameDecommissionPost(fleet, robotState.name, id);
await rmf.fleetsApi?.decommissionRobotFleetsNameDecommissionPost(fleet, robotState.name);
appController.showAlert('success', `Decommission of ${fleet}:${robotState.name} requested`);
} catch (e) {
appController.showAlert(
Expand All @@ -75,8 +74,7 @@ export function RobotDecommissionButton({
if (!rmf) {
throw new Error('fleets api not available');
}
const id = `recommission-${fleet}-${robotState.name}-${Date.now()}`;
await rmf.fleetsApi?.recommissionRobotFleetsNameRecommissionPost(fleet, robotState.name, id);
await rmf.fleetsApi?.recommissionRobotFleetsNameRecommissionPost(fleet, robotState.name);
appController.showAlert('success', `Recommission of ${fleet}:${robotState.name} requested`);
} catch (e) {
appController.showAlert(
Expand Down

0 comments on commit 9f76d37

Please sign in to comment.