Skip to content

Commit

Permalink
Update QoS for panel publishers (#74)
Browse files Browse the repository at this point in the history
* First draft of event based state update

Signed-off-by: Luca Della Vedova <[email protected]>

* Fix publishing of building markers on non existing level

Signed-off-by: Luca Della Vedova <[email protected]>

* Fix QoS for door and lift states

Signed-off-by: Luca Della Vedova <[email protected]>

* Always publish whole state to rviz

Signed-off-by: Luca Della Vedova <[email protected]>

* Remove unused imports

Signed-off-by: Luca Della Vedova <[email protected]>

* Add missing lift state publish

Signed-off-by: Luca Della Vedova <[email protected]>

* Fix lift request QoS to be transient local

Signed-off-by: Luca Della Vedova <[email protected]>

* Revert to main

Signed-off-by: Luca Della Vedova <[email protected]>

* Remove extra change

Signed-off-by: Luca Della Vedova <[email protected]>

---------

Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova authored Jun 5, 2024
1 parent 35f7e4f commit e6e256b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion rmf_visualization_rviz2_plugins/src/DoorPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ DoorPanel::DoorPanel(QWidget* parent)
: rviz_common::Panel(parent),
_requester_id(DoorPanelRequesterId)
{
const auto default_qos =
rclcpp::SystemDefaultsQoS().durability_volatile().keep_last(100).reliable();
_node = std::make_shared<rclcpp::Node>(_requester_id + "_node");
_door_state_sub = _node->create_subscription<DoorState>(
DoorStateTopicName, 10, [&](DoorState::UniquePtr msg)
DoorStateTopicName, default_qos, [&](DoorState::UniquePtr msg)
{
door_state_callback(std::move(msg));
});
Expand Down
10 changes: 7 additions & 3 deletions rmf_visualization_rviz2_plugins/src/LiftPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ LiftPanel::LiftPanel(QWidget* parent)
: rviz_common::Panel(parent),
_session_id(LiftPanelSessionId)
{
const auto default_qos =
rclcpp::SystemDefaultsQoS().durability_volatile().keep_last(100).reliable();
const auto transient_qos =
rclcpp::SystemDefaultsQoS().transient_local().keep_last(100).reliable();
_node = std::make_shared<rclcpp::Node>(_session_id + "_node");
_lift_state_sub = _node->create_subscription<LiftState>(
LiftStateTopicName, 10, [&](LiftState::UniquePtr msg)
LiftStateTopicName, default_qos, [&](LiftState::UniquePtr msg)
{
lift_state_callback(std::move(msg));
});
_lift_request_pub = _node->create_publisher<LiftRequest>(
LiftRequestTopicName, rclcpp::QoS(10));
LiftRequestTopicName, transient_qos);
_adapter_lift_request_pub = _node->create_publisher<LiftRequest>(
AdapterLiftRequestTopicName, rclcpp::QoS(10));
AdapterLiftRequestTopicName, transient_qos);

create_layout();
create_connections();
Expand Down

0 comments on commit e6e256b

Please sign in to comment.