mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
simulator: fix after px4_task_spawn_cmd change
argv[0] now contains the task name, so everything moves by one.
This commit is contained in:
@@ -69,14 +69,14 @@ int Simulator::start(int argc, char *argv[])
|
|||||||
_instance = new Simulator();
|
_instance = new Simulator();
|
||||||
|
|
||||||
if (_instance) {
|
if (_instance) {
|
||||||
if (argc == 4 && strcmp(argv[2], "-u") == 0) {
|
if (argc == 5 && strcmp(argv[3], "-u") == 0) {
|
||||||
_instance->set_ip(InternetProtocol::UDP);
|
_instance->set_ip(InternetProtocol::UDP);
|
||||||
_instance->set_port(atoi(argv[3]));
|
_instance->set_port(atoi(argv[4]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc == 4 && strcmp(argv[2], "-c") == 0) {
|
if (argc == 5 && strcmp(argv[3], "-c") == 0) {
|
||||||
_instance->set_ip(InternetProtocol::TCP);
|
_instance->set_ip(InternetProtocol::TCP);
|
||||||
_instance->set_port(atoi(argv[3]));
|
_instance->set_port(atoi(argv[4]));
|
||||||
}
|
}
|
||||||
|
|
||||||
_instance->run();
|
_instance->run();
|
||||||
|
|||||||
Reference in New Issue
Block a user