1. 程式人生 > 實用技巧 >瓜大無人船踩坑記2

瓜大無人船踩坑記2

  1. 裝置準備

    • 手柄
    • 電池(2塊)
    • 電臺及天線
    • 電臺電池(12V)
    • 網線1根
    • 計算機
  2. 設定計算機網路

    • 靜態ip地址

    • 網段:192.168.0.x

      已佔用的地址:

      192.168.0.57  usv3-laptop
      192.168.0.205 hans-linuxpc
      
    • 工控機密碼123

  3. 設定工控機網路

    • 靜態ip地址,無需改動

    • 連線鍵盤滑鼠,使用

      sudo gedit /etc/hosts
      

      在其中新增你的pc:

      192.168.0.x  xxxxxx
      
  4. 遠端連線伺服器

    • ping測試

      # usv3
      # you can also ping usv3-laptop
      ping 192.168.0.57
      # inet(usv)
      ping 192.168.0.11
      # inet(land)
      ping 192.168.0.26
      
    • 遠端登入

      ssh usv3@usv3-laptop
      
  5. 編譯

    cd ~/dev/catkin_ws_serial_03
    catkin_make
    
  6. 推進器連線電源,並開啟開關

  7. 依次連線SBG、GPS、推進器

    賦許可權:

    dmesg | grep tty
    

    看一下是不是3個,然後:

    sudo chmod a+rw /dev/ttyUSB0
    sudo chmod a+rw /dev/ttyUSB1
    sudo chmod a+rw /dev/ttyUSB2
    
  8. 執行ros命令

    記得每次都需要遠端連線,並

    cd ~/dev/catkin_ws_serial_03
    source devel/setup.bash
    

    隨後:

    roscore
    

    執行:

    roslaunch launch_files npu_asv_sensor.launch
    
    SUMMARY
    ========
    
    CLEAR PARAMETERS
     * /ekf_se_ship3/
    
    PARAMETERS
     * /ekf_se_ship3/acceleration_gains: [0.8, 0.0, 0.0, 0...
     * /ekf_se_ship3/acceleration_limits: [1.3, 0.0, 0.0, 0...
     * /ekf_se_ship3/base_link_frame: base_link
     * /ekf_se_ship3/control_config: [True, False, Fal...
     * /ekf_se_ship3/control_timeout: 0.2
     * /ekf_se_ship3/debug: False
     * /ekf_se_ship3/debug_out_file: /path/to/debug/fi...
     * /ekf_se_ship3/deceleration_gains: [1.0, 0.0, 0.0, 0...
     * /ekf_se_ship3/deceleration_limits: [1.3, 0.0, 0.0, 0...
     * /ekf_se_ship3/frequency: 30
     * /ekf_se_ship3/imu0: /imu_data1
     * /ekf_se_ship3/imu0_config: [False, False, Fa...
     * /ekf_se_ship3/imu0_differential: False
     * /ekf_se_ship3/imu0_linear_acceleration_rejection_threshold: 0.8
     * /ekf_se_ship3/imu0_nodelay: False
     * /ekf_se_ship3/imu0_pose_rejection_threshold: 0.8
     * /ekf_se_ship3/imu0_queue_size: 5
     * /ekf_se_ship3/imu0_relative: False
     * /ekf_se_ship3/imu0_remove_gravitational_acceleration: False
     * /ekf_se_ship3/imu0_twist_rejection_threshold: 0.8
     * /ekf_se_ship3/initial_estimate_covariance: ['1e-9', 0, 0, 0,...
     * /ekf_se_ship3/map_frame: map
     * /ekf_se_ship3/odom0: /odom
     * /ekf_se_ship3/odom0_config: [True, True, Fals...
     * /ekf_se_ship3/odom0_differential: True
     * /ekf_se_ship3/odom0_nodelay: False
     * /ekf_se_ship3/odom0_pose_rejection_threshold: 5
     * /ekf_se_ship3/odom0_queue_size: 10
     * /ekf_se_ship3/odom0_relative: False
     * /ekf_se_ship3/odom0_twist_rejection_threshold: 1
     * /ekf_se_ship3/odom1: example/odom
     * /ekf_se_ship3/odom1_config: [True, True, Fals...
     * /ekf_se_ship3/odom1_differential: False
     * /ekf_se_ship3/odom1_nodelay: False
     * /ekf_se_ship3/odom1_pose_rejection_threshold: 2
     * /ekf_se_ship3/odom1_queue_size: 10
     * /ekf_se_ship3/odom1_relative: True
     * /ekf_se_ship3/odom1_twist_rejection_threshold: 1
     * /ekf_se_ship3/odom_frame: odom
     * /ekf_se_ship3/pose0: example/pose
     * /ekf_se_ship3/pose0_config: [True, True, Fals...
     * /ekf_se_ship3/pose0_differential: True
     * /ekf_se_ship3/pose0_nodelay: False
     * /ekf_se_ship3/pose0_queue_size: 5
     * /ekf_se_ship3/pose0_rejection_threshold: 2
     * /ekf_se_ship3/pose0_relative: False
     * /ekf_se_ship3/print_diagnostics: True
     * /ekf_se_ship3/process_noise_covariance: [0.05, 0, 0, 0, 0...
     * /ekf_se_ship3/publish_acceleration: False
     * /ekf_se_ship3/publish_tf: False
     * /ekf_se_ship3/sensor_timeout: 1
     * /ekf_se_ship3/stamped_control: False
     * /ekf_se_ship3/transform_time_offset: 0.0
     * /ekf_se_ship3/transform_timeout: 0.0
     * /ekf_se_ship3/twist0: example/twist
     * /ekf_se_ship3/twist0_config: [False, False, Fa...
     * /ekf_se_ship3/twist0_nodelay: False
     * /ekf_se_ship3/twist0_queue_size: 3
     * /ekf_se_ship3/twist0_rejection_threshold: 2
     * /ekf_se_ship3/two_d_mode: True
     * /ekf_se_ship3/use_control: False
     * /ekf_se_ship3/world_frame: odom
     * /nmea_serial_driver_node_ship3/baud: 115200
     * /nmea_serial_driver_node_ship3/frame_id: odom
     * /nmea_serial_driver_node_ship3/port: /dev/ttyUSB2
     * /nmea_serial_driver_node_ship3/time_ref_source: gps
     * /nmea_serial_driver_node_ship3/useRMC: False
     * /rosdistro: kinetic
     * /rosversion: 1.12.14
    
    NODES
      /
        ekf_se_ship3 (robot_localization/ekf_localization_node)
        imudata_sbg_ship3 (tutorial/imudata_sbg.py)
        listener_ship3 (my_serial_node/listener)
        nmea_serial_driver_node_ship3 (nmea_navsat_driver/nmea_serial_driver)
        odom_trans_ship3 (tutorial/odom_trans_npu.py)
        sbg_serial_ship3 (my_serial_node/sbg_serial)
        sonar_listener_ship3 (my_serial_node/sonar_listener)
        sonar_serial_ship3 (my_serial_node/sonar_serial)
        utm_odometry_node_ship3 (gps_common/utm_odometry_node)
    
    ROS_MASTER_URI=http://localhost:11311
    
    process[sbg_serial_ship3-1]: started with pid [10077]
    process[listener_ship3-2]: started with pid [10078]
    process[nmea_serial_driver_node_ship3-3]: started with pid [10088]
    process[sonar_listener_ship3-4]: started with pid [10101]
    process[sonar_serial_ship3-5]: started with pid [10104]
    process[utm_odometry_node_ship3-6]: started with pid [10112]
    process[imudata_sbg_ship3-7]: started with pid [10121]
    process[odom_trans_ship3-8]: started with pid [10127]
    [ERROR] [1606464842.121274597]: Unable to open Sonarport 
    process[ekf_se_ship3-9]: started with pid [10149]
    

    執行:

    roslaunch launch_files npu_asv_actuator.launch
    
    NODES
      /
        talker_ship3 (my_serial_node/talker_ship2u1)
        thrust_serial_ship3 (my_serial_node/thrust_serial)
    
    
    

注意: