<launch>
	<!-- vim: set ft=xml noet : -->
	<!-- example launch script for ArduPilot based FCU's -->

	<arg name="fcu_url" default="/dev/ttyACM0:57600" />
	<arg name="gcs_url" default="" />
	<arg name="tgt_system" default="1" />
	<arg name="tgt_component" default="1" />
	<arg name="log_output" default="screen" />
	<arg name="fcu_protocol" default="v2.0" />
	<arg name="respawn_mavros" default="false" />

	<include file="$(find mavros)/launch/node.launch">
		<arg name="pluginlists_yaml" value="$(find mavros)/launch/apm_pluginlists.yaml" />
		<arg name="config_yaml" value="$(find mavros)/launch/apm_config.yaml" />

		<arg name="fcu_url" value="$(arg fcu_url)" />
		<arg name="gcs_url" value="$(arg gcs_url)" />
		<arg name="tgt_system" value="$(arg tgt_system)" />
		<arg name="tgt_component" value="$(arg tgt_component)" />
		<arg name="log_output" value="$(arg log_output)" />
		<arg name="fcu_protocol" value="$(arg fcu_protocol)" />
		<arg name="respawn_mavros" value="$(arg respawn_mavros)" />
	</include>
</launch>

Simulation

For simulation purposes, change the apm.launch with the follwoing

arg name="fcu_url" default="udp://127.0.0.1:14551@14555">

Hardware

For connecting MAVTOS with Pixhawk (ardupilot), change apm.launch with the following

<arg name="fcu_url" default="/dev/ttyACM0:57600" />

Where ttyACM0 is the port where your Pixhawk has been connected on the machine/computer. To check the Pixhawk port name, use the following

cd /
cd dev
ls tty*

Find the additional items in the list. Usually you will find two ports (in my Case ACM0 and ACM1). Change the port name accordingly in apm.launch.

Note: If MAVROS fails to execute, check whether the port is executable or not

sudo chmod 777 /dev/ttyACM0

Fetching Data

The following can be used to check available topics where data is being published

rostopic list

To access data fro a particular topic, use the following (example, accessing data in imu/data_raw)