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

Is it possible to add two laser for navigation2

asked 2021-01-11 05:16:16 -0500

SteveYK gravatar image

updated 2021-01-11 21:01:26 -0500

I'm using ros2 foxy in ubuntu 20.04 and try to show two laser scan topic in Rviz.

I open gazebo simulation for publish two topic /scan_1 and /scan_2.

Then modify nav2_params.yaml as below:

  local_costmap:
    local_costmap:
      ros__parameters:
        ...
        voxel_layer:
          ...
          observation_sources: scan_1 scan_2
            scan_1:
              topic: /scan_1 
              max_obstacle_height: 2.0
              clearing: True
              marking: True
              data_type: "LaserScan"
            scan_2:
              topic: /scan_2 
              max_obstacle_height: 2.0
              clearing: True
              marking: True
              data_type: "LaserScan"
  global_costmap:
    global_costmap:
      ros__parameters:
        ...
        voxel_layer:
          ...
          observation_sources: scan_1 scan_2
            scan_1:
              topic: /scan_1 
              max_obstacle_height: 2.0
              clearing: True
              marking: True
              data_type: "LaserScan"
            scan_2:
              topic: /scan_2 
              max_obstacle_height: 2.0
              clearing: True
              marking: True
              data_type: "LaserScan"

but it seems not show the local_costmap and global_costmap in Rviz.

my Rviz try to subscribe the topic /scan_1 or /scan_2, still not work.

if any other idea. Thanks for help.

Here my log file: https://drive.google.com/drive/folder...

edit retag flag offensive close merge delete

Comments

If gazebo only publish one laser topic /scan, and set local_costmap and global_costmap only one observation_sources. It can work and show those cosetmap in Rviz.

SteveYK gravatar image SteveYK  ( 2021-01-11 20:00:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-01-11 14:02:18 -0500

You may add any number of sensor sources into Nav2. I cannot debug your problem from that limited description, but to answer the titled question: yes. You can have an infinite number of sensors (within the bounds of reason given sufficient computational resources).

edit flag offensive delete link more

Comments

I saw this link below, it could set configuration in navigation.
link text
so, I think it the same method in Nav2, maybe I lack any step.

SteveYK gravatar image SteveYK  ( 2021-01-11 21:14:29 -0500 )edit

I found that nav2_amcl package only accept one laser scan data input. However, I have two laser data /scan_1 and /scan_2 import. Now my problem is that I can't merge two laser scan data under ROS2 foxy.

SteveYK gravatar image SteveYK  ( 2021-01-14 02:01:39 -0500 )edit
1

You can check if http://wiki.ros.org/laser_assembler has ROS2 foxy branch. If not, making sufficient changes shouldn't be much work

soldierofhell gravatar image soldierofhell  ( 2021-01-14 04:30:20 -0500 )edit

@soldierofhell Thanks for your reply. But in my opinion, this package laser_assembler won't work for amcl that requires a LaserScan message rather than Point_Cloud message. Is that right?

SteveYK gravatar image SteveYK  ( 2021-01-15 00:41:25 -0500 )edit
1

Yes, right, but there's also solution for that: http://wiki.ros.org/pointcloud_to_las...

soldierofhell gravatar image soldierofhell  ( 2021-01-15 01:33:51 -0500 )edit

hey @SteveYK did you solve this issue? i want to merge two laser scan data also

Shneider1m7 gravatar image Shneider1m7  ( 2021-02-26 07:48:51 -0500 )edit

@Shneider1m7 I recently solve this problem by another solution: link text. All configuration setting same as I mentioned above.

SteveYK gravatar image SteveYK  ( 2021-03-08 10:38:41 -0500 )edit

@SteveYK ira laser tools works only for ROS1, and I'm working with ROS2 foxy. Correct me if i'm wrong please.

Shneider1m7 gravatar image Shneider1m7  ( 2021-03-08 13:49:19 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-01-11 05:16:16 -0500

Seen: 783 times

Last updated: Jan 11 '21