Skip to content

Commit

Permalink
Add persist flags option to launch files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samahu committed Aug 19, 2024
1 parent a7709c3 commit 341706f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions launch/driver.launch
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
<arg name="azimuth_window_end" default="360000" doc="azimuth window end;
values range [0, 360000] millideggrees"/>

<arg name="persist_config" default="false"
doc="request the sensor to persist settings"/>

<group ns="$(arg ouster_ns)">
<node pkg="nodelet" type="nodelet" name="os_nodelet_mgr"
output="screen" required="true" args="manager"/>
Expand Down Expand Up @@ -99,6 +102,7 @@
<param name="~/point_type" value="$(arg point_type)"/>
<param name="~/azimuth_window_start" value="$(arg azimuth_window_start)"/>
<param name="~/azimuth_window_end" value="$(arg azimuth_window_end)"/>
<param name="~/persist_config" value="$(arg persist_config)"/>
</node>
</group>

Expand Down
4 changes: 4 additions & 0 deletions launch/record.launch
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
<arg name="azimuth_window_end" default="360000" doc="azimuth window end,
values range [0, 360000] millideggrees"/>

<arg name="persist_config" default="false"
doc="request the sensor to persist settings"/>

<group ns="$(arg ouster_ns)">
<node pkg="nodelet" type="nodelet" name="os_nodelet_mgr"
output="screen" required="true" args="manager"/>
Expand All @@ -93,6 +96,7 @@
<param name="~/metadata" type="str" value="$(arg metadata)"/>
<param name="~/azimuth_window_start" value="$(arg azimuth_window_start)"/>
<param name="~/azimuth_window_end" value="$(arg azimuth_window_end)"/>
<param name="~/persist_config" value="$(arg persist_config)"/>
</node>
</group>

Expand Down
4 changes: 4 additions & 0 deletions launch/sensor.launch
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
<arg name="azimuth_window_end" default="360000" doc="azimuth window end;
values range [0, 360000] millideggrees"/>

<arg name="persist_config" default="false"
doc="request the sensor to persist settings"/>

<group ns="$(arg ouster_ns)">
<node pkg="nodelet" type="nodelet" name="os_nodelet_mgr"
output="screen" required="true" args="manager"/>
Expand All @@ -97,6 +100,7 @@
<param name="~/metadata" type="str" value="$(arg metadata)"/>
<param name="~/azimuth_window_start" value="$(arg azimuth_window_start)"/>
<param name="~/azimuth_window_end" value="$(arg azimuth_window_end)"/>
<param name="~/persist_config" value="$(arg persist_config)"/>
</node>
</group>

Expand Down
4 changes: 4 additions & 0 deletions launch/sensor_mtp.launch
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
<arg name="azimuth_window_end" default="360000" doc="azimuth window end,
values range [0, 360000] millideggrees"/>

<arg name="persist_config" default="false"
doc="request the sensor to persist settings"/>

<group ns="$(arg ouster_ns)">
<node pkg="nodelet" type="nodelet" name="os_nodelet_mgr"
output="screen" required="true"
Expand All @@ -104,6 +107,7 @@
<param name="~/metadata" type="str" value="$(arg metadata)"/>
<param name="~/azimuth_window_start" value="$(arg azimuth_window_start)"/>
<param name="~/azimuth_window_end" value="$(arg azimuth_window_end)"/>
<param name="~/persist_config" value="$(arg persist_config)"/>
</node>
</group>

Expand Down
12 changes: 12 additions & 0 deletions src/os_sensor_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ sensor::sensor_config OusterSensor::parse_config_from_ros_parameters() {
config.udp_port_imu = imu_port;
}

persist_config = nh.param("persist_config", false);
if (persist_config && (lidar_port == 0 || imu_port == 0)) {
NODELET_WARN("When using persist_config it is recommended to not "
"use 0 for port value");
}


config.udp_profile_lidar = udp_profile_lidar;
config.operating_mode = sensor::OPERATING_NORMAL;
if (lidar_mode) config.ld_mode = lidar_mode;
Expand Down Expand Up @@ -376,6 +383,11 @@ uint8_t OusterSensor::compose_config_flags(
config_flags |= ouster::sensor::CONFIG_FORCE_REINIT;
}

if (persist_config) {
NODELET_INFO("Configuration will be persisted");
config_flags |= ouster::sensor::CONFIG_PERSIST;
}

return config_flags;
}

Expand Down

0 comments on commit 341706f

Please sign in to comment.