File tree Expand file tree Collapse file tree
ros2_example_bazel_installed/ros2_example_apps Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ def _ament_index_files_impl(ctx):
6060 for src in ctx .attr .srcs :
6161 if ctx .attr .subdirectory == "lib" :
6262 exe_file = src .files_to_run .executable
63+ if exe_file == None :
64+ continue
6365 symlink_path = paths .join (
6466 ctx .attr .prefix ,
6567 "lib" ,
Original file line number Diff line number Diff line change @@ -202,11 +202,6 @@ def ros_launch(
202202 # runfiles.py to use "this repository" in a way that doesn't require
203203 # bespoke information.
204204 workspace_name = None ,
205- # Optional ROS 2 package name. When set, an ament_index_executables
206- # target is created from the data= labels, enabling
207- # launch_ros.actions.Node(package=..., executable=...) to find
208- # Bazel-built binaries without a colcon install space.
209- package_name = None ,
210205 ** kwargs ):
211206 main = "{}_roslaunch_main.py" .format (name )
212207 launch_respath = _make_respath (launch_file , workspace_name )
@@ -228,11 +223,11 @@ def ros_launch(
228223 ],
229224 )
230225
231- if package_name :
226+ if data :
232227 index_target = "_{}_ament_index" .format (name )
233228 ament_index_executables (
234229 name = index_target ,
235- package_name = package_name ,
230+ package_name = native . package_name () ,
236231 srcs = data ,
237232 visibility = ["//visibility:private" ],
238233 )
Original file line number Diff line number Diff line change @@ -259,10 +259,9 @@ ros_launch(
259259)
260260
261261# Uses launch_ros.actions.Node, the natural ROS 2 pattern, by registering
262- # the Bazel-built binaries in a fake ament prefix via package_name= .
262+ # the Bazel-built binaries in a fake ament prefix.
263263ros_launch (
264264 name = "eg_launch_with_action_node" ,
265- package_name = "ros2_example_apps" ,
266265 data = [
267266 ":eg_listener" ,
268267 ":eg_talker" ,
You can’t perform that action at this time.
0 commit comments