ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

laser_filters LaserScanRangeFilter not publishing

asked 2021-04-08 12:09:28 -0500

EricW gravatar image

updated 2022-05-23 09:15:33 -0500

lucasw gravatar image

I'm trying to use the LaserScanRangeFilter to remove points that are far away. However, nothing is published on the topics it should be mapping to.

Here is my laser_filter_config.yaml:

scan_filter_chain:
  - name: range
    type: laser_filters/LaserScanRangeFilter
    params:
      use_message_range_limits: false
      lower_threshold: 0.0
      upper_threshold: 2.0
      lower_replacement_value: -.inf
      upper_replacement_value: .inf

Here is my launch file (I am using the Autonomous Research Kit provided by Clearpath for the Husky robot):

<launch>
  <!-- We want to wait for the ARK to start up, so we don't run right away -->
  <arg name="node_start_delay" default="4.0" />  
  <arg name="route" default="$(dirname)/../config/route.json"/>

  <!-- Start the ARK navigation server -->
  <include file="$(find husky_cpr_ark_navigation)/launch/husky_ark_navigation.launch">
      <arg name="front_laser" value="/front/scan_processed"/>
      <arg name="rear_laser" value="/rear/scan_processed"/>
  </include>

  <node pkg="laser_filters" type="scan_to_scan_filter_chain" output="screen"
      name="laser_filter">
    <rosparam command="load" file="$(dirname)/../config/laser_filter_config.yaml" />
    <remap from="/front/scan" to="/front/scan_processed" />
    <remap from="/rear/scan" to="/rear/scan_processed" />
  </node>
</launch>

I can do rostopic echo /front/scan and rostopic echo /rear/scan and I see the lidars are generating data, but nothing appears when I do rostopoic echo /front/scan_processed or rostopoic echo /rear/scan_processed.

I also looked at rqt_graph and there is nothing going in or out of the laser_filter node.

I would really appreciate any advice.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-04-08 17:54:47 -0500

EricW gravatar image

I was able to figure this out. The issue was I didn't realize how remap worked. This helped a lot.

Here is a working launch file:

<launch>
  <!-- We want to wait for the ARK to start up, so we don't run right away -->
  <arg name="node_start_delay" default="4.0" />  
  <arg name="route" default="$(dirname)/../config/route.json"/>

  <!-- Start the ARK navigation server -->
  <include file="$(find husky_cpr_ark_navigation)/launch/husky_ark_navigation.launch">
      <arg name="front_laser" value="/front/scan_processed"/>
      <arg name="rear_laser" value="/rear/scan_processed"/>
  </include>

  <node pkg="laser_filters" type="scan_to_scan_filter_chain" output="screen"
      name="laser_filter_front">
    <rosparam command="load" file="$(dirname)/../config/laser_filter_config.yaml" />
    <remap from="scan" to="/front/scan" />
    <remap from="scan_filtered" to="/front/scan_processed" />
  </node>

  <node pkg="laser_filters" type="scan_to_scan_filter_chain" output="screen"
      name="laser_filter_rear">
    <rosparam command="load" file="$(dirname)/../config/laser_filter_config.yaml" />
    <remap from="scan" to="/rear/scan" />
    <remap from="scan_filtered" to="/rear/scan_processed" />
  </node>

  <!-- Launch the custom husky_ark node -->
  <node pkg="husky_ark_armlab" type="husky_ark_armlab.py" 
    name="husky_ark_armlab" output="screen" launch-prefix="bash -c 'sleep $(arg node_start_delay); $0 $@' "
    args="--route $(arg route)">
      <rosparam command="load" file="$(dirname)/../config/default.yaml" />
  </node>
</launch>
edit flag offensive delete link more

Comments

@EricW I have been having issues trying to figure a way to use laser_filter, I don't believe my launch file is correct. Could you please spare the time to look at at my question here

distro gravatar image distro  ( 2022-01-22 15:50:58 -0500 )edit

Question Tools

Stats

Asked: 2021-04-08 12:09:28 -0500

Seen: 200 times

Last updated: Apr 08 '21