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:
tmux
Opened three new terminals using tmux
roscore. Then switched to a new terminal
sudo nano /etc/default/arduplane
Commented out the line that says TELEM1="-A udp:127.0.0.1:14550". 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.
Saved the file.
sudo systemctl start arduplane
After running the above command. the LED on the Navio starts blinking a yellow color.
Copied the apm.launch file from /opt/ros/kinetic/share/mavros/launch to /home/pi.
Went to /home/pi
sudo nano apm.launch
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).
Saved the file.
roslaunch apm.launch. Then switched to a new terminal.
Did rostopic list -v to see what topics were available for me to echo.
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.
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.
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
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.
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:127.0.0.1:14550"
#TELEM2="-C /dev/ttyAMA0"
# Options to pass to ArduPilot
ARDUPILOT_OPTS="$TELEM1 $TELEM2"
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:
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:127.0.0.1:14650". 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.
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.