[ROS2系列] ubuntu 20.04测试rtabmap 3D建图(二)

接上文我们继续

如果我们要在仿真环境中进行测试,需要将摄像头配置成功。

一、配置位置

sudo vim /opt/ros/foxy/share/turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf

二、修改


    camera_rgb_frame
    camera_rgb_optical_frame
    0 0 0 -1.57079632679 0 -1.57079632679
    
      0 0 1
    
   

重命名 
增加 
修改 
修改 image width/height from 1920x1080 to 640x480
修改 min scan range from 0.12 to 0.2

可以在vim里面使用

例如:
:/min
进行查找

如果不想动手,可以直接粘贴我的:



    
  0.0 0.0 0.0 0.0 0.0 0.0

    

    

      
        -0.064 0 0.048 0 0 0
        
          4.2111447e-02
          0
          0
          4.2111447e-02
          0
          7.5254874e-02
        
        1.3729096e+00
      

      
        -0.064 0 0.048 0 0 0
        
          
            0.265 0.265 0.089
          
        
      

      
        -0.064 0 0 0 0 0
        
          
            model://turtlebot3_waffle/meshes/waffle_base.dae
            0.001 0.001 0.001
          
        
      
    

    
      
        true
        200
        
          
            
              
                0.0
                2e-4
              
            
            
              
                0.0
                2e-4
              
            
            
              
                0.0
                2e-4
              
            
          
          
            
              
                0.0
                1.7e-2
              
            
            
              
                0.0
                1.7e-2
              
            
            
              
                0.0
                1.7e-2
              
            
          
        
        
          
            
            ~/out:=imu
          
        
      
    

        
      
        -0.052 0 0.111 0 0 0
        
          0.001
          0.000
          0.000
          0.001
          0.000
          0.001
        
        0.114
      

      
        -0.052 0 0.111 0 0 0
        
          
            0.0508
            0.055
          
        
      

      
        -0.064 0 0.121 0 0 0
        
          
            model://turtlebot3_waffle/meshes/lds.dae
            0.001 0.001 0.001
          
        
      

      
        true
        true
        -0.064 0 0.121 0 0 0
        5
        
          
            
              360
              1.000000
              0.000000
              6.280000
            
          
          
            0.20000
            3.5
            0.015000
          
          
            gaussian
            0.0
            0.01
          
        
        
          
            
            ~/out:=scan
          
          sensor_msgs/LaserScan
          base_scan
        
      
    

    

      
        0.0 0.144 0.023 -1.57 0 0
        
          1.1175580e-05
          -4.2369783e-11
          -5.9381719e-09
          1.1192413e-05
          -1.4400107e-11
          2.0712558e-05
        
        0.1
      

      
        0.0 0.144 0.023 -1.57 0 0
        
          
            0.033
            0.018
          
        
        
          
          
            
              100000.0
              100000.0
              0 0 0
              0.0
              0.0
            
          
          
            
              0
              0.2
              1e+5
              1
              0.01
              0.001
            
          
        
      

      
        0.0 0.144 0.023 0 0 0
        
          
            model://turtlebot3_waffle/meshes/tire.dae
            0.001 0.001 0.001
          
        
      
    

    

      
        0.0 -0.144 0.023 -1.57 0 0
        
          1.1175580e-05
          -4.2369783e-11
          -5.9381719e-09
          1.1192413e-05
          -1.4400107e-11
          2.0712558e-05
        
        0.1
      
    
      
        0.0 -0.144 0.023 -1.57 0 0
        
          
            0.033
            0.018
          
        
        
          
          
            
              100000.0
              100000.0
              0 0 0
              0.0
              0.0
            
          
          
            
              0
              0.2
              1e+5
              1
              0.01
              0.001
            
          
        
      

      
        0.0 -0.144 0.023 0 0 0
        
          
            model://turtlebot3_waffle/meshes/tire.dae
            0.001 0.001 0.001
          
        
      
    

    
      -0.177 -0.064 -0.004 -1.57 0 0
      
        0.001
        
          0.00001
          0.000
          0.000
          0.00001
          0.000
          0.00001
        
      
      
        
          
            0.005000
          
        
        
          
            
              0
              0.2
              1e+5
              1
              0.01
              0.001
            
          
        
      
    

    
      -0.177 0.064 -0.004 -1.57 0 0
      
        0.001
        
          0.00001
          0.000
          0.000
          0.00001
          0.000
          0.00001
        
      
      
        
          
            0.005000
          
        
        
          
            
              0
              0.2
              1e+5
              1
              0.01
              0.001
            
          
        
      
    

    
    
    
      
        0.069 -0.047 0.107 0 0 0
        
          0.001
          0.000
          0.000
          0.001
          0.000
          0.001
        
        0.035
      

      0.069 -0.047 0.107 0 0 0
      
        true
        true
        30
        
          1.02974
          
            640
            480
            R8G8B8
          
          
            0.02
            300
          
          
            gaussian
            
            0.0
            0.007
          
        
          
            
              
              
              
            
            
            
            
          
      
        

    
      base_footprint
      base_link
      0.0 0.0 0.010 0 0 0
    

    
      base_link
      wheel_left_link
      0.0 0.144 0.023 -1.57 0 0
      
        0 0 1
      
    

    
      base_link
      wheel_right_link
      0.0 -0.144 0.023 -1.57 0 0
      
        0 0 1
      
    

    
      base_link
      caster_back_right_link
    

    
      base_link
      caster_back_left_link
    

    
      base_link
      imu_link
      -0.032 0 0.068 0 0 0
      
        0 0 1
      
        

    
      base_link
      base_scan
      -0.064 0 0.121 0 0 0
      
        0 0 1
      
    

    
      base_link
      camera_link
      0.064 -0.065 0.094 0 0 0
      
        0 0 1
      
    

    
      camera_rgb_frame
      camera_rgb_optical_frame
      0 0 0 -1.57079632679 0 -1.57079632679
      
        0 0 1
      
     
            
    
      camera_link
      camera_rgb_frame
      0.005 0.018 0.013 0 0 0
      
        0 0 1
      
    

    

      
        
      

      30

      
      wheel_left_joint
      wheel_right_joint

      
      0.287
      0.066

      
      20
      1.0

      cmd_vel

      
      true
      true
      false

      odom
      odom
      base_footprint

    

    
      
        
        ~/out:=joint_states
      
      30
      wheel_left_joint
      wheel_right_joint
        

  

三、启动

ros2 launch rtabmap_demos turtlebot3_rgbd.launch.py 

[ROS2系列] ubuntu 20.04测试rtabmap 3D建图(二)_第1张图片

#启动导航
ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True
ros2 launch nav2_bringup rviz_launch.py

但是唯一不幸的是rviz一直崩掉!

你可能感兴趣的:(ROS,ubuntu,linux,slam)