Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAV_SYS_ID is only working if 1. #872

Closed
AlexisTM opened this issue Nov 24, 2017 · 10 comments
Closed

MAV_SYS_ID is only working if 1. #872

AlexisTM opened this issue Nov 24, 2017 · 10 comments

Comments

@AlexisTM
Copy link
Contributor

AlexisTM commented Nov 24, 2017

Issue details

  • If MAV_SYS_ID and tgt_system = 1: Everything works
  • If MAV_SYS_ID and tgt_system = 82: Data flows yet the state stays not connected.
  • Data flows means I receive data on topics /mavros/local_position/local or the imu
  • State stays not connected means the topic /mavros/state reports connected: False

MAVROS version and platform

Mavros: 0.21.3
ROS: Kinetic
Ubuntu: 16.04

Autopilot type and version

[x] PX4

Version: 1.6.5

Launch file

For MAV_SYS_ID=82, tgt_system has been tested with 1, 82 and 0. All with same behaviour.

<launch>
    <arg name="ROBOT_FULL_NAME" default="$(optenv ROBOT_FULL_NAME odroid00)" />

    <!-- vim: set ft=xml noet : -->
    <!-- base node launch file-->
    <arg name="fcu_url" default="/dev/ttyUSB0:921600" />
    <!--default="udp://@192.168.1.42" -->
    <arg name="gcs_url" default="" />
    <arg name="tgt_system" default="1" />
    <arg name="tgt_component" default="1" />
    <arg name="pluginlists_yaml" default="px4_pluginlists.yaml" />
    <arg name="config_yaml" default="px4_config.yaml" />
    <arg name="log_output" default="screen" />

    <node pkg="mavros" type="mavros_node" name="$(arg ROBOT_FULL_NAME)" required="true" output="$(arg log_output)">
        <param name="fcu_url" value="$(arg fcu_url)" />
        <param name="gcs_url" value="$(arg gcs_url)" />
        <param name="fcu_protocol" value="v2.0" />
        <param name="target_system_id" value="$(arg tgt_system)" />
        <param name="target_component_id" value="$(arg tgt_component)" />
        <!-- load blacklist, config -->
        <rosparam command="load" file="$(find ...)/cfg/$(arg pluginlists_yaml)" />
        <rosparam command="load" file="$(find ...)/cfg/$(arg config_yaml)" />
        <remap from="/tf" to="/$(arg ROBOT_FULL_NAME)/tf" />
        <remap from="/tf_static" to="/$(arg ROBOT_FULL_NAME)/tf_static" />
        <remap from="/mavlink/to" to="/$(arg ROBOT_FULL_NAME)/mavlink/to" />
        <remap from="/mavlink/from" to="/$(arg ROBOT_FULL_NAME)/mavlink/from" />
    </node>
</launch>

Diagnostics

rostopic echo -n1 /diagnostics

header: 
  seq: 59
  stamp: 
    secs: 1455208301
    nsecs: 681187693
  frame_id: ''
status: 
  - 
    level: 1
    name: odroid82: FCU connection
    message: not connected
    hardware_id: /dev/ttyUSB0:921600
    values: 
      - 
        key: Received packets:
        value: 52862
      - 
        key: Dropped packets:
        value: 0
      - 
        key: Buffer overruns:
        value: 0
      - 
        key: Parse errors:
        value: 0
      - 
        key: Rx sequence number:
        value: 222
      - 
        key: Tx sequence number:
        value: 10
      - 
        key: Rx total bytes:
        value: 2261764
      - 
        key: Tx total bytes:
        value: 40108
      - 
        key: Rx speed:
        value: 23808.000000
      - 
        key: Tx speed:
        value: 570.000000
  - 
    level: 0
    name: odroid82: GPS
    message: 3D fix
    hardware_id: /dev/ttyUSB0:921600
    values: 
      - 
        key: Satellites visible
        value: 9
      - 
        key: Fix type
        value: 3
      - 
        key: EPH (m)
        value: 1.02
      - 
        key: EPV (m)
        value: 2.07
  - 
    level: 2
    name: odroid82: Heartbeat
    message: No events recorded.
    hardware_id: /dev/ttyUSB0:921600
    values: 
      - 
        key: Heartbeats since startup
        value: 0
      - 
        key: Frequency (Hz)
        value: 0.000000
      - 
        key: Vehicle type
        value: Generic micro air vehicle
      - 
        key: Autopilot type
        value: Generic autopilot
      - 
        key: Mode
        value: ''
      - 
        key: System status
        value: Uninit
  - 
    level: 0
    name: odroid82: System
    message: Normal
    hardware_id: /dev/ttyUSB0:921600
    values: 
      - 
        key: Sensor present
        value: 0x00000000
      - 
        key: Sensor enabled
        value: 0x00000000
      - 
        key: Sensor helth
        value: 0x00000000
      - 
        key: CPU Load (%)
        value: 61.9
      - 
        key: Drop rate (%)
        value: 0.0
      - 
        key: Errors comm
        value: 0
      - 
        key: Errors count #1
        value: 0
      - 
        key: Errors count #2
        value: 0
      - 
        key: Errors count #3
        value: 0
      - 
        key: Errors count #4
        value: 0
  - 
    level: 0
    name: odroid82: Battery
    message: Normal
    hardware_id: /dev/ttyUSB0:921600
    values: 
      - 
        key: Voltage
        value: 24.38
      - 
        key: Current
        value: 0.0
      - 
        key: Remaining
        value: 88.0
  - 
    level: 0
    name: odroid82: Time Sync
    message: Normal
    hardware_id: /dev/ttyUSB0:921600
    values: 
      - 
        key: Timesyncs since startup
        value: 91
      - 
        key: Frequency (Hz)
        value: 9.791079
      - 
        key: Last dt (ms)
        value: -4.602662
      - 
        key: Mean dt (ms)
        value: -0.096830
      - 
        key: Last system time (s)
        value: 237.806095000
      - 
        key: Time offset (s)
        value: 1455208063.785467863
---

Check ID

rosrun mavros checkid

ERROR. I got 0 addresses, but not your target 0:1

---
Received 0 messages, from 0 addresses
sys:comp   list of messages
@vooon
Copy link
Member

vooon commented Nov 25, 2017

SYS ID should be > 0, because 0 means broadcast.
Please post dump of checkid when you setup sys-id=82.
Also post node logs (we do not need full log, only lines after plugins loaded).

@AlexisTM
Copy link
Contributor Author

@vooon The dump in the post is when the MAV_SYS_ID on the Pixhawk is 82.

@vooon
Copy link
Member

vooon commented Nov 25, 2017

Nope, checkid ids=0:1 ⇒ system 0.

@AlexisTM
Copy link
Contributor Author

AlexisTM commented Nov 25, 2017

Then that should be the problem; I can assure you that I never tried the ID 0 on MAV_SYS_ID, but I did try target_system to 0 to try to contact it.

I'll try again ASAP, yet it can only be after the 5th of December :/

@TSC21
Copy link
Member

TSC21 commented Dec 23, 2017

@AlexisTM any updates?

@AlexisTM
Copy link
Contributor Author

I did not retry yet as lot of company stuff happened in between. I will retry at the same time as the 1.7.x firmware test after my holidays (3rd of December) ;)

@ArkadiuszNiemiec
Copy link

I have exactly same problem: fresh install of PX4 1.7.3 stable version, default parameters and everything works. Chaining mav_sys_id to 86 makes state topic shows only one message with disconnected status. Any update on this subject? If no then I will try to find the bug.

@AlexisTM
Copy link
Contributor Author

AlexisTM commented Apr 4, 2018

@Ekci I am using mav_sys_id to 1 for all the copters and never use multiple data stream at the same time. :/ I did not tested it again since then.

@ArkadiuszNiemiec
Copy link

ArkadiuszNiemiec commented Apr 4, 2018

Ok, I have found out that chaning the tgt_system argument in px4.launch or node.launch to correct value. It doesn't look right, with wrong argument it works but not fully, is there a reason to require it? I have to dig in.

@AlexisTM
Copy link
Contributor Author

I am closing this as it is very likely outdated (and I am not in possession of a copter for testing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants