2013-06-18 05:45:08 -03:00
|
|
|
#!nsh
|
2013-08-25 14:27:11 -03:00
|
|
|
|
|
|
|
echo "[init] 09_ardrone_flow: PX4FMU on PX4IOAR carrier board with PX4FLOW"
|
|
|
|
|
2013-06-18 05:45:08 -03:00
|
|
|
#
|
2013-08-25 14:27:11 -03:00
|
|
|
# Load default params for this platform
|
2013-06-18 05:45:08 -03:00
|
|
|
#
|
2013-08-25 14:27:11 -03:00
|
|
|
if param compare SYS_AUTOCONFIG 1
|
2013-06-18 05:45:08 -03:00
|
|
|
then
|
2013-08-25 14:27:11 -03:00
|
|
|
# Set all params here, then disable autoconfig
|
2013-09-12 07:56:06 -03:00
|
|
|
param set MC_ATTRATE_D 0
|
|
|
|
param set MC_ATTRATE_I 0
|
|
|
|
param set MC_ATTRATE_P 0.13
|
|
|
|
param set MC_ATT_D 0
|
|
|
|
param set MC_ATT_I 0.3
|
|
|
|
param set MC_ATT_P 5
|
|
|
|
param set MC_YAWPOS_D 0.1
|
|
|
|
param set MC_YAWPOS_I 0.15
|
|
|
|
param set MC_YAWPOS_P 1
|
|
|
|
param set MC_YAWRATE_D 0
|
|
|
|
param set MC_YAWRATE_I 0
|
|
|
|
param set MC_YAWRATE_P 0.15
|
2013-08-25 14:27:11 -03:00
|
|
|
|
|
|
|
param set SYS_AUTOCONFIG 0
|
2013-08-28 09:58:29 -03:00
|
|
|
param save
|
2013-06-18 05:45:08 -03:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Force some key parameters to sane values
|
2013-08-25 14:27:11 -03:00
|
|
|
# MAV_TYPE 2 = quadrotor
|
2013-06-18 05:45:08 -03:00
|
|
|
#
|
|
|
|
param set MAV_TYPE 2
|
2013-09-18 06:49:22 -03:00
|
|
|
param set BAT_V_SCALING 0.008381
|
2013-06-18 05:45:08 -03:00
|
|
|
|
2013-08-25 14:27:11 -03:00
|
|
|
#
|
|
|
|
# Start MAVLink and MAVLink Onboard (PX4FLOW Sensor)
|
|
|
|
#
|
|
|
|
mavlink start -d /dev/ttyS0 -b 57600
|
|
|
|
mavlink_onboard start -d /dev/ttyS3 -b 115200
|
|
|
|
usleep 5000
|
|
|
|
|
2013-06-18 05:45:08 -03:00
|
|
|
#
|
|
|
|
# Configure PX4FMU for operation with PX4IOAR
|
|
|
|
#
|
|
|
|
fmu mode_gpio_serial
|
2013-08-25 14:27:11 -03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Fire up the AR.Drone interface.
|
|
|
|
#
|
|
|
|
ardrone_interface start -d /dev/ttyS1
|
2013-06-18 05:45:08 -03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Start the sensors.
|
|
|
|
#
|
|
|
|
sh /etc/init.d/rc.sensors
|
|
|
|
|
|
|
|
#
|
|
|
|
# Start the commander.
|
|
|
|
#
|
|
|
|
commander start
|
|
|
|
|
|
|
|
#
|
|
|
|
# Start the attitude estimator
|
|
|
|
#
|
|
|
|
attitude_estimator_ekf start
|
|
|
|
|
|
|
|
#
|
|
|
|
# Start the position estimator
|
|
|
|
#
|
|
|
|
flow_position_estimator start
|
|
|
|
|
|
|
|
#
|
|
|
|
# Fire up the multi rotor attitude controller
|
|
|
|
#
|
|
|
|
multirotor_att_control start
|
|
|
|
|
|
|
|
#
|
|
|
|
# Fire up the flow position controller
|
|
|
|
#
|
|
|
|
flow_position_control start
|
|
|
|
|
|
|
|
#
|
|
|
|
# Fire up the flow speed controller
|
|
|
|
#
|
|
|
|
flow_speed_control start
|
|
|
|
|
2013-08-22 04:25:13 -03:00
|
|
|
# Exit, because /dev/ttyS0 is needed for MAVLink
|
2013-06-18 05:45:08 -03:00
|
|
|
exit
|