9 Replies Latest reply on Apr 19, 2017 5:07 PM by PolarBear

    Running mavros on Compute Board

    Vlad.U

      Hi all,

       

      I'm trying to run mavros on the Compute Board.

       

      I first stop the mavlink_router as described here: Functionality · intel-aero/meta-intel-aero Wiki · GitHub

      Then, I start ROS as described here: Meta ROS · intel-aero/meta-intel-aero Wiki · GitHub  and launch mavros using the same serial port and baudrate as mavlink_router, but it results in an error:

       

      root@intel-aero:~# roslaunch mavros px4.launch fcu_url:=/dev/ttyS1:1500000

      ... logging to /home/root/.ros/log/d0a35a8e-f29f-11e6-aa91-12971cf99bff/roslaunch-intel-aero-792.log

      Checking log directory for disk usage. This may take awhile.

      Press Ctrl-C to interrupt

      Done checking log file disk usage. Usage is <1GB.

       

      started roslaunch server http://localhost:39534/

       

      SUMMARY

      ========

       

      CLEAR PARAMETERS

      * /mavros/

       

      PARAMETERS

      * /mavros/cmd/use_comp_id_system_control: False

      * /mavros/conn/heartbeat_rate: 1.0

      * /mavros/conn/system_time_rate: 1.0

      * /mavros/conn/timeout: 10.0

      * /mavros/conn/timesync_rate: 10.0

      * /mavros/distance_sensor/hrlv_ez4_pub/field_of_view: 0.0

      * /mavros/distance_sensor/hrlv_ez4_pub/frame_id: hrlv_ez4_sonar

      * /mavros/distance_sensor/hrlv_ez4_pub/id: 0

      * /mavros/distance_sensor/hrlv_ez4_pub/orientation: ROLL_180

      * /mavros/distance_sensor/hrlv_ez4_pub/send_tf: True

      * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/x: 0.0

      * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/y: 0.0

      * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/z: -0.1

      * /mavros/distance_sensor/laser_1_sub/id: 3

      * /mavros/distance_sensor/laser_1_sub/orientation: ROLL_180

      * /mavros/distance_sensor/laser_1_sub/subscriber: True

      * /mavros/distance_sensor/lidarlite_pub/field_of_view: 0.0

      * /mavros/distance_sensor/lidarlite_pub/frame_id: lidarlite_laser

      * /mavros/distance_sensor/lidarlite_pub/id: 1

      * /mavros/distance_sensor/lidarlite_pub/orientation: ROLL_180

      * /mavros/distance_sensor/lidarlite_pub/send_tf: True

      * /mavros/distance_sensor/lidarlite_pub/sensor_position/x: 0.0

      * /mavros/distance_sensor/lidarlite_pub/sensor_position/y: 0.0

      * /mavros/distance_sensor/lidarlite_pub/sensor_position/z: -0.1

      * /mavros/distance_sensor/sonar_1_sub/id: 2

      * /mavros/distance_sensor/sonar_1_sub/orientation: ROLL_180

      * /mavros/distance_sensor/sonar_1_sub/subscriber: True

      * /mavros/fcu_url: /dev/ttyS1:1500000

      * /mavros/gcs_url:

      * /mavros/global_position/frame_id: fcu

      * /mavros/global_position/rot_covariance: 99999.0

      * /mavros/global_position/tf/child_frame_id: fcu_utm

      * /mavros/global_position/tf/frame_id: local_origin

      * /mavros/global_position/tf/send: False

      * /mavros/image/frame_id: px4flow

      * /mavros/imu/angular_velocity_stdev: 0.000349065850399

      * /mavros/imu/frame_id: fcu

      * /mavros/imu/linear_acceleration_stdev: 0.0003

      * /mavros/imu/magnetic_stdev: 0.0

      * /mavros/imu/orientation_stdev: 1.0

      * /mavros/local_position/frame_id: fcu

      * /mavros/local_position/tf/child_frame_id: fcu

      * /mavros/local_position/tf/frame_id: local_origin

      * /mavros/local_position/tf/send: False

      * /mavros/local_position/tf/send_fcu: False

      * /mavros/mission/pull_after_gcs: True

      * /mavros/mocap/use_pose: True

      * /mavros/mocap/use_tf: False

      * /mavros/plugin_blacklist: ['safety_area', '...

      * /mavros/plugin_whitelist: []

      * /mavros/px4flow/frame_id: px4flow

      * /mavros/px4flow/ranger_fov: 0.0

      * /mavros/px4flow/ranger_max_range: 5.0

      * /mavros/px4flow/ranger_min_range: 0.3

      * /mavros/safety_area/p1/x: 1.0

      * /mavros/safety_area/p1/y: 1.0

      * /mavros/safety_area/p1/z: 1.0

      * /mavros/safety_area/p2/x: -1.0

      * /mavros/safety_area/p2/y: -1.0

      * /mavros/safety_area/p2/z: -1.0

      * /mavros/setpoint_accel/send_force: False

      * /mavros/setpoint_attitude/reverse_throttle: False

      * /mavros/setpoint_attitude/tf/child_frame_id: attitude

      * /mavros/setpoint_attitude/tf/frame_id: local_origin

      * /mavros/setpoint_attitude/tf/listen: False

      * /mavros/setpoint_attitude/tf/rate_limit: 10.0

      * /mavros/setpoint_position/tf/child_frame_id: setpoint

      * /mavros/setpoint_position/tf/frame_id: local_origin

      * /mavros/setpoint_position/tf/listen: False

      * /mavros/setpoint_position/tf/rate_limit: 50.0

      * /mavros/startup_px4_usb_quirk: True

      * /mavros/sys/disable_diag: False

      * /mavros/sys/min_voltage: 10.0

      * /mavros/target_component_id: 1

      * /mavros/target_system_id: 1

      * /mavros/tdr_radio/low_rssi: 40

      * /mavros/time/time_ref_source: fcu

      * /mavros/time/timesync_avg_alpha: 0.6

      * /mavros/vibration/frame_id: vibration

      * /mavros/vision_pose/tf/child_frame_id: vision

      * /mavros/vision_pose/tf/frame_id: local_origin

      * /mavros/vision_pose/tf/listen: False

      * /mavros/vision_pose/tf/rate_limit: 10.0

      * /mavros/vision_speed/listen_twist: False

      * /rosdistro: indigo

      * /rosversion: 1.11.20

       

      NODES

        /

          mavros (mavros/mavros_node)

       

      auto-starting new master

      process[master]: started with pid [803]

      ROS_MASTER_URI=http://localhost:11311/

       

      setting /run_id to d0a35a8e-f29f-11e6-aa91-12971cf99bff

      process[rosout-1]: started with pid [816]

      started core service [/rosout]

      process[mavros-2]: started with pid [834]

      [ INFO] [1487067891.633051534]: FCU URL: /dev/ttyS1:1500000

      [ INFO] [1487067891.633500073]: serial0: device: /dev/ttyS1 @ 1500000 bps

      [FATAL] [1487067891.635448337]: FCU: DeviceError:serial:set_option: Invalid argument

      ================================================================================REQUIRED process [mavros-2] has died!

      process has finished cleanly

      log file: /home/root/.ros/log/d0a35a8e-f29f-11e6-aa91-12971cf99bff/mavros-2*.log

      Initiating shutdown!

      ================================================================================

      [mavros-2] killing on exit

      [rosout-1] killing on exit

      [master] killing on exit

      shutting down processing monitor...

      ... shutting down processing monitor complete

       

       

      Do you know how to fix this issue, or is there another way to run mavros on the Compute Board.

       

      Best,

      Vlad

        • 1. Re: Running mavros on Compute Board
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi Vlad,

          Thank you for contacting us. We’ll try to help you resolve this issue. First, I think it’s important to know all the previous configuration steps you took in order to try to configure mavros. In the page you mentioned, there’s a section that lists the environmental variables needed for ROS functionality. Do you have all those variables in /opt/ros/indogo/setup.sh.? After this part, the guide states that the ROS service can be started with “roscore &” What’s the result of doing this?

          Also, have you updated the FPGA firmware as shown here https://github.com/intel-aero/meta-intel-aero/wiki/Quickstart-Guide#connect-compute-board-to-external-flight-controller .

          We’ll be waiting for your results.

          -Sergio
           

          • 2. Re: Running mavros on Compute Board
            Vlad.U

            Hi Sergio,

             

            I've updated the OS, Bios, FPGA and PX4 to the latest version. Here is the output of get_aero_version:

             

            root@intel-aero:~# get_aero_version.py

             

             

            BIOS_VERSION = Aero-01.00.12_Prod

            OS_VERSION = v01.00.04

            AIRMAP_VERSION = 1.8

            FPGA_VERSION = 0xff 0xff

             

            I also set up ROS variables, and it seems to work fine:

             

            root@intel-aero:~# cat /opt/ros/indigo/setup.bash

            export ROS_ROOT=/opt/ros/indigo 

            export ROS_PACKAGE_PATH=$ROS_ROOT/share 

            export ROS_MASTER_URI=http://localhost:11311/ 

            export LD_LIBRARY_PATH=$ROS_ROOT/lib:$LD_LIBRARY_PATH  

            export PATH=$ROS_ROOT/bin:$PATH 

            export ROS_DISTRO=indigo 

            export PYTHONPATH=$ROS_ROOT/lib/python2.7/site-packages:$PYTHONPATH 

            export ROS_HOSTNAME=localhost 

            export CMAKE_PREFIX_PATH=$ROS_ROOT  

            export ROS_ETC_DIR=$ROS_ROOT/etc/ros    

            touch $ROS_ROOT/.catkin

             

            I can start roscore without any issues. I don't think the problem is ROS related. The error in the post above indicates that mavros cannot connect to the serial port of the controller, but when mavlink_router is running using the same port and baudrate I'm able to connect to it with qgroundcontol from another PC.

             

            Best,

            Vlad

            • 3. Re: Running mavros on Compute Board
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi Vlad,

              Thank you for your response. We’ve not experienced this before, we’ll do some research to see if we can find the cause of your error. We’ll contact you as soon as we have more information.

              Regards,
              -Sergio A
               

              • 4. Re: Running mavros on Compute Board
                pstrong

                /dev/ttyS1:1500000?

                 

                Try a baudrate of 921600. Works on my end.

                 

                Best,

                pstrong

                • 5. Re: Running mavros on Compute Board
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hi Vlad,

                  Thank you for your patience. After investigating on your case, it looks like mavros does not support high speed UART rates (>1Mbps). We’d suggest you to try a lower rate that’s a multiple of 115200 until 912k. The corresponding baudrate change needs to be done on the flight controller side as well, this can be changed here: https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d/4070_aerofc

                  Let us know if this works for you. We’ll be waiting for your response.

                  -Sergio A
                   

                  • 6. Re: Running mavros on Compute Board
                    marlo3_14

                    Hi,

                    I'm having a similar problem. I can run roslaunch mavros px4.launch fcu_url:=/dev/ttyS1:921600 but if I open another terminal and try to echo one of the topic I can find using rostopic list I get no answer, like if noone is publishing... Any Idea on how to solve the issue?

                     

                    Thanks.

                    • 7. Re: Running mavros on Compute Board
                      Intel Corporation
                      This message was posted on behalf of Intel Corporation

                      Hi marlo3_14,

                      Would you try to once again, but using a different baud rate. As stated above, you can use baud rates in multiples of 115200 until 912000? Let us know your results. If you’re unsuccessful, please send us a screenshot of the output you receive when using the echo calls.

                      We’ll be waiting for your response.

                      -Sergio A
                       

                      • 8. Re: Running mavros on Compute Board
                        mbelluzzo

                        I followed the exactly same steps from OP and it worked on my drone.

                         

                        Maybe the key point is that instructions of Meta ROS · intel-aero/meta-intel-aero Wiki · GitHub states that you should use:

                         

                        roslaunch mavros px4.launch fcu_url:=udp://@:14556

                         

                        and not to tap directly on the serial bus. Could you try this instead and see if works for you as well?

                         

                        Cheers!

                        • 9. Re: Running mavros on Compute Board
                          PolarBear

                          Hi,

                           

                          I've been looking into this issue for days and I found out that in order to let mavros grab data from Mavlink_router, the command should instead be:

                           

                          roslaunch mavros px4.launch fcu_url:=udp://:14550@

                           

                          which corresponds to binding all interfaces on 14550 including the one being broadcasted by Mavlink_router.

                           

                          My OS version is 01.00.04

                           

                          -XS