aboutsummaryrefslogblamecommitdiff
path: root/ROMFS/px4fmu_common/init.d/rc.usb
blob: c89932bb5dc5e56607d9fe988255341199b38efe (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                   
                                           
 


                 
                                       





                                             

                         
 

                             
 




                                        
            
                                                     
            





                                                           
          
 




                                  
  
 

                                       

                                            
#!nsh
#
# USB MAVLink start
#

echo "Starting MAVLink on this USB console"

# Stop tone alarm
tone_alarm stop

# Tell MAVLink that this link is "fast"
if mavlink stop
then
	echo "stopped other MAVLink instance"
fi
mavlink start -b 230400 -d /dev/ttyACM0

if [ $MODE == autostart ]
then

	# Start the commander
	commander start

	# Start sensors
	sh /etc/init.d/rc.sensors

	# Start one of the estimators
	if attitude_estimator_ekf status
	then
		echo "multicopter att filter running"
	else
		if att_pos_estimator_ekf status
		then
			echo "fixedwing att filter running"
		else
			attitude_estimator_ekf start
		fi
	fi

	# Start GPS
	if gps start
	then
		echo "GPS started"
	fi
fi

echo "MAVLink started, exiting shell.."

# Exit shell to make it available to MAVLink
exit