Skip to content

Commit

Permalink
launch hw_monitor only when both launch_driver&launch_monitor are true
Browse files Browse the repository at this point in the history
Signed-off-by: Kento Yabuuchi <[email protected]>
  • Loading branch information
KYabuuchi committed Aug 26, 2024
1 parent 098b3ac commit dd5d1c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion common_sensor_launch/launch/hesai_OT128.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<!-- Params -->
<arg name="launch_driver" default="true"/>

<!-- There is an issue where hw_monitor crashes due to data race,
so the monitor will now only be launched when explicitly specified with a launch command. -->
<arg name="launch_hw_monitor" default="false"/>
Expand Down
2 changes: 1 addition & 1 deletion common_sensor_launch/launch/hesai_XT32.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<include file="$(find-pkg-share common_sensor_launch)/launch/nebula_node_container.launch.py">
<arg name="launch_driver" value="$(var launch_driver)"/>
<arg name="launch_hw_monitor" value="true"/>
<arg name="launch_hw_monitor" value="$(var launch_hw_monitor)"/>
<arg name="sensor_model" value="$(var model)"/>
<arg name="return_mode" value="$(var return_mode)"/>
<arg name="frame_id" value="$(var sensor_frame)"/>
Expand Down
13 changes: 9 additions & 4 deletions common_sensor_launch/launch/nebula_node_container.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ def create_parameter_dict(*args):
)
)

# There is an issue where hw_monitor crashes due to data race,
# There is an issue where hw_monitor crashes due to data race,
# so the monitor will now only be launched when explicitly specified with a launch command.
if LaunchConfiguration("launch_hw_monitor").perform(context):
launch_hw_monitor: bool = context.perform_substitution(LaunchConfiguration("launch_hw_monitor"))
launch_driver: bool = context.perform_substitution(LaunchConfiguration("launch_driver"))
if launch_hw_monitor and launch_driver:
nodes.append(
ComposableNode(
package="nebula_ros",
Expand All @@ -155,7 +157,9 @@ def create_parameter_dict(*args):
),
},
],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
extra_arguments=[
{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}
],
)
)

Expand Down Expand Up @@ -339,7 +343,8 @@ def add_launch_arg(name: str, default_value=None, description=None):
add_launch_arg(
"launch_hw_monitor",
"False",
"do launch hardware monitor. Due to an issue where hw_monitor crashes due to data conflicts, the monitor in launched only when explicitly specified")
"do launch hardware monitor. Due to an issue where hw_monitor crashes due to data conflicts, the monitor in launched only when explicitly specified",
)
add_launch_arg("setup_sensor", "True", "configure sensor")
add_launch_arg("retry_hw", "false", "retry hw")
add_launch_arg("sensor_ip", "192.168.1.201", "device ip address")
Expand Down

0 comments on commit dd5d1c6

Please sign in to comment.