Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
run: |
source /opt/ros/jazzy/setup.bash
source install/setup.bash
colcon test --packages-select rmf_path_server_test rmf_reservation_tests --event-handlers console_direct+
colcon test --executor sequential --packages-select rmf_path_server_test rmf_reservation_tests --event-handlers console_direct+
colcon test-result --all
shell: bash
38 changes: 26 additions & 12 deletions path_server/rmf_path_server_test/test/test_path_server_follow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from nav_msgs.msg import Odometry
import pytest
import rclpy
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile, ReliabilityPolicy
from rmf_prototype_msgs.msg import (
Destination,
DestinationConstraints,
Expand Down Expand Up @@ -131,6 +131,13 @@ def test_follow_scenario(self):
r2_positions = []
trajectory = []

reliable_transient_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
reliability=ReliabilityPolicy.RELIABLE,
)

def r1_odom_cb(msg):
x = msg.pose.pose.position.x
y = msg.pose.pose.position.y
Expand Down Expand Up @@ -167,26 +174,33 @@ def r2_plan_cb(msg):
f'progress {wp.progress}, blockers: {blockers}'
)

self.node.create_subscription(Odometry, 'robot_1/odom', r1_odom_cb, 10)
self.node.create_subscription(Odometry, 'robot_2/odom', r2_odom_cb, 10)
self.node.create_subscription(Plan, 'robot_1/plan', r1_plan_cb, 10)
self.node.create_subscription(Plan, 'robot_2/plan', r2_plan_cb, 10)
self.node.create_subscription(
Odometry, 'robot_1/odom', r1_odom_cb,
qos_profile=reliable_transient_qos
)
self.node.create_subscription(
Odometry, 'robot_2/odom', r2_odom_cb,
qos_profile=reliable_transient_qos
)
self.node.create_subscription(
Plan, 'robot_1/plan', r1_plan_cb,
qos_profile=reliable_transient_qos
)
self.node.create_subscription(
Plan, 'robot_2/plan', r2_plan_cb,
qos_profile=reliable_transient_qos
)

# Publishers for destinations
dest_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST
)
r1_dest_pub = self.node.create_publisher(
Destination,
'robot_1/destination',
qos_profile=dest_qos
qos_profile=reliable_transient_qos
)
r2_dest_pub = self.node.create_publisher(
Destination,
'robot_2/destination',
qos_profile=dest_qos
qos_profile=reliable_transient_qos
)

# Discovery publisher
Expand Down
22 changes: 12 additions & 10 deletions reservation_system/rmf_reservation_tests/test/test_overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import launch_testing
import pytest
import rclpy
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile, ReliabilityPolicy
from rmf_prototype_msgs.msg import (
Destination,
DestinationConstraints,
Expand Down Expand Up @@ -86,29 +86,31 @@ def test_overlapping_reservation(self):
r1_received = []
r2_errors = []

reliable_transient_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
reliability=ReliabilityPolicy.RELIABLE,
)

self.node.create_subscription(
Destination,
f'{r1_name}/destination',
lambda msg: r1_received.append(msg),
10,
qos_profile=reliable_transient_qos,
)
self.node.create_subscription(
DestinationError,
f'{r2_name}/destination/error',
lambda msg: r2_errors.append(msg),
10,
qos_profile=reliable_transient_qos,
)

goal_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
)
pub1 = self.node.create_publisher(
DestinationGoal, f'{r1_name}/destination/goal', qos_profile=goal_qos
DestinationGoal, f'{r1_name}/destination/goal', qos_profile=reliable_transient_qos
)
pub2 = self.node.create_publisher(
DestinationGoal, f'{r2_name}/destination/goal', qos_profile=goal_qos
DestinationGoal, f'{r2_name}/destination/goal', qos_profile=reliable_transient_qos
)

discovery_qos = QoSProfile(
Expand Down
20 changes: 11 additions & 9 deletions reservation_system/rmf_reservation_tests/test/test_path_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from nav_msgs.msg import Odometry
import pytest
import rclpy
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile, ReliabilityPolicy
from rmf_prototype_msgs.msg import (
Destination,
DestinationConstraints,
Expand Down Expand Up @@ -88,28 +88,30 @@ def test_plan_generation_and_publication(self):
robot_name = 'robot_1'
received_plans = []

reliable_transient_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
reliability=ReliabilityPolicy.RELIABLE,
)

self.node.create_subscription(
Plan,
f'{robot_name}/plan',
lambda msg: received_plans.append(msg),
10
qos_profile=reliable_transient_qos
)

input_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
)
dest_pub = self.node.create_publisher(
Destination,
f'{robot_name}/destination',
qos_profile=input_qos
qos_profile=reliable_transient_qos
)

odom_pub = self.node.create_publisher(
Odometry,
f'{robot_name}/odom',
qos_profile=input_qos
qos_profile=reliable_transient_qos
)

discovery_qos = QoSProfile(
Expand Down
9 changes: 5 additions & 4 deletions reservation_system/rmf_reservation_tests/test/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import launch_testing
import pytest
import rclpy
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile, ReliabilityPolicy
from rmf_prototype_msgs.msg import (
Destination,
DestinationConstraints,
Expand Down Expand Up @@ -68,10 +68,11 @@ def setUpClass(cls):
rclpy.init()
cls.node = rclpy.create_node('test_queue_node')

cls.goal_qos = QoSProfile(
cls.reliable_transient_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
reliability=ReliabilityPolicy.RELIABLE,
)
discovery_qos = QoSProfile(
depth=1,
Expand All @@ -86,7 +87,7 @@ def setUpClass(cls):
Destination,
f'{name}/destination',
lambda msg, n=name: cls.destinations[n].append(msg),
10,
qos_profile=cls.reliable_transient_qos,
)

cls.discovery_pub = cls.node.create_publisher(
Expand Down Expand Up @@ -122,7 +123,7 @@ def setUp(self):

for name in ROBOT_NAMES:
self.goal_pubs[name] = self.node.create_publisher(
DestinationGoal, f'{name}/destination/goal', qos_profile=self.goal_qos
DestinationGoal, f'{name}/destination/goal', qos_profile=self.reliable_transient_qos
)

for buffer in self.destinations.values():
Expand Down
18 changes: 10 additions & 8 deletions reservation_system/rmf_reservation_tests/test/test_reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import launch_testing
import pytest
import rclpy
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile, ReliabilityPolicy
from rmf_prototype_msgs.msg import (
Destination,
DestinationConstraints,
Expand Down Expand Up @@ -81,22 +81,24 @@ def test_single_reservation(self):
robot_name = 'robot_1'
received_dest = []

reliable_transient_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
reliability=ReliabilityPolicy.RELIABLE,
)

self.node.create_subscription(
Destination,
f'{robot_name}/destination',
lambda msg: received_dest.append(msg),
10
qos_profile=reliable_transient_qos
)

goal_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
)
pub = self.node.create_publisher(
DestinationGoal,
f'{robot_name}/destination/goal',
qos_profile=goal_qos
qos_profile=reliable_transient_qos
)

discovery_qos = QoSProfile(
Expand Down
11 changes: 6 additions & 5 deletions reservation_system/rmf_reservation_tests/test/test_safe_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import launch_testing
import pytest
import rclpy
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile
from rclpy.qos import DurabilityPolicy, HistoryPolicy, QoSProfile, ReliabilityPolicy
from rmf_prototype_msgs.msg import (
Destination,
DestinationConstraints,
Expand Down Expand Up @@ -77,10 +77,11 @@ def setUpClass(cls):
rclpy.init()
cls.node = rclpy.create_node('test_safe_sets_node')

goal_qos = QoSProfile(
reliable_transient_qos = QoSProfile(
depth=10,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
reliability=ReliabilityPolicy.RELIABLE,
)
discovery_qos = QoSProfile(
depth=1,
Expand All @@ -98,16 +99,16 @@ def setUpClass(cls):
Destination,
f'{name}/destination',
lambda msg, n=name: cls.destinations[n].append(msg),
10,
qos_profile=reliable_transient_qos,
)
cls.node.create_subscription(
DestinationError,
f'{name}/destination/error',
lambda msg, n=name: cls.errors[n].append(msg),
10,
qos_profile=reliable_transient_qos,
)
cls.goal_pubs[name] = cls.node.create_publisher(
DestinationGoal, f'{name}/destination/goal', qos_profile=goal_qos
DestinationGoal, f'{name}/destination/goal', qos_profile=reliable_transient_qos
)

cls.discovery_pub = cls.node.create_publisher(
Expand Down
Loading