Skip to content

Commit

Permalink
Revert "use separate params for tf frames"
Browse files Browse the repository at this point in the history
This reverts commit 4361969.
  • Loading branch information
Aposhian committed May 1, 2023
1 parent 09b6415 commit df7e292
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 39 deletions.
4 changes: 1 addition & 3 deletions ouster-ros/config/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@ ouster/os_sensor:
imu_port: 0
ouster/os_cloud:
ros__parameters:
sensor_frame: '' # Frame of physical sensor
lidar_frame: '' # Frame of lidar scans
imu_frame: '' # Frame of IMU data
tf_prefix: ''
timestamp_mode: ''
8 changes: 2 additions & 6 deletions ouster-ros/launch/record.composite.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
description="whether to run a rviz"/>
<arg name="rviz_config" default="$(find-pkg-share ouster_ros)/config/viz.rviz"
description="optional rviz config file"/>
<arg name="sensor_frame" default="" description="tf frame of physical sensor"/>
<arg name="lidar_frame" default="" description="tf frame of lidar scan data"/>
<arg name="imu_frame" default="" description="tf frame of imu data"/>
<arg name="tf_prefix" default="" description="namespace for tf transforms"/>

<group>
<push-ros-namespace namespace="$(var ouster_ns)"/>
Expand All @@ -61,9 +59,7 @@
<param name="metadata" value="$(var metadata)"/>
</composable_node>
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterCloud" name="os_cloud">
<param name="lidar_frame" value="$(var lidar_frame)"/>
<param name="sensor_frame" value="$(var sensor_frame)"/>
<param name="imu_frame" value="$(var imu_frame)"/>
<param name="tf_prefix" value="$(var tf_prefix)"/>
<param name="timestamp_mode" value="$(var timestamp_mode)"/>
</composable_node>
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterImage" name="os_image"/>
Expand Down
8 changes: 2 additions & 6 deletions ouster-ros/launch/replay.composite.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
description="whether to run a rviz"/>
<arg name="rviz_config" default="$(find-pkg-share ouster_ros)/config/viz.rviz"
description="optional rviz config file"/>
<arg name="sensor_frame" default="" description="tf frame of physical sensor"/>
<arg name="lidar_frame" default="" description="tf frame of lidar scan data"/>
<arg name="imu_frame" default="" description="tf frame of imu data"/>
<arg name="tf_prefix" default="" description="namespace for tf transforms"/>

<let name="_use_metadata_file" value="$(eval '\'$(var metadata)\' != \'\'')"/>

Expand All @@ -31,9 +29,7 @@
</node>
<node_container pkg="rclcpp_components" exec="component_container_mt" name="os_container" output="screen" namespace="">
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterCloud" name="os_cloud">
<param name="lidar_frame" value="$(var lidar_frame)"/>
<param name="sensor_frame" value="$(var sensor_frame)"/>
<param name="imu_frame" value="$(var imu_frame)"/>
<param name="tf_prefix" value="$(var tf_prefix)"/>
<param name="timestamp_mode" value="$(var timestamp_mode)"/>
</composable_node>
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterImage" name="os_image"/>
Expand Down
8 changes: 2 additions & 6 deletions ouster-ros/launch/sensor.composite.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
description="whether to run a rviz"/>
<arg name="rviz_config" default="$(find-pkg-share ouster_ros)/config/viz.rviz"
description="optional rviz config file"/>
<arg name="sensor_frame" default="" description="tf frame of physical sensor"/>
<arg name="lidar_frame" default="" description="tf frame of lidar scan data"/>
<arg name="imu_frame" default="" description="tf frame of imu data"/>
<arg name="tf_prefix" default="" description="namespace for tf transforms"/>

<group>
<push-ros-namespace namespace="$(var ouster_ns)"/>
Expand All @@ -59,9 +57,7 @@
<param name="metadata" value="$(var metadata)"/>
</composable_node>
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterCloud" name="os_cloud">
<param name="lidar_frame" value="$(var lidar_frame)"/>
<param name="sensor_frame" value="$(var sensor_frame)"/>
<param name="imu_frame" value="$(var imu_frame)"/>
<param name="tf_prefix" value="$(var tf_prefix)"/>
<param name="timestamp_mode" value="$(var timestamp_mode)"/>
</composable_node>
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterImage" name="os_image"/>
Expand Down
8 changes: 2 additions & 6 deletions ouster-ros/launch/sensor.independent.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
description="whether to run a rviz"/>
<arg name="rviz_config" default="$(find-pkg-share ouster_ros)/config/viz.rviz"
description="optional rviz config file"/>
<arg name="sensor_frame" default="" description="tf frame of physical sensor"/>
<arg name="lidar_frame" default="" description="tf frame of lidar scan data"/>
<arg name="imu_frame" default="" description="tf frame of imu data"/>
<arg name="tf_prefix" default="" description="namespace for tf transforms"/>

<group>
<push-ros-namespace namespace="$(var ouster_ns)"/>
Expand All @@ -58,9 +56,7 @@
<param name="metadata" value="$(var metadata)"/>
</node>
<node pkg="ouster_ros" exec="os_cloud" name="os_cloud" output="screen">
<param name="lidar_frame" value="$(var lidar_frame)"/>
<param name="sensor_frame" value="$(var sensor_frame)"/>
<param name="imu_frame" value="$(var imu_frame)"/>
<param name="tf_prefix" value="$(var tf_prefix)"/>
<param name="timestamp_mode" value="$(var timestamp_mode)"/>
</node>
<node pkg="ouster_ros" exec="os_image" name="os_image" output="screen"/>
Expand Down
8 changes: 2 additions & 6 deletions ouster-ros/launch/sensor_mtp.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
description="whether to run a rviz"/>
<arg name="rviz_config" default="$(find-pkg-share ouster_ros)/config/viz.rviz"
description="optional rviz config file"/>
<arg name="sensor_frame" default="" description="tf frame of physical sensor"/>
<arg name="lidar_frame" default="" description="tf frame of lidar scan data"/>
<arg name="imu_frame" default="" description="tf frame of imu data"/>
<arg name="tf_prefix" default="" description="namespace for tf transforms"/>

<group>
<push-ros-namespace namespace="$(var ouster_ns)"/>
Expand All @@ -67,9 +65,7 @@
<param name="metadata" value="$(var metadata)"/>
</composable_node>
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterCloud" name="os_cloud">
<param name="lidar_frame" value="$(var lidar_frame)"/>
<param name="sensor_frame" value="$(var sensor_frame)"/>
<param name="imu_frame" value="$(var imu_frame)"/>
<param name="tf_prefix" value="$(var tf_prefix)"/>
<param name="timestamp_mode" value="$(var timestamp_mode)"/>
</composable_node>
<composable_node pkg="ouster_ros" plugin="ouster_ros::OusterImage" name="os_image"/>
Expand Down
13 changes: 7 additions & 6 deletions ouster-ros/src/os_cloud_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,17 @@ class OusterCloud : public OusterProcessingNodeBase {
}

void declare_parameters() {
declare_parameter<std::string>("lidar_frame");
declare_parameter<std::string>("sensor_frame");
declare_parameter<std::string>("imu_frame");
declare_parameter<std::string>("tf_prefix");
declare_parameter<std::string>("timestamp_mode");
}

void parse_parameters() {
sensor_frame = get_parameter("sensor_frame").as_string();
imu_frame = get_parameter("imu_frame").as_string();
lidar_frame = get_parameter("lidar_frame").as_string();
auto tf_prefix = get_parameter("tf_prefix").as_string();
if (is_arg_set(tf_prefix) && tf_prefix.back() != '/')
tf_prefix.append("/");
sensor_frame = tf_prefix + "os_sensor";
imu_frame = tf_prefix + "os_imu";
lidar_frame = tf_prefix + "os_lidar";
auto timestamp_mode_arg = get_parameter("timestamp_mode").as_string();
use_ros_time = timestamp_mode_arg == "TIME_FROM_ROS_TIME";
}
Expand Down

0 comments on commit df7e292

Please sign in to comment.