Skip to content

Commit

Permalink
Fix the OakD launch so camera topics are properly namespaced when usi…
Browse files Browse the repository at this point in the history
…ng a non-empty robot namespace
  • Loading branch information
civerachb-cpr committed Oct 23, 2024
1 parent 59b683f commit c2803bd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion turtlebot4_bringup/launch/lite.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def generate_launch_description():
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource([oakd_launch_file]),
launch_arguments=[('camera', 'oakd_lite')])
launch_arguments=[
('camera', 'oakd_lite'),
('namespace', namespace),
])
]
),

Expand Down
12 changes: 9 additions & 3 deletions turtlebot4_bringup/launch/oakd.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import DeclareLaunchArgument, GroupAction
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import ComposableNodeContainer
from launch_ros.actions import ComposableNodeContainer, PushRosNamespace
from launch_ros.descriptions import ComposableNode

from nav2_common.launch import RewrittenYaml
Expand Down Expand Up @@ -64,6 +64,12 @@ def generate_launch_description():
output='screen',
)

actions = [
PushRosNamespace(namespace),
node
]
oakd = GroupAction(actions)

ld = LaunchDescription(ARGUMENTS)
ld.add_action(node)
ld.add_action(oakd)
return ld
5 changes: 4 additions & 1 deletion turtlebot4_bringup/launch/standard.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def generate_launch_description():
actions=[
IncludeLaunchDescription(
PythonLaunchDescriptionSource([oakd_launch_file]),
launch_arguments=[('camera', 'oakd_pro')])
launch_arguments=[
('camera', 'oakd_pro'),
('namespace', namespace),
])
]
),

Expand Down

0 comments on commit c2803bd

Please sign in to comment.