Nothing published to mavros topics

I am working with the new Navio2 Raspbian image that was just released (the one that works with the Raspberry Pi 3 Model B+). Right now I am trying to echo mavros topics to see what info I am getting… however, it seems that nothing is being published to any of the mavros topics. Here’s what I did:

  1. tmux
  2. Opened three new terminals using tmux
  3. roscore. Then switched to a new terminal
  4. sudo nano /etc/default/arduplane
  5. Commented out the line that says TELEM1="-A udp:". The reason I commented this out is because I did not want to worry about telemetry settings for now, as my goal is to just look into mavros topics.
  6. Saved the file.
  7. sudo systemctl start arduplane
  8. After running the above command. the LED on the Navio starts blinking a yellow color.
  9. Copied the apm.launch file from /opt/ros/kinetic/share/mavros/launch to /home/pi.
  10. Went to /home/pi
  11. sudo nano apm.launch
  12. Changed the line that says <arg name="fcu_url" default="/dev/ttyACM0:57600" /> to <arg name="fcu_url" default="udp://@" />. The reason I did this was because I did not care about any FCU settings (in fact, I don’t even know what FCU is… interestingly enough doing a Google search doesn’t tell me anything about FCU stands for).
  13. Saved the file.
  14. roslaunch apm.launch. Then switched to a new terminal.
  15. Did rostopic list -v to see what topics were available for me to echo.
  16. I echoed various topics that had /mavros in their names like /mavros/imu/data_raw and /mavros/time_reference. I did this by doing rostopic echo /mavros/imu/data_raw and rostopic echo /mavros/time_reference. The reason I chose these topics was because I thought that they wouldn’t be dependent on any connection with an RC or transmitter or anything like that.
  17. I wait for a minute or so. Nothing happens.

So I’m not sure if the lack of published data is due to me not setting an FCU URL… if that’s the issue, well… then that’s stupid. I also do not know if the blinking yellow light has to do with anything. My guess is that it’s indicated some kind of issue and that it’s supposed to be blinking green.

Did you set stream rate with rosservice call /mavros/set_stream_rate 0 10 1?
You need to type this If you don’t use GCS, but want to get data from rostopic.

Oh, I forgot to do that originally.

However, after doing rosservice call /mavros/set_stream_rate 0 10 1 (which I did after launching the launch file through roslaunch), I tried echoing some mavros topics again… and they still show nothing.

I’ve just tested it on the new image and everything works as expected. Please, try to uncomment TELEM1 line in your arduplane settings and double-check the ports. Also I’d start with just

rosrun mavros mavros_node \

instead of creating .launch files. 14650 is the port which should be the same as port in /etc/default/arduplane file.

Well, I already commented out the TELEM1 line originally (as mentioned in step 5 in my original post above).

So now I tried what you said and ran

rosrun mavros mavros_node \

Then I did rosservice call /mavros/set_stream_rate 0 10 1. Then I tried rostopic echo /mavros/imu/data to see if I see anything. However, as before, I see no published data.

Could you share with me your /etc/default/arduplane?

This is what the top of the file looks like. Everything else is just a bunch of comments and the HELP ASCII art.

# Default settings for ArduPilot for Linux.
# The file is sourced by systemd from arducopter.service
#TELEM1="-A udp:"
#TELEM2="-C /dev/ttyAMA0"

# Options to pass to ArduPilot

I think you misunderstood me a little bit. You should uncomment line with TELEM1 rather than commenting it out in order to make Ardupilot send telemetry there. Then restart Ardupilot and try to type this:

rosrun mavros mavros_node \

Oh, I misread your post. Anyway, this time I uncommented the TELEM1 line, then ran roscore and then

rosrun mavros mavros_node \

And then I ran rosservice call /mavros/set_stream_rate 0 10 1. Then I did rostopic echo /mavros/imu/data. Still nothing shows up.

Did you restart Ardupilot after applying changes?

Yeah, I tried restarting Ardupilot. I also tried restarting the Raspberry Pi, unplugging and replugging in the ethernet cable, and unplugging and replugging in the external GPS module that I have connected. Nothing seems to work. What exactly are the full requirements for mavros to publish topics? Maybe I might have missed something? Does the yellow blinking light that my Navio is showing have to do with any of these problems?

Try to edit /etc/default/arduplane and substitute there default ardupilot port 14550 with 14660 - TELEM1="-A udp:". Then restart arduplane, start roscore. Run mavros: rosrun mavros mavros_node _fcu_url:=udp://:14650@ . Set stream rate: rosservice call /mavros/set_stream_rate 0 10 1. If you’re still unable to get data from topics, please provide me with the output of sudo emlidtool test.

1 Like

Okay, great, that actually got things working! Just curious… what exactly is the significance of the 14660 number?

1 Like

This is just another port that should be free.

Oh, I see. For future reference, what are all the available ports that I can use (in case for some reason something goes wrong and I have to use another port)?

Usually ports from 0-65535 are available, and ports in range 0-1023 are the privileged ones: an application needs to be run as root in order to listen to these ports. You can check all the tcp and udp ports in use with something like this: netstat -antu.
Also there is a table with some well-known ports and protocols that use them.

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.