Home        Store        Docs        Blog

Guided mode with fake_gps positioning through mavros


(Sencer Yazici) #1

Hi there,
we have an underwater vehicle, with the Pixhawk ardusub firmware installed on it.
The milestone we wan’t to achive is to be able to provide external position data through fake_gps, and we either will want to send some velocity setpoints or position setpoints, and basically expect the vehicle to achieve that pose or that velocity.
the fake_gps works pretty well since we can get the data we publish from /mavros/global_position/local, but we cannot get any data from /mavros/local_position/pose, which we think the problem is due to setting home position. here is the script we use for setting position

def __init__(self):
    self.homepos_client = rospy.ServiceProxy("/mavros/cmd/set_home", CommandHome)

def set_home(self, home_pos):
    srv = CommandHomeRequest()
    srv.current_gps = True
    srv.altitude = home_pos["alt"]
    srv.latitude = home_pos["lat"]
    srv.longitude = home_pos["lon"]

    resp = self.homepos_client(srv)
    print resp

After we try to set the home position, the request fails and returns a success: False, result: 4 error.

Because we fail at any of those, we fail to switch to guided mode, which is i think the required mode for position/velocity based movement.

The manual/rcoverride method is the method we currently use, but if this can be a solution, we don’t want to waste time with custom controllers etc since the imu data is published at 50hz, but of course it is the must do option if it is not possible to use guided mode.

We even get a GPS lock, which the indicator lights green.

Here is our parameter list

# Onboard parameters for Vehicle 1
#
# Stack: ArduPilot
# Vehicle: Sub
# Version: 3.6.0 dev
# Git Revision: 4bec75d
#
# Vehicle-Id Component-Id Name Value Type
1	1	ACRO_BAL_PITCH	1.000000000000000000	9
1	1	ACRO_BAL_ROLL	1.000000000000000000	9
1	1	ACRO_EXPO	0.300000011920928955	9
1	1	ACRO_RP_P	4.500000000000000000	9
1	1	ACRO_TRAINER	2	2
1	1	ACRO_YAW_P	3.375000000000000000	9
1	1	AHRS_COMP_BETA	0.100000001490116119	9
1	1	AHRS_CUSTOM_PIT	0.000000000000000000	9
1	1	AHRS_CUSTOM_ROLL	0.000000000000000000	9
1	1	AHRS_CUSTOM_YAW	0.000000000000000000	9
1	1	AHRS_EKF_TYPE	2	2
1	1	AHRS_GPS_GAIN	1.000000000000000000	9
1	1	AHRS_GPS_MINSATS	6	2
1	1	AHRS_GPS_USE	1	2
1	1	AHRS_ORIENTATION	0	2
1	1	AHRS_RP_P	0.200000002980232239	9
1	1	AHRS_TRIM_X	0.022342924028635025	9
1	1	AHRS_TRIM_Y	-0.026222474873065948	9
1	1	AHRS_TRIM_Z	0.000000000000000000	9
1	1	AHRS_WIND_MAX	0	2
1	1	AHRS_YAW_P	0.200000002980232239	9
1	1	ANGLE_MAX	4500	4
1	1	ARMING_ACCTHRESH	0.750000000000000000	9
1	1	ARMING_CHECK	448	4
1	1	ATC_ACCEL_P_MAX	110000.000000000000000000	9
1	1	ATC_ACCEL_R_MAX	110000.000000000000000000	9
1	1	ATC_ACCEL_Y_MAX	110000.000000000000000000	9
1	1	ATC_ANGLE_BOOST	1	2
1	1	ATC_ANG_LIM_TC	1.000000000000000000	9
1	1	ATC_ANG_PIT_P	6.000000000000000000	9
1	1	ATC_ANG_RLL_P	6.000000000000000000	9
1	1	ATC_ANG_YAW_P	6.000000000000000000	9
1	1	ATC_INPUT_TC	0.150000005960464478	9
1	1	ATC_RATE_FF_ENAB	1	2
1	1	ATC_RATE_P_MAX	0.000000000000000000	9
1	1	ATC_RATE_R_MAX	0.000000000000000000	9
1	1	ATC_RATE_Y_MAX	0.000000000000000000	9
1	1	ATC_RAT_PIT_D	0.003599999938160181	9
1	1	ATC_RAT_PIT_FF	0.000000000000000000	9
1	1	ATC_RAT_PIT_FILT	30.000000000000000000	9
1	1	ATC_RAT_PIT_I	0.090000003576278687	9
1	1	ATC_RAT_PIT_IMAX	0.444000005722045898	9
1	1	ATC_RAT_PIT_P	0.135000005364418030	9
1	1	ATC_RAT_RLL_D	0.003599999938160181	9
1	1	ATC_RAT_RLL_FF	0.000000000000000000	9
1	1	ATC_RAT_RLL_FILT	30.000000000000000000	9
1	1	ATC_RAT_RLL_I	0.090000003576278687	9
1	1	ATC_RAT_RLL_IMAX	0.444000005722045898	9
1	1	ATC_RAT_RLL_P	0.135000005364418030	9
1	1	ATC_RAT_YAW_D	0.000000000000000000	9
1	1	ATC_RAT_YAW_FF	0.000000000000000000	9
1	1	ATC_RAT_YAW_FILT	5.000000000000000000	9
1	1	ATC_RAT_YAW_I	0.017999999225139618	9
1	1	ATC_RAT_YAW_IMAX	0.222000002861022949	9
1	1	ATC_RAT_YAW_P	0.180000007152557373	9
1	1	ATC_SLEW_YAW	6000.000000000000000000	9
1	1	ATC_THR_MIX_MAN	0.500000000000000000	9
1	1	ATC_THR_MIX_MAX	0.500000000000000000	9
1	1	ATC_THR_MIX_MIN	0.100000001490116119	9
1	1	BATT2_MONITOR	0	2
1	1	BATT3_MONITOR	0	2
1	1	BATT4_MONITOR	0	2
1	1	BATT5_MONITOR	0	2
1	1	BATT6_MONITOR	0	2
1	1	BATT7_MONITOR	0	2
1	1	BATT8_MONITOR	0	2
1	1	BATT9_MONITOR	0	2
1	1	BATT_AMP_OFFSET	0.000000000000000000	9
1	1	BATT_AMP_PERVLT	17.000000000000000000	9
1	1	BATT_ARM_MAH	0	6
1	1	BATT_ARM_VOLT	0.000000000000000000	9
1	1	BATT_CAPACITY	3300	6
1	1	BATT_CRT_MAH	0.000000000000000000	9
1	1	BATT_CRT_VOLT	0.000000000000000000	9
1	1	BATT_CURR_PIN	3	2
1	1	BATT_FS_CRT_ACT	0	2
1	1	BATT_FS_LOW_ACT	0	2
1	1	BATT_FS_VOLTSRC	0	2
1	1	BATT_LOW_MAH	0.000000000000000000	9
1	1	BATT_LOW_TIMER	10	2
1	1	BATT_LOW_VOLT	0.000000000000000000	9
1	1	BATT_MONITOR	4	2
1	1	BATT_SERIAL_NUM	-1	6
1	1	BATT_VOLT_MULT	10.100000381469726563	9
1	1	BATT_VOLT_PIN	2	2
1	1	BRD_IMU_TARGTEMP	-1	2
1	1	BRD_IO_ENABLE	1	2
1	1	BRD_PWM_COUNT	4	2
1	1	BRD_RTC_TYPES	1	2
1	1	BRD_SAFETYENABLE	0	2
1	1	BRD_SAFETYOPTION	3	4
1	1	BRD_SAFETY_MASK	0	6
1	1	BRD_SBUS_OUT	1	2
1	1	BRD_SER1_RTSCTS	2	2
1	1	BRD_SER2_RTSCTS	2	2
1	1	BRD_SERIAL_NUM	0	4
1	1	BRD_TYPE	2	2
1	1	BRD_VBUS_MIN	4.300000190734863281	9
1	1	BRD_VSERVO_MIN	0.000000000000000000	9
1	1	BTN0_FUNCTION	0	2
1	1	BTN0_SFUNCTION	0	2
1	1	BTN10_FUNCTION	22	2
1	1	BTN10_SFUNCTION	26	2
1	1	BTN11_FUNCTION	42	2
1	1	BTN11_SFUNCTION	47	2
1	1	BTN12_FUNCTION	43	2
1	1	BTN12_SFUNCTION	46	2
1	1	BTN13_FUNCTION	33	2
1	1	BTN13_SFUNCTION	45	2
1	1	BTN14_FUNCTION	32	2
1	1	BTN14_SFUNCTION	44	2
1	1	BTN15_FUNCTION	0	2
1	1	BTN15_SFUNCTION	0	2
1	1	BTN1_FUNCTION	5	2
1	1	BTN1_SFUNCTION	0	2
1	1	BTN2_FUNCTION	7	2
1	1	BTN2_SFUNCTION	0	2
1	1	BTN3_FUNCTION	6	2
1	1	BTN3_SFUNCTION	0	2
1	1	BTN4_FUNCTION	4	2
1	1	BTN4_SFUNCTION	0	2
1	1	BTN5_FUNCTION	1	2
1	1	BTN5_SFUNCTION	0	2
1	1	BTN6_FUNCTION	3	2
1	1	BTN6_SFUNCTION	0	2
1	1	BTN7_FUNCTION	21	2
1	1	BTN7_SFUNCTION	0	2
1	1	BTN8_FUNCTION	48	2
1	1	BTN8_SFUNCTION	0	2
1	1	BTN9_FUNCTION	23	2
1	1	BTN9_SFUNCTION	27	2
1	1	CAN_D1_PROTOCOL	1	2
1	1	CAN_D2_PROTOCOL	1	2
1	1	CAN_P1_DRIVER	0	2
1	1	CAN_P2_DRIVER	0	2
1	1	CIRCLE_RADIUS	1000.000000000000000000	9
1	1	CIRCLE_RATE	2.000000000000000000	9
1	1	COMPASS_AUTODEC	1	2
1	1	COMPASS_AUTO_ROT	2	2
1	1	COMPASS_CAL_FIT	16.000000000000000000	9
1	1	COMPASS_DEC	0.040936719626188278	9
1	1	COMPASS_DEV_ID	131594	6
1	1	COMPASS_DEV_ID2	0	6
1	1	COMPASS_DEV_ID3	0	6
1	1	COMPASS_DIA2_X	0.000000000000000000	9
1	1	COMPASS_DIA2_Y	0.000000000000000000	9
1	1	COMPASS_DIA2_Z	0.000000000000000000	9
1	1	COMPASS_DIA3_X	0.000000000000000000	9
1	1	COMPASS_DIA3_Y	0.000000000000000000	9
1	1	COMPASS_DIA3_Z	0.000000000000000000	9
1	1	COMPASS_DIA_X	1.000000000000000000	9
1	1	COMPASS_DIA_Y	1.000000000000000000	9
1	1	COMPASS_DIA_Z	1.000000000000000000	9
1	1	COMPASS_EXP_DID	-1	6
1	1	COMPASS_EXP_DID2	-1	6
1	1	COMPASS_EXP_DID3	-1	6
1	1	COMPASS_EXTERN2	0	2
1	1	COMPASS_EXTERN3	0	2
1	1	COMPASS_EXTERNAL	0	2
1	1	COMPASS_FLTR_RNG	0	2
1	1	COMPASS_LEARN	0	2
1	1	COMPASS_MOT2_X	0.000000000000000000	9
1	1	COMPASS_MOT2_Y	0.000000000000000000	9
1	1	COMPASS_MOT2_Z	0.000000000000000000	9
1	1	COMPASS_MOT3_X	0.000000000000000000	9
1	1	COMPASS_MOT3_Y	0.000000000000000000	9
1	1	COMPASS_MOT3_Z	0.000000000000000000	9
1	1	COMPASS_MOTCT	0	2
1	1	COMPASS_MOT_X	0.000000000000000000	9
1	1	COMPASS_MOT_Y	0.000000000000000000	9
1	1	COMPASS_MOT_Z	0.000000000000000000	9
1	1	COMPASS_ODI2_X	0.000000000000000000	9
1	1	COMPASS_ODI2_Y	0.000000000000000000	9
1	1	COMPASS_ODI2_Z	0.000000000000000000	9
1	1	COMPASS_ODI3_X	0.000000000000000000	9
1	1	COMPASS_ODI3_Y	0.000000000000000000	9
1	1	COMPASS_ODI3_Z	0.000000000000000000	9
1	1	COMPASS_ODI_X	0.000000000000000000	9
1	1	COMPASS_ODI_Y	0.000000000000000000	9
1	1	COMPASS_ODI_Z	0.000000000000000000	9
1	1	COMPASS_OFFS_MAX	1000	4
1	1	COMPASS_OFS2_X	0.000000000000000000	9
1	1	COMPASS_OFS2_Y	0.000000000000000000	9
1	1	COMPASS_OFS2_Z	0.000000000000000000	9
1	1	COMPASS_OFS3_X	0.000000000000000000	9
1	1	COMPASS_OFS3_Y	0.000000000000000000	9
1	1	COMPASS_OFS3_Z	0.000000000000000000	9
1	1	COMPASS_OFS_X	0.000000000000000000	9
1	1	COMPASS_OFS_Y	0.000000000000000000	9
1	1	COMPASS_OFS_Z	0.000000000000000000	9
1	1	COMPASS_ORIENT	0	2
1	1	COMPASS_ORIENT2	0	2
1	1	COMPASS_ORIENT3	0	2
1	1	COMPASS_PMOT_EN	0	2
1	1	COMPASS_PRIMARY	0	2
1	1	COMPASS_TYPEMASK	0	6
1	1	COMPASS_USE	1	2
1	1	COMPASS_USE2	1	2
1	1	COMPASS_USE3	1	2
1	1	EK2_ABIAS_P_NSE	0.004999999888241291	9
1	1	EK2_ACC_P_NSE	0.600000023841857910	9
1	1	EK2_ALT_M_NSE	10.000000000000000000	9
1	1	EK2_ALT_SOURCE	0	2
1	1	EK2_BCN_DELAY	50	2
1	1	EK2_BCN_I_GTE	500	4
1	1	EK2_BCN_M_NSE	1.000000000000000000	9
1	1	EK2_CHECK_SCALE	100	4
1	1	EK2_EAS_I_GATE	400	4
1	1	EK2_EAS_M_NSE	1.399999976158142090	9
1	1	EK2_ENABLE	1	2
1	1	EK2_FLOW_DELAY	10	2
1	1	EK2_FLOW_I_GATE	300	4
1	1	EK2_FLOW_M_NSE	0.250000000000000000	9
1	1	EK2_GBIAS_P_NSE	0.000099999997473788	9
1	1	EK2_GLITCH_RAD	25	2
1	1	EK2_GPS_CHECK	31	2
1	1	EK2_GPS_TYPE	1	2
1	1	EK2_GSCL_P_NSE	0.000500000023748726	9
1	1	EK2_GYRO_P_NSE	0.029999999329447746	9
1	1	EK2_HGT_DELAY	60	4
1	1	EK2_HGT_I_GATE	500	4
1	1	EK2_IMU_MASK	3	2
1	1	EK2_LOG_MASK	1	2
1	1	EK2_MAGB_P_NSE	0.000099999997473788	9
1	1	EK2_MAGE_P_NSE	0.001000000047497451	9
1	1	EK2_MAG_CAL	3	2
1	1	EK2_MAG_I_GATE	300	4
1	1	EK2_MAG_MASK	0	2
1	1	EK2_MAG_M_NSE	0.050000000745058060	9
1	1	EK2_MAX_FLOW	2.500000000000000000	9
1	1	EK2_NOAID_M_NSE	10.000000000000000000	9
1	1	EK2_OGN_HGT_MASK	0	2
1	1	EK2_POSNE_M_NSE	1.000000000000000000	9
1	1	EK2_POS_I_GATE	500	4
1	1	EK2_RNG_I_GATE	500	4
1	1	EK2_RNG_M_NSE	0.500000000000000000	9
1	1	EK2_RNG_USE_HGT	-1	2
1	1	EK2_RNG_USE_SPD	2.000000000000000000	9
1	1	EK2_TAU_OUTPUT	25	2
1	1	EK2_TERR_GRAD	0.100000001490116119	9
1	1	EK2_VELD_M_NSE	0.699999988079071045	9
1	1	EK2_VELNE_M_NSE	0.500000000000000000	9
1	1	EK2_VEL_I_GATE	500	4
1	1	EK2_WIND_PSCALE	0.500000000000000000	9
1	1	EK2_WIND_P_NSE	0.100000001490116119	9
1	1	EK2_YAW_I_GATE	300	4
1	1	EK2_YAW_M_NSE	0.500000000000000000	9
1	1	EK3_ENABLE	0	2
1	1	FENCE_ACTION	1	2
1	1	FENCE_ALT_MAX	100.000000000000000000	9
1	1	FENCE_ALT_MIN	-10.000000000000000000	9
1	1	FENCE_ENABLE	0	2
1	1	FENCE_MARGIN	2.000000000000000000	9
1	1	FENCE_RADIUS	300.000000000000000000	9
1	1	FENCE_TOTAL	0	2
1	1	FENCE_TYPE	7	2
1	1	FRAME_CONFIG	1	2
1	1	FS_CRASH_CHECK	0	2
1	1	FS_EKF_ACTION	0	2
1	1	FS_EKF_THRESH	0.800000011920928955	9
1	1	FS_GCS_ENABLE	0	2
1	1	FS_LEAK_ENABLE	0	2
1	1	FS_PILOT_INPUT	0	2
1	1	FS_PILOT_TIMEOUT	3.000000000000000000	9
1	1	FS_PRESS_ENABLE	0	2
1	1	FS_PRESS_MAX	105000	6
1	1	FS_TEMP_ENABLE	0	2
1	1	FS_TEMP_MAX	62	2
1	1	FS_TERRAIN_ENAB	1	2
1	1	GCS_PID_MASK	0	4
1	1	GND_ABS_PRESS	100744.734375000000000000	9
1	1	GND_ABS_PRESS2	0.000000000000000000	9
1	1	GND_ABS_PRESS3	0.000000000000000000	9
1	1	GND_ALT_OFFSET	0.000000000000000000	9
1	1	GND_EXT_BUS	1	2
1	1	GND_FLTR_RNG	0	2
1	1	GND_PRIMARY	0	2
1	1	GND_SPEC_GRAV	1.000000000000000000	9
1	1	GND_TEMP	0.000000000000000000	9
1	1	GPS_AUTO_CONFIG	1	2
1	1	GPS_AUTO_SWITCH	1	2
1	1	GPS_BLEND_MASK	5	2
1	1	GPS_BLEND_TC	10.000000000000000000	9
1	1	GPS_DELAY_MS	0	4
1	1	GPS_DELAY_MS2	0	4
1	1	GPS_GNSS_MODE	0	2
1	1	GPS_GNSS_MODE2	0	2
1	1	GPS_INJECT_TO	127	2
1	1	GPS_MIN_DGPS	100	2
1	1	GPS_MIN_ELEV	-100	2
1	1	GPS_NAVFILTER	8	2
1	1	GPS_POS1_X	0.000000000000000000	9
1	1	GPS_POS1_Y	0.000000000000000000	9
1	1	GPS_POS1_Z	0.000000000000000000	9
1	1	GPS_POS2_X	0.000000000000000000	9
1	1	GPS_POS2_Y	0.000000000000000000	9
1	1	GPS_POS2_Z	0.000000000000000000	9
1	1	GPS_RATE_MS	200	4
1	1	GPS_RATE_MS2	200	4
1	1	GPS_RAW_DATA	0	2
1	1	GPS_SAVE_CFG	2	2
1	1	GPS_SBAS_MODE	2	2
1	1	GPS_SBP_LOGMASK	-256	4
1	1	GPS_TYPE	14	2
1	1	GPS_TYPE2	14	2
1	1	INS_ACC2OFFS_X	-0.048896312713623047	9
1	1	INS_ACC2OFFS_Y	-0.068199947476387024	9
1	1	INS_ACC2OFFS_Z	0.671753227710723877	9
1	1	INS_ACC2SCAL_X	1.000235915184020996	9
1	1	INS_ACC2SCAL_Y	0.981025695800781250	9
1	1	INS_ACC2SCAL_Z	1.007125139236450195	9
1	1	INS_ACC2_ID	1114634	6
1	1	INS_ACC3OFFS_X	0.000000000000000000	9
1	1	INS_ACC3OFFS_Y	0.000000000000000000	9
1	1	INS_ACC3OFFS_Z	0.000000000000000000	9
1	1	INS_ACC3SCAL_X	0.000000000000000000	9
1	1	INS_ACC3SCAL_Y	0.000000000000000000	9
1	1	INS_ACC3SCAL_Z	0.000000000000000000	9
1	1	INS_ACC3_ID	0	6
1	1	INS_ACCEL_FILTER	20	2
1	1	INS_ACCOFFS_X	-0.010551984421908855	9
1	1	INS_ACCOFFS_Y	-0.324601054191589355	9
1	1	INS_ACCOFFS_Z	-1.904095530509948730	9
1	1	INS_ACCSCAL_X	0.999389052391052246	9
1	1	INS_ACCSCAL_Y	0.998169183731079102	9
1	1	INS_ACCSCAL_Z	0.984476685523986816	9
1	1	INS_ACC_BODYFIX	2	2
1	1	INS_ACC_ID	1246218	6
1	1	INS_ENABLE_MASK	3	2
1	1	INS_FAST_SAMPLE	0	2
1	1	INS_GYR2OFFS_X	0.028326001018285751	9
1	1	INS_GYR2OFFS_Y	-0.003329514060169458	9
1	1	INS_GYR2OFFS_Z	0.011078460142016411	9
1	1	INS_GYR2_ID	2228490	6
1	1	INS_GYR3OFFS_X	0.000000000000000000	9
1	1	INS_GYR3OFFS_Y	0.000000000000000000	9
1	1	INS_GYR3OFFS_Z	0.000000000000000000	9
1	1	INS_GYR3_ID	0	6
1	1	INS_GYROFFS_X	-0.000407375715440139	9
1	1	INS_GYROFFS_Y	-0.021693699061870575	9
1	1	INS_GYROFFS_Z	-0.016875222325325012	9
1	1	INS_GYRO_FILTER	20	2
1	1	INS_GYR_CAL	0	2
1	1	INS_GYR_ID	2163722	6
1	1	INS_LOG_BAT_CNT	1024	4
1	1	INS_LOG_BAT_LGCT	32	4
1	1	INS_LOG_BAT_LGIN	20	2
1	1	INS_LOG_BAT_MASK	0	2
1	1	INS_LOG_BAT_OPT	0	2
1	1	INS_NOTCH_ENABLE	0	2
1	1	INS_POS1_X	0.000000000000000000	9
1	1	INS_POS1_Y	0.000000000000000000	9
1	1	INS_POS1_Z	0.000000000000000000	9
1	1	INS_POS2_X	0.000000000000000000	9
1	1	INS_POS2_Y	0.000000000000000000	9
1	1	INS_POS2_Z	0.000000000000000000	9
1	1	INS_POS3_X	0.000000000000000000	9
1	1	INS_POS3_Y	0.000000000000000000	9
1	1	INS_POS3_Z	0.000000000000000000	9
1	1	INS_PRODUCT_ID	0	4
1	1	INS_STILL_THRESH	0.100000001490116119	9
1	1	INS_TRIM_OPTION	1	2
1	1	INS_USE	1	2
1	1	INS_USE2	1	2
1	1	INS_USE3	0	2
1	1	JS_GAIN_DEFAULT	1.000000000000000000	9
1	1	JS_GAIN_MAX	1.000000000000000000	9
1	1	JS_GAIN_MIN	0.100000001490116119	9
1	1	JS_GAIN_STEPS	4	2
1	1	JS_LIGHTS_STEPS	8	4
1	1	JS_THR_GAIN	1.000000000000000000	9
1	1	LEAK1_LOGIC	0	2
1	1	LEAK1_PIN	-1	2
1	1	LEAK2_LOGIC	0	2
1	1	LEAK2_PIN	-1	2
1	1	LEAK3_LOGIC	0	2
1	1	LEAK3_PIN	-1	2
1	1	LOG_BACKEND_TYPE	3	2
1	1	LOG_BITMASK	176126	6
1	1	LOG_DISARMED	0	2
1	1	LOG_FILE_BUFSIZE	16	2
1	1	LOG_FILE_DSRMROT	0	2
1	1	LOG_MAV_BUFSIZE	8	2
1	1	LOG_REPLAY	0	2
1	1	LOITER_ACC_MAX	500.000000000000000000	9
1	1	LOITER_ANG_MAX	0.000000000000000000	9
1	1	LOITER_BRK_ACCEL	250.000000000000000000	9
1	1	LOITER_BRK_DELAY	1.000000000000000000	9
1	1	LOITER_BRK_JERK	500.000000000000000000	9
1	1	LOITER_SPEED	1250.000000000000000000	9
1	1	MAG_ENABLE	1	2
1	1	MIS_OPTIONS	0	4
1	1	MIS_RESTART	0	2
1	1	MIS_TOTAL	0	4
1	1	MNT_ANGMAX_PAN	4500	4
1	1	MNT_ANGMAX_ROL	4500	4
1	1	MNT_ANGMAX_TIL	4500	4
1	1	MNT_ANGMIN_PAN	-4500	4
1	1	MNT_ANGMIN_ROL	-4500	4
1	1	MNT_ANGMIN_TIL	-4500	4
1	1	MNT_DEFLT_MODE	3	2
1	1	MNT_JSTICK_SPD	100	2
1	1	MNT_LEAD_PTCH	0.000000000000000000	9
1	1	MNT_LEAD_RLL	0.000000000000000000	9
1	1	MNT_NEUTRAL_X	0.000000000000000000	9
1	1	MNT_NEUTRAL_Y	0.000000000000000000	9
1	1	MNT_NEUTRAL_Z	0.000000000000000000	9
1	1	MNT_RC_IN_PAN	7	2
1	1	MNT_RC_IN_ROLL	0	2
1	1	MNT_RC_IN_TILT	8	2
1	1	MNT_RETRACT_X	0.000000000000000000	9
1	1	MNT_RETRACT_Y	0.000000000000000000	9
1	1	MNT_RETRACT_Z	0.000000000000000000	9
1	1	MNT_STAB_PAN	0	2
1	1	MNT_STAB_ROLL	0	2
1	1	MNT_STAB_TILT	0	2
1	1	MNT_TYPE	0	2
1	1	MOT_10_DIRECTION	1	2
1	1	MOT_11_DIRECTION	1	2
1	1	MOT_12_DIRECTION	1	2
1	1	MOT_1_DIRECTION	1	2
1	1	MOT_2_DIRECTION	1	2
1	1	MOT_3_DIRECTION	1	2
1	1	MOT_4_DIRECTION	1	2
1	1	MOT_5_DIRECTION	1	2
1	1	MOT_6_DIRECTION	1	2
1	1	MOT_7_DIRECTION	1	2
1	1	MOT_8_DIRECTION	1	2
1	1	MOT_9_DIRECTION	1	2
1	1	MOT_BAT_CURR_MAX	0.000000000000000000	9
1	1	MOT_BAT_CURR_TC	5.000000000000000000	9
1	1	MOT_BAT_IDX	0	2
1	1	MOT_BAT_VOLT_MAX	0.000000000000000000	9
1	1	MOT_BAT_VOLT_MIN	0.000000000000000000	9
1	1	MOT_BOOST_SCALE	0.000000000000000000	9
1	1	MOT_FV_CPLNG_K	1.000000000000000000	9
1	1	MOT_HOVER_LEARN	2	2
1	1	MOT_PWM_MAX	1900	4
1	1	MOT_PWM_MIN	1100	4
1	1	MOT_PWM_TYPE	0	2
1	1	MOT_SAFE_DISARM	0	2
1	1	MOT_SPIN_ARM	0.100000001490116119	9
1	1	MOT_SPIN_MAX	0.949999988079071045	9
1	1	MOT_SPIN_MIN	0.150000005960464478	9
1	1	MOT_SPOOL_TIME	0.200000002980232239	9
1	1	MOT_THST_EXPO	0.649999976158142090	9
1	1	MOT_THST_HOVER	0.349999994039535522	9
1	1	MOT_YAW_HEADROOM	200	4
1	1	NTF_BUZZ_ENABLE	1	2
1	1	NTF_BUZZ_PIN	0	2
1	1	NTF_DISPLAY_TYPE	0	2
1	1	NTF_LED_BRIGHT	3	2
1	1	NTF_LED_OVERRIDE	0	2
1	1	NTF_LED_TYPES	199	6
1	1	PILOT_ACCEL_Z	100	4
1	1	PILOT_SPEED_DN	0	4
1	1	PILOT_SPEED_UP	500	4
1	1	PILOT_THR_FILT	0.000000000000000000	9
1	1	PSC_ACCZ_D	0.000000000000000000	9
1	1	PSC_ACCZ_FF	0.000000000000000000	9
1	1	PSC_ACCZ_FILT	20.000000000000000000	9
1	1	PSC_ACCZ_I	0.100000001490116119	9
1	1	PSC_ACCZ_IMAX	100.000000000000000000	9
1	1	PSC_ACCZ_P	0.500000000000000000	9
1	1	PSC_ACC_XY_FILT	2.000000000000000000	9
1	1	PSC_ANGLE_MAX	0.000000000000000000	9
1	1	PSC_POSXY_P	1.000000000000000000	9
1	1	PSC_POSZ_P	3.000000000000000000	9
1	1	PSC_VELXY_D	0.000000000000000000	9
1	1	PSC_VELXY_D_FILT	5.000000000000000000	9
1	1	PSC_VELXY_FILT	5.000000000000000000	9
1	1	PSC_VELXY_I	0.500000000000000000	9
1	1	PSC_VELXY_IMAX	1000.000000000000000000	9
1	1	PSC_VELXY_P	1.000000000000000000	9
1	1	PSC_VELZ_P	8.000000000000000000	9
1	1	RC10_DZ	30	4
1	1	RC10_MAX	1900	4
1	1	RC10_MIN	1100	4
1	1	RC10_REVERSED	0	2
1	1	RC10_TRIM	1500	4
1	1	RC11_DZ	30	4
1	1	RC11_MAX	1900	4
1	1	RC11_MIN	1100	4
1	1	RC11_REVERSED	0	2
1	1	RC11_TRIM	1500	4
1	1	RC12_DZ	30	4
1	1	RC12_MAX	1900	4
1	1	RC12_MIN	1100	4
1	1	RC12_REVERSED	0	2
1	1	RC12_TRIM	1500	4
1	1	RC13_DZ	30	4
1	1	RC13_MAX	1900	4
1	1	RC13_MIN	1100	4
1	1	RC13_REVERSED	0	2
1	1	RC13_TRIM	1500	4
1	1	RC14_DZ	30	4
1	1	RC14_MAX	1900	4
1	1	RC14_MIN	1100	4
1	1	RC14_REVERSED	0	2
1	1	RC14_TRIM	1500	4
1	1	RC15_DZ	30	4
1	1	RC15_MAX	1900	4
1	1	RC15_MIN	1100	4
1	1	RC15_REVERSED	0	2
1	1	RC15_TRIM	1500	4
1	1	RC16_DZ	30	4
1	1	RC16_MAX	1900	4
1	1	RC16_MIN	1100	4
1	1	RC16_REVERSED	0	2
1	1	RC16_TRIM	1500	4
1	1	RC1_DZ	30	4
1	1	RC1_MAX	1900	4
1	1	RC1_MIN	1100	4
1	1	RC1_REVERSED	0	2
1	1	RC1_TRIM	1500	4
1	1	RC2_DZ	30	4
1	1	RC2_MAX	1900	4
1	1	RC2_MIN	1100	4
1	1	RC2_REVERSED	0	2
1	1	RC2_TRIM	1500	4
1	1	RC3_DZ	30	4
1	1	RC3_MAX	1900	4
1	1	RC3_MIN	1100	4
1	1	RC3_REVERSED	0	2
1	1	RC3_TRIM	1100	4
1	1	RC4_DZ	30	4
1	1	RC4_MAX	1900	4
1	1	RC4_MIN	1100	4
1	1	RC4_REVERSED	0	2
1	1	RC4_TRIM	1500	4
1	1	RC5_DZ	30	4
1	1	RC5_MAX	1900	4
1	1	RC5_MIN	1100	4
1	1	RC5_REVERSED	0	2
1	1	RC5_TRIM	1500	4
1	1	RC6_DZ	30	4
1	1	RC6_MAX	1900	4
1	1	RC6_MIN	1100	4
1	1	RC6_REVERSED	0	2
1	1	RC6_TRIM	1500	4
1	1	RC7_DZ	30	4
1	1	RC7_MAX	1900	4
1	1	RC7_MIN	1100	4
1	1	RC7_REVERSED	0	2
1	1	RC7_TRIM	1500	4
1	1	RC8_DZ	30	4
1	1	RC8_MAX	1900	4
1	1	RC8_MIN	1100	4
1	1	RC8_REVERSED	0	2
1	1	RC8_TRIM	1500	4
1	1	RC9_DZ	30	4
1	1	RC9_MAX	1900	4
1	1	RC9_MIN	1100	4
1	1	RC9_REVERSED	0	2
1	1	RC9_TRIM	1500	4
1	1	RC_OPTIONS	0	6
1	1	RC_OVERRIDE_TIME	3.000000000000000000	9
1	1	RC_SPEED	200	4
1	1	RELAY_DEFAULT	0	2
1	1	RELAY_PIN	54	2
1	1	RELAY_PIN2	55	2
1	1	RELAY_PIN3	-1	2
1	1	RELAY_PIN4	-1	2
1	1	RNGFND2_ADDR	0	2
1	1	RNGFND2_FUNCTION	0	2
1	1	RNGFND2_GNDCLEAR	10	2
1	1	RNGFND2_MAX_CM	700	4
1	1	RNGFND2_MIN_CM	20	4
1	1	RNGFND2_OFFSET	0.000000000000000000	9
1	1	RNGFND2_ORIENT	25	2
1	1	RNGFND2_PIN	-1	2
1	1	RNGFND2_POS_X	0.000000000000000000	9
1	1	RNGFND2_POS_Y	0.000000000000000000	9
1	1	RNGFND2_POS_Z	0.000000000000000000	9
1	1	RNGFND2_RMETRIC	1	2
1	1	RNGFND2_SCALING	3.000000000000000000	9
1	1	RNGFND2_SETTLE	0	4
1	1	RNGFND2_STOP_PIN	-1	2
1	1	RNGFND2_TYPE	0	2
1	1	RNGFND_ADDR	0	2
1	1	RNGFND_FUNCTION	0	2
1	1	RNGFND_GAIN	0.800000011920928955	9
1	1	RNGFND_GNDCLEAR	10	2
1	1	RNGFND_MAX_CM	700	4
1	1	RNGFND_MIN_CM	20	4
1	1	RNGFND_OFFSET	0.000000000000000000	9
1	1	RNGFND_ORIENT	25	2
1	1	RNGFND_PIN	-1	2
1	1	RNGFND_POS_X	0.000000000000000000	9
1	1	RNGFND_POS_Y	0.000000000000000000	9
1	1	RNGFND_POS_Z	0.000000000000000000	9
1	1	RNGFND_PWRRNG	0	4
1	1	RNGFND_RMETRIC	1	2
1	1	RNGFND_SCALING	3.000000000000000000	9
1	1	RNGFND_SETTLE	0	4
1	1	RNGFND_STOP_PIN	-1	2
1	1	RNGFND_TYPE	0	2
1	1	SCHED_DEBUG	0	2
1	1	SCHED_LOOP_RATE	400	4
1	1	SERIAL0_BAUD	115	6
1	1	SERIAL0_PROTOCOL	2	2
1	1	SERIAL1_BAUD	115	6
1	1	SERIAL1_OPTIONS	0	4
1	1	SERIAL1_PROTOCOL	1	2
1	1	SERIAL2_BAUD	921	6
1	1	SERIAL2_OPTIONS	1	4
1	1	SERIAL2_PROTOCOL	2	2
1	1	SERIAL3_BAUD	38	6
1	1	SERIAL3_OPTIONS	0	4
1	1	SERIAL3_PROTOCOL	5	2
1	1	SERIAL4_BAUD	38	6
1	1	SERIAL4_OPTIONS	0	4
1	1	SERIAL4_PROTOCOL	5	2
1	1	SERIAL5_BAUD	57	6
1	1	SERIAL5_OPTIONS	0	4
1	1	SERIAL5_PROTOCOL	-1	2
1	1	SERIAL6_BAUD	57	6
1	1	SERIAL6_OPTIONS	0	4
1	1	SERIAL6_PROTOCOL	-1	2
1	1	SERVO10_FUNCTION	0	2
1	1	SERVO10_MAX	1900	4
1	1	SERVO10_MIN	1100	4
1	1	SERVO10_REVERSED	0	2
1	1	SERVO10_TRIM	1500	4
1	1	SERVO11_FUNCTION	0	2
1	1	SERVO11_MAX	1900	4
1	1	SERVO11_MIN	1100	4
1	1	SERVO11_REVERSED	0	2
1	1	SERVO11_TRIM	1500	4
1	1	SERVO12_FUNCTION	0	2
1	1	SERVO12_MAX	1900	4
1	1	SERVO12_MIN	1100	4
1	1	SERVO12_REVERSED	0	2
1	1	SERVO12_TRIM	1500	4
1	1	SERVO13_FUNCTION	0	2
1	1	SERVO13_MAX	1900	4
1	1	SERVO13_MIN	1100	4
1	1	SERVO13_REVERSED	0	2
1	1	SERVO13_TRIM	1500	4
1	1	SERVO14_FUNCTION	0	2
1	1	SERVO14_MAX	1900	4
1	1	SERVO14_MIN	1100	4
1	1	SERVO14_REVERSED	0	2
1	1	SERVO14_TRIM	1500	4
1	1	SERVO15_FUNCTION	0	2
1	1	SERVO15_MAX	1900	4
1	1	SERVO15_MIN	1100	4
1	1	SERVO15_REVERSED	0	2
1	1	SERVO15_TRIM	1500	4
1	1	SERVO16_FUNCTION	0	2
1	1	SERVO16_MAX	1900	4
1	1	SERVO16_MIN	1100	4
1	1	SERVO16_REVERSED	0	2
1	1	SERVO16_TRIM	1500	4
1	1	SERVO1_FUNCTION	33	2
1	1	SERVO1_MAX	1900	4
1	1	SERVO1_MIN	1100	4
1	1	SERVO1_REVERSED	0	2
1	1	SERVO1_TRIM	1500	4
1	1	SERVO2_FUNCTION	34	2
1	1	SERVO2_MAX	1900	4
1	1	SERVO2_MIN	1100	4
1	1	SERVO2_REVERSED	0	2
1	1	SERVO2_TRIM	1500	4
1	1	SERVO3_FUNCTION	35	2
1	1	SERVO3_MAX	1900	4
1	1	SERVO3_MIN	1100	4
1	1	SERVO3_REVERSED	0	2
1	1	SERVO3_TRIM	1500	4
1	1	SERVO4_FUNCTION	36	2
1	1	SERVO4_MAX	1900	4
1	1	SERVO4_MIN	1100	4
1	1	SERVO4_REVERSED	0	2
1	1	SERVO4_TRIM	1500	4
1	1	SERVO5_FUNCTION	37	2
1	1	SERVO5_MAX	1900	4
1	1	SERVO5_MIN	1100	4
1	1	SERVO5_REVERSED	0	2
1	1	SERVO5_TRIM	1500	4
1	1	SERVO6_FUNCTION	38	2
1	1	SERVO6_MAX	1900	4
1	1	SERVO6_MIN	1100	4
1	1	SERVO6_REVERSED	0	2
1	1	SERVO6_TRIM	1500	4
1	1	SERVO7_FUNCTION	39	2
1	1	SERVO7_MAX	1900	4
1	1	SERVO7_MIN	1100	4
1	1	SERVO7_REVERSED	0	2
1	1	SERVO7_TRIM	1500	4
1	1	SERVO8_FUNCTION	40	2
1	1	SERVO8_MAX	1900	4
1	1	SERVO8_MIN	1100	4
1	1	SERVO8_REVERSED	0	2
1	1	SERVO8_TRIM	1500	4
1	1	SERVO9_FUNCTION	0	2
1	1	SERVO9_MAX	1900	4
1	1	SERVO9_MIN	1100	4
1	1	SERVO9_REVERSED	0	2
1	1	SERVO9_TRIM	1500	4
1	1	SERVO_RATE	50	4
1	1	SERVO_SBUS_RATE	50	4
1	1	SERVO_VOLZ_MASK	0	6
1	1	SR0_EXTRA1	20	4
1	1	SR0_EXTRA2	100	4
1	1	SR0_EXTRA3	100	4
1	1	SR0_EXT_STAT	2	4
1	1	SR0_PARAMS	10	4
1	1	SR0_POSITION	3	4
1	1	SR0_RAW_SENS	2	4
1	1	SR0_RC_CHAN	2	4
1	1	SR1_EXTRA1	0	4
1	1	SR1_EXTRA2	0	4
1	1	SR1_EXTRA3	0	4
1	1	SR1_EXT_STAT	0	4
1	1	SR1_PARAMS	0	4
1	1	SR1_POSITION	0	4
1	1	SR1_RAW_SENS	0	4
1	1	SR1_RC_CHAN	0	4
1	1	SR2_EXTRA1	0	4
1	1	SR2_EXTRA2	0	4
1	1	SR2_EXTRA3	0	4
1	1	SR2_EXT_STAT	0	4
1	1	SR2_PARAMS	0	4
1	1	SR2_POSITION	0	4
1	1	SR2_RAW_SENS	0	4
1	1	SR2_RC_CHAN	0	4
1	1	SR3_EXTRA1	0	4
1	1	SR3_EXTRA2	0	4
1	1	SR3_EXTRA3	0	4
1	1	SR3_EXT_STAT	0	4
1	1	SR3_PARAMS	0	4
1	1	SR3_POSITION	0	4
1	1	SR3_RAW_SENS	0	4
1	1	SR3_RC_CHAN	0	4
1	1	SURFACE_DEPTH	-10.000000000000000000	9
1	1	SYSID_MYGCS	1	4
1	1	SYSID_SW_MREV	1	4
1	1	SYSID_THISMAV	1	4
1	1	THR_DZ	100	4
1	1	WPNAV_ACCEL	0.000000000000000000	9
1	1	WPNAV_ACCEL_Z	100.000000000000000000	9
1	1	WPNAV_RADIUS	200.000000000000000000	9
1	1	WPNAV_RFND_USE	1	2
1	1	WPNAV_SPEED	500.000000000000000000	9
1	1	WPNAV_SPEED_DN	150.000000000000000000	9
1	1	WPNAV_SPEED_UP	250.000000000000000000	9
1	1	WP_YAW_BEHAVIOR	4	2
1	1	XTRACK_ANG_LIM	45	2

And here is the apm_config.yaml

# Common configuration for APM2 autopilot
#
# node:
startup_px4_usb_quirk: false

# --- system plugins ---

# sys_status & sys_time connection options
conn:
  heartbeat_rate: 1.0    # send hertbeat rate in Hertz
  timeout: 10.0          # hertbeat timeout in seconds
  timesync_rate: 0.0     # TIMESYNC rate in Hertz (feature disabled if 0.0)
  system_time_rate: 0.0  # send system time to FCU rate in Hertz (disabled if 0.0)

# sys_status
sys:
  min_voltage: 10.0   # diagnostics min voltage
  disable_diag: false # disable all sys_status diagnostics, except heartbeat

# sys_time
time:
  time_ref_source: "fcu"  # time_reference source
  timesync_mode: NONE
  timesync_avg_alpha: 0.6 # timesync averaging factor

# --- mavros plugins (alphabetical order) ---

# 3dr_radio
tdr_radio:
  low_rssi: 40  # raw rssi lower level for diagnostics

# actuator_control
# None

# command
cmd:
  use_comp_id_system_control: false # quirk for some old FCUs

# dummy
# None

# ftp
# None

# global_position
global_position:
  frame_id: "map"             # origin frame
  child_frame_id: "base_link" # body-fixed frame
  rot_covariance: 99999.0   # covariance for attitude?
  gps_uere: 1.0             # User Equivalent Range Error (UERE) of GPS sensor (m)
  use_relative_alt: true    # use relative altitude for local coordinates
  tf:
    send: true               # send TF?
    frame_id: "map"  # TF frame_id
    global_frame_id: "earth"  # TF earth frame_id
    child_frame_id: "base_link" # TF child_frame_id

# imu_pub
imu:
  frame_id: "base_link"
  # need find actual values
  linear_acceleration_stdev: 0.0003
  angular_velocity_stdev: !degrees 0.02
  orientation_stdev: 1.0
  magnetic_stdev: 0.0

# local_position
local_position:
  frame_id: "map"
  tf:
    send: true
    frame_id: "map"
    child_frame_id: "base_link"
    send_fcu: false

# param
# None, used for FCU params

# rc_io
# None

# safety_area
safety_area:
  p1: {x:  1.0, y:  1.0, z:  1.0}
  p2: {x: -1.0, y: -1.0, z: -1.0}

# setpoint_accel
setpoint_accel:
  send_force: false

# setpoint_attitude
setpoint_attitude:
  reverse_thrust: false     # allow reversed thrust
  use_quaternion: false     # enable PoseStamped topic subscriber
  tf:
    listen: false           # enable tf listener (disable topic subscribers)
    frame_id: "map"
    child_frame_id: "target_attitude"
    rate_limit: 50.0

# setpoint_position
setpoint_position:
  tf:
    listen: false           # enable tf listener (disable topic subscribers)
    frame_id: "map"
    child_frame_id: "target_position"
    rate_limit: 50.0
  mav_frame: LOCAL_NED

# setpoint_velocity
setpoint_velocity:
  mav_frame: LOCAL_NED

# vfr_hud
# None

# waypoint
mission:
  pull_after_gcs: true  # update mission if gcs updates

# --- mavros extras plugins (same order) ---

# adsb
# None

# debug_value
# None

# distance_sensor
## Currently available orientations:
#    Check http://wiki.ros.org/mavros/Enumerations
##
distance_sensor:
  rangefinder_pub:
    id: 0
    frame_id: "lidar"
    #orientation: PITCH_270 # sended by FCU
    field_of_view: 0.0  # XXX TODO
    send_tf: false
    sensor_position: {x:  0.0, y:  0.0, z:  -0.1}
  rangefinder_sub:
    subscriber: true
    id: 1
    orientation: PITCH_270  # only that orientation are supported by APM 3.4+

# image_pub
image:
  frame_id: "px4flow"

# fake_gps
fake_gps:
  # select data source
  use_mocap: true         # ~mocap/pose
  mocap_transform: false   # ~mocap/tf instead of pose
  use_vision: false       # ~vision (pose)
  # origin (default: Zürich)
  geo_origin:
    lat: 47.3667          # latitude [degrees]
    lon: 8.5500           # longitude [degrees]
    alt: 408.0            # altitude (height over the WGS-84 ellipsoid) [meters]
  eph: 2.0
  epv: 2.0
  satellites_visible: 5   # virtual number of visible satellites
  fix_type: 3             # type of GPS fix (default: 3D)
  tf:
    listen: false
    send: false           # send TF?
    frame_id: "map"       # TF frame_id
    child_frame_id: "fix" # TF child_frame_id
    rate_limit: 10.0      # TF rate
  gps_rate: 5.0           # GPS data publishing rate

# mocap_pose_estimate
mocap:
  # select mocap source
  use_tf: false   # ~mocap/tf
  use_pose: true  # ~mocap/pose

# odom
odometry:
  frame_tf:
    desired_frame: "ned"
  estimator_type: 3 # check enum MAV_ESTIMATOR_TYPE in <http://mavlink.org/messages/common>

# px4flow
px4flow:
  frame_id: "px4flow"
  ranger_fov: !degrees 6.8  # 6.8 degreens at 5 meters, 31 degrees at 1 meter
  ranger_min_range: 0.3     # meters
  ranger_max_range: 5.0     # meters

# vision_pose_estimate
vision_pose:
  tf:
    listen: false           # enable tf listener (disable topic subscribers)
    frame_id: "map"
    child_frame_id: "vision_estimate"
    rate_limit: 10.0

# vision_speed_estimate
vision_speed:
  listen_twist: true    # enable listen to twist topic, else listen to vec3d topic
  twist_cov: true       # enable listen to twist with covariance topic

# vibration
vibration:
  frame_id: "base_link"

# vim:set ts=2 sw=2 et:

Thanks for your support!


(Jacob) #2

There should be no need to set home location. Guided mode is required to send velocity/position commands.

I don’t know how /mavros/local_position/pose is populated, but I get the LOCAL_POSITION_NED messages after gps lock and the light goes green here.