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

mavros failed to convert rostopic to mavlink #2012

Closed
YifeiNie opened this issue Dec 19, 2024 · 3 comments
Closed

mavros failed to convert rostopic to mavlink #2012

YifeiNie opened this issue Dec 19, 2024 · 3 comments

Comments

@YifeiNie
Copy link

YifeiNie commented Dec 19, 2024

This is only bug and feature tracker, please use it
to report bugs or request features.


Issue details

\for ROS1 noetic, FCU to mavros is of which is shown in rostopic echo /mavlink/from, and I can also echo topics like IMU data. THen I published some topics like mavros/setpoint_raw/attitude and tried to send command to FCU, this topic can also seen by rostopic echo and is correct. But rostopic echo /mavlink/to has no data, which means no data from mavros to FCU
What's strange is the same option in ROS2 jazzy, all things are ok

Masters please help me

MAVROS version and platform

Mavros: ?0.18.4?
ROS: noetic
Ubuntu: 20.04

Autopilot type and version

[ ] ArduPilot
[ ] PX4

Version: ?3.7.1?

Node logs

copy output of mavros_node. Usually console where you run roslaunch

Diagnostics


header: 
  seq: 14
  stamp: 
    secs: 1734649897
    nsecs: 558108748
  frame_id: ''
status: 
  - 
    level: 1
    name: "mavros: FCU connection"
    message: "not connected"
    hardware_id: "/dev/ttyUSB0:2000000"
    values: 
      - 
        key: "Received packets:"
        value: "4050"
      - 
        key: "Dropped packets:"
        value: "0"
      - 
        key: "Buffer overruns:"
        value: "0"
      - 
        key: "Parse errors:"
        value: "0"
      - 
        key: "Rx sequence number:"
        value: "214"
      - 
        key: "Tx sequence number:"
        value: "0"
      - 
        key: "Rx total bytes:"
        value: "152523"
      - 
        key: "Tx total bytes:"
        value: "56278"
      - 
        key: "Rx speed:"
        value: "20899.000000"
      - 
        key: "Tx speed:"
        value: "8110.000000"
  - 
    level: 2
    name: "mavros: GPS"
    message: "No satellites"
    hardware_id: "/dev/ttyUSB0:2000000"
    values: 
      - 
        key: "Satellites visible"
        value: "0"
      - 
        key: "Fix type"
        value: "0"
      - 
        key: "EPH (m)"
        value: "Unknown"
      - 
        key: "EPV (m)"
        value: "Unknown"
  - 
    level: 1
    name: "mavros: Mount"
    message: "Can not diagnose in this targeting mode"
    hardware_id: "/dev/ttyUSB0:2000000"
    values: 
      - 
        key: "Mode"
        value: "255"
  - 
    level: 2
    name: "mavros: Heartbeat"
    message: "No events recorded."
    hardware_id: "/dev/ttyUSB0:2000000"
    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: "mavros: System"
    message: "Normal"
    hardware_id: "/dev/ttyUSB0:2000000"
    values: 
      - 
        key: "Sensor present"
        value: "0x00000000"
      - 
        key: "Sensor enabled"
        value: "0x00000000"
      - 
        key: "Sensor health"
        value: "0x00000000"
      - 
        key: "CPU Load (%)"
        value: "0.0"
      - 
        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: 2
    name: "mavros: Battery"
    message: "No data"
    hardware_id: "/dev/ttyUSB0:2000000"
    values: 
      - 
        key: "Voltage"
        value: "-1.00"
      - 
        key: "Current"
        value: "0.0"
      - 
        key: "Remaining"
        value: "0.0"
  - 
    level: 2
    name: "mavros: Time Sync"
    message: "No events recorded."
    hardware_id: "/dev/ttyUSB0:2000000"
    values: 
      - 
        key: "Timesyncs since startup"
        value: "0"
      - 
        key: "Frequency (Hz)"
        value: "0.000000"
      - 
        key: "Last RTT (ms)"
        value: "0.000000"
      - 
        key: "Mean RTT (ms)"
        value: "0.000000"
      - 
        key: "Last remote time (s)"
        value: "0.000000000"
      - 
        key: "Estimated time offset (s)"
        value: "0.000000000"

place here result of:
rostopic echo -n1 /diagnostics


### Check ID

rosrun mavros checkid

@vooon
Copy link
Member

vooon commented Dec 20, 2024

ROS1 and ROS2 has quite different communication layer. In ROS2 there a Router, which expose topics for UAS (to/from), and a UAS (with bunch of the plugins), which talks to the Router.

ROS1 do not have router, and UAS talks directly to MAVConn, so you do not have access to the bus. To/from may only be used by external gcs bridge (from extras), or if you need direct mavlink communication to the FCU.

@YifeiNie
Copy link
Author

YifeiNie commented Dec 20, 2024

ROS1 and ROS2 has quite different communication layer. In ROS2 there a Router, which expose topics for UAS (to/from), and a UAS (with bunch of the plugins), which talks to the Router.

ROS1 do not have router, and UAS talks directly to MAVConn, so you do not have access to the bus. To/from may only be used by external gcs bridge (from extras), or if you need direct mavlink communication to the FCU.

@vooon tks for quick reply!
As you said, the process mavros (ros1) converts rostopic to mavlink will not shown in rostopic echo /mavlink/to although it is working.
But my FCU can not receive data from mavros in ros1, but my FCU can do so in ros2 with the same px4.launch file
So could you please tell me the differences between mavros for ros1 and ros2 in mavlink data transmitting. How can I fix this?
Thank you so much!

@YifeiNie
Copy link
Author

ROS1 and ROS2 has quite different communication layer. In ROS2 there a Router, which expose topics for UAS (to/from), and a UAS (with bunch of the plugins), which talks to the Router.
ROS1 do not have router, and UAS talks directly to MAVConn, so you do not have access to the bus. To/from may only be used by external gcs bridge (from extras), or if you need direct mavlink communication to the FCU.

@vooon tks for quick reply! As you said, the process mavros (ros1) converts rostopic to mavlink will not shown in rostopic echo /mavlink/to although it is working. But my FCU can not receive data from mavros in ros1, but my FCU can do so in ros2 with the same px4.launch file So could you please tell me the differences between mavros for ros1 and ros2 in mavlink data transmitting. How can I fix this? Thank you so much!

This question solved without any changes, maybe I fegot to save my operations and led to this problem.
Anyway, thanks in advance

@vooon vooon closed this as completed Jan 2, 2025
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

2 participants