Skip to content

Commit db961a7

Browse files
committed
bridge sky_cam
1 parent 614505d commit db961a7

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

artefacts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
timeout: 5 #minutes
1616
scenarios:
1717
defaults: # Global to all scenarios, and overriden in specific scenarios.
18-
output_dirs: ["output"]
18+
output_dirs: ["output", "rosbags"]
1919
metrics:
2020
- /odometry_error
2121
- /distance_from_start_gt

src/sam_bot_nav2_gz/test/test_follow_waypoints.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import launch_pytest
88
import launch_testing
99
from launch_pytest.tools import process as process_tools
10+
from launch_ros.actions import Node
1011

1112
import pytest
1213
from artefacts_toolkit.chart import make_chart
@@ -36,20 +37,6 @@ def rosbag_data():
3637
+ ["-o", rosbag_filepath, "--storage", "mcap"]
3738
)
3839

39-
test_talker_node_cmd = [
40-
"ros2",
41-
"topic",
42-
"pub",
43-
"-r",
44-
"1",
45-
"--once",
46-
"--wait-matching-subscriptions",
47-
"0",
48-
"/test_talker",
49-
"std_msgs/msg/String",
50-
"--",
51-
"\"{data: 'Recording...'}\"",
52-
]
5340
print(f"Recording to {rosbag_filepath} with command: {' '.join(rosbag_cmd)}")
5441
return launch.actions.ExecuteProcess(
5542
name="rosbag2",
@@ -117,16 +104,32 @@ def odometry_node():
117104
)
118105

119106

107+
@pytest.fixture(scope="module")
108+
def gz_bridge_node():
109+
"""Bridge extra gazebo topics to ros2."""
110+
return Node(
111+
package="ros_gz_bridge",
112+
executable="parameter_bridge",
113+
arguments=[
114+
"/sky_cam@sensor_msgs/msg/Image@ignition.msgs.Image",
115+
],
116+
output="screen",
117+
)
118+
119+
120120
# This function specifies the processes to be run for our test.
121121
@launch_pytest.fixture(
122122
scope="module"
123123
) # Set the scope so the processes are not killed after each test
124-
def launch_description(navigation_stack, rosbag_recording, odometry_node):
124+
def launch_description(
125+
navigation_stack, rosbag_recording, odometry_node, gz_bridge_node
126+
):
125127
return launch.LaunchDescription(
126128
[
127129
navigation_stack,
128130
rosbag_recording["bag_recorder"],
129131
odometry_node,
132+
gz_bridge_node,
130133
# Tell launch when to start the test
131134
# If no ReadyToTest action is added, one will be appended automatically.
132135
launch_pytest.actions.ReadyToTest(),

0 commit comments

Comments
 (0)