mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 20:53:34 +08:00
new mode for fake gps
This commit is contained in:
@@ -564,6 +564,10 @@ then
|
|||||||
then
|
then
|
||||||
mavlink start -d /dev/ttyS2 -b 57600 -m osd -r 1000
|
mavlink start -d /dev/ttyS2 -b 57600 -m osd -r 1000
|
||||||
fi
|
fi
|
||||||
|
if param compare SYS_COMPANION 257600
|
||||||
|
then
|
||||||
|
mavlink start -d /dev/ttyS2 -b 57600 -m magic -r 5000 -x
|
||||||
|
fi
|
||||||
# Sensors on the PWM interface bank
|
# Sensors on the PWM interface bank
|
||||||
# clear pins 5 and 6
|
# clear pins 5 and 6
|
||||||
if param compare SENS_EN_LL40LS 1
|
if param compare SENS_EN_LL40LS 1
|
||||||
|
|||||||
@@ -1523,6 +1523,9 @@ Mavlink::task_main(int argc, char *argv[])
|
|||||||
} else if (strcmp(myoptarg, "osd") == 0) {
|
} else if (strcmp(myoptarg, "osd") == 0) {
|
||||||
_mode = MAVLINK_MODE_OSD;
|
_mode = MAVLINK_MODE_OSD;
|
||||||
|
|
||||||
|
} else if (strcmp(myoptarg, "magic") == 0) {
|
||||||
|
_mode = MAVLINK_MODE_MAGIC;
|
||||||
|
|
||||||
} else if (strcmp(myoptarg, "config") == 0) {
|
} else if (strcmp(myoptarg, "config") == 0) {
|
||||||
_mode = MAVLINK_MODE_CONFIG;
|
_mode = MAVLINK_MODE_CONFIG;
|
||||||
}
|
}
|
||||||
@@ -1709,7 +1712,7 @@ Mavlink::task_main(int argc, char *argv[])
|
|||||||
configure_stream("SYSTEM_TIME", 1.0f);
|
configure_stream("SYSTEM_TIME", 1.0f);
|
||||||
configure_stream("TIMESYNC", 10.0f);
|
configure_stream("TIMESYNC", 10.0f);
|
||||||
configure_stream("ACTUATOR_CONTROL_TARGET0", 10.0f);
|
configure_stream("ACTUATOR_CONTROL_TARGET0", 10.0f);
|
||||||
/* camera trigger is rate limited at the source, do not limit here */
|
//camera trigger is rate limited at the source, do not limit here
|
||||||
configure_stream("CAMERA_TRIGGER", 500.0f);
|
configure_stream("CAMERA_TRIGGER", 500.0f);
|
||||||
configure_stream("EXTENDED_SYS_STATE", 2.0f);
|
configure_stream("EXTENDED_SYS_STATE", 2.0f);
|
||||||
break;
|
break;
|
||||||
@@ -1729,6 +1732,10 @@ Mavlink::task_main(int argc, char *argv[])
|
|||||||
configure_stream("EXTENDED_SYS_STATE", 1.0f);
|
configure_stream("EXTENDED_SYS_STATE", 1.0f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MAVLINK_MODE_MAGIC:
|
||||||
|
//stream nothing
|
||||||
|
break;
|
||||||
|
|
||||||
case MAVLINK_MODE_CONFIG:
|
case MAVLINK_MODE_CONFIG:
|
||||||
// Enable a number of interesting streams we want via USB
|
// Enable a number of interesting streams we want via USB
|
||||||
configure_stream("SYS_STATUS", 1.0f);
|
configure_stream("SYS_STATUS", 1.0f);
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ public:
|
|||||||
MAVLINK_MODE_CUSTOM,
|
MAVLINK_MODE_CUSTOM,
|
||||||
MAVLINK_MODE_ONBOARD,
|
MAVLINK_MODE_ONBOARD,
|
||||||
MAVLINK_MODE_OSD,
|
MAVLINK_MODE_OSD,
|
||||||
|
MAVLINK_MODE_MAGIC,
|
||||||
MAVLINK_MODE_CONFIG
|
MAVLINK_MODE_CONFIG
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user