-
Notifications
You must be signed in to change notification settings - Fork 59
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
Publish fleet and task updates over ROS 2 if websocket is not provided #383
Conversation
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Can it publish regardless if websocket is enabled? Connection issues aside, I feel that the split of multiple transport is causing unnecessary complexities as well. websockets is the "public" api but it doesn't expose many important information (like door, lifts, maps etc), the ros2 side is "internal", does expose them but it doesn't expose task states etc. So in practice, it is very likely for downstream to have to listen to both transports and deal with 2 different message schema format. |
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
As per discussion, publishing over ROS 2 regardless of websocket availability makes sense |
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@@ -294,9 +300,15 @@ class Dispatcher::Implementation | |||
this->handle_dispatch_ack(*msg); | |||
}); | |||
|
|||
task_state_update_pub = node->create_publisher<TaskStateUpdateMsg>( | |||
rmf_task_ros2::TaskStateUpdateTopicName, | |||
rclcpp::ServicesQoS().keep_last(10).reliable().transient_local()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is using a different QoS from https://github.com/open-rmf/rmf_ros2/pull/383/files#diff-979ff9700f77b8e1260de3301125242adb32556ba5092fcddcc39e91baa09a2dR195-R196?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for spotting that, I've corrected them to be the same 07b9c6a
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one very minor recommendation on QoS history length for log topics, and then I'll be happy to approve.
@@ -192,6 +192,15 @@ TaskManagerPtr TaskManager::make( | |||
self->_handle_request(request->json_msg, request->request_id); | |||
}); | |||
|
|||
auto reliable_transient_qos = | |||
rclcpp::ServicesQoS().keep_last(10).reliable().transient_local(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is going to be used for logs which could experience sudden bursts that we don't want to miss, I would suggest having at least .keep_last(100)
for logs. But since task states always send out the latest state, replacing whatever was sent before, 10 would be sufficient.
Maybe we should have a different history value for each.
FleetStateUpdateTopicName, reliable_transient_qos); | ||
handle->_pimpl->fleet_log_update_pub = | ||
handle->_pimpl->node->create_publisher<FleetLogUpdateMsg>( | ||
FleetLogUpdateTopicName, reliable_transient_qos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend using 100 history for this log topic as well.
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
New feature implementation
Implemented feature
Allows
fleet_state_update
,fleet_log_update
,task_state_update
, andtask_log_update
to be published over ROS 2 when websocket server URL is not provided.Works with open-rmf/rmf-web#1003
Implementation description
The motivation is related to open-rmf/rmf-web#899, where non-reproducible issues with websockets occur unpredictably in production environments, causing various systems to fail.
This allows the option to mitigate issues with the upstream
websocketpp
library, and just rely on ROS 2 to publish updates instead.This will also allow the use of ROS 2 introspection tools in production if network instability occurs, which hopefully is a much better experience than debugging websocket connections.
Testing
Instead of running demos with the
server_uri
, just runros2 run rmf_demos_gz office.launch.xml #headless:=1