mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 17:53:59 -04:00
AP_HAL_SITL: remove unused code
This commit is contained in:
parent
f984e5e31d
commit
46868409ec
@ -66,9 +66,6 @@ void SITL_State::_sitl_setup(const char *home_str)
|
|||||||
#if !defined(__CYGWIN__) && !defined(__CYGWIN64__)
|
#if !defined(__CYGWIN__) && !defined(__CYGWIN64__)
|
||||||
_parent_pid = getppid();
|
_parent_pid = getppid();
|
||||||
#endif
|
#endif
|
||||||
_rcout_addr.sin_family = AF_INET;
|
|
||||||
_rcout_addr.sin_port = htons(_rcout_port);
|
|
||||||
inet_pton(AF_INET, _fdm_address, &_rcout_addr.sin_addr);
|
|
||||||
|
|
||||||
#ifndef HIL_MODE
|
#ifndef HIL_MODE
|
||||||
_setup_fdm();
|
_setup_fdm();
|
||||||
|
@ -70,9 +70,6 @@ public:
|
|||||||
uint16_t voltage2_pin_value; // pin 15
|
uint16_t voltage2_pin_value; // pin 15
|
||||||
uint16_t current2_pin_value; // pin 14
|
uint16_t current2_pin_value; // pin 14
|
||||||
|
|
||||||
// return TCP client address for uartC
|
|
||||||
const char *get_client_address(void) const { return _client_address; }
|
|
||||||
|
|
||||||
// paths for UART devices
|
// paths for UART devices
|
||||||
const char *_uart_path[6] {
|
const char *_uart_path[6] {
|
||||||
"tcp:0:wait",
|
"tcp:0:wait",
|
||||||
@ -149,7 +146,6 @@ private:
|
|||||||
uint16_t _framerate;
|
uint16_t _framerate;
|
||||||
uint8_t _instance;
|
uint8_t _instance;
|
||||||
uint16_t _base_port;
|
uint16_t _base_port;
|
||||||
struct sockaddr_in _rcout_addr;
|
|
||||||
pid_t _parent_pid;
|
pid_t _parent_pid;
|
||||||
uint32_t _update_count;
|
uint32_t _update_count;
|
||||||
|
|
||||||
@ -163,7 +159,6 @@ private:
|
|||||||
|
|
||||||
SocketAPM _sitl_rc_in{true};
|
SocketAPM _sitl_rc_in{true};
|
||||||
SITL::SITL *_sitl;
|
SITL::SITL *_sitl;
|
||||||
uint16_t _rcout_port;
|
|
||||||
uint16_t _rcin_port;
|
uint16_t _rcin_port;
|
||||||
uint16_t _fg_view_port;
|
uint16_t _fg_view_port;
|
||||||
uint16_t _irlock_port;
|
uint16_t _irlock_port;
|
||||||
@ -220,9 +215,6 @@ private:
|
|||||||
// output socket for flightgear viewing
|
// output socket for flightgear viewing
|
||||||
SocketAPM fg_socket{true};
|
SocketAPM fg_socket{true};
|
||||||
|
|
||||||
// TCP address to connect uartC to
|
|
||||||
const char *_client_address;
|
|
||||||
|
|
||||||
const char *defaults_path = HAL_PARAM_DEFAULTS_PATH;
|
const char *defaults_path = HAL_PARAM_DEFAULTS_PATH;
|
||||||
|
|
||||||
const char *_home_str;
|
const char *_home_str;
|
||||||
|
@ -55,7 +55,6 @@ void SITL_State::_usage(void)
|
|||||||
"\t--home|-O HOME set home location (lat,lng,alt,yaw)\n"
|
"\t--home|-O HOME set home location (lat,lng,alt,yaw)\n"
|
||||||
"\t--model|-M MODEL set simulation model\n"
|
"\t--model|-M MODEL set simulation model\n"
|
||||||
"\t--fdm|-F ADDRESS set FDM address, defaults to 127.0.0.1\n"
|
"\t--fdm|-F ADDRESS set FDM address, defaults to 127.0.0.1\n"
|
||||||
// "\t--client ADDRESS TCP address to connect uartC to\n" NOT USED
|
|
||||||
"\t--gimbal enable simulated MAVLink gimbal\n"
|
"\t--gimbal enable simulated MAVLink gimbal\n"
|
||||||
"\t--disable-fgview disable Flight Gear view\n"
|
"\t--disable-fgview disable Flight Gear view\n"
|
||||||
"\t--autotest-dir DIR set directory for additional files\n"
|
"\t--autotest-dir DIR set directory for additional files\n"
|
||||||
@ -69,7 +68,6 @@ void SITL_State::_usage(void)
|
|||||||
"\t--rtscts enable rtscts on serial ports (default false)\n"
|
"\t--rtscts enable rtscts on serial ports (default false)\n"
|
||||||
"\t--base-port PORT set port num for base port(default 5670) must be before -I option\n"
|
"\t--base-port PORT set port num for base port(default 5670) must be before -I option\n"
|
||||||
"\t--rc-in-port PORT set port num for rc in\n"
|
"\t--rc-in-port PORT set port num for rc in\n"
|
||||||
"\t--rc-out-port PORT set port num for rc out\n"
|
|
||||||
"\t--sim-address ADDR set address string for simulator\n"
|
"\t--sim-address ADDR set address string for simulator\n"
|
||||||
"\t--sim-port-in PORT set port num for simulator in\n"
|
"\t--sim-port-in PORT set port num for simulator in\n"
|
||||||
"\t--sim-port-out PORT set port num for simulator out\n"
|
"\t--sim-port-out PORT set port num for simulator out\n"
|
||||||
@ -135,18 +133,15 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
// default to CMAC
|
// default to CMAC
|
||||||
const char *home_str = "-35.363261,149.165230,584,353";
|
const char *home_str = "-35.363261,149.165230,584,353";
|
||||||
const char *model_str = nullptr;
|
const char *model_str = nullptr;
|
||||||
_client_address = nullptr;
|
|
||||||
_use_fg_view = true;
|
_use_fg_view = true;
|
||||||
char *autotest_dir = nullptr;
|
char *autotest_dir = nullptr;
|
||||||
_fdm_address = "127.0.0.1";
|
_fdm_address = "127.0.0.1";
|
||||||
|
|
||||||
const int BASE_PORT = 5760;
|
const int BASE_PORT = 5760;
|
||||||
const int RCIN_PORT = 5501;
|
const int RCIN_PORT = 5501;
|
||||||
const int RCOUT_PORT = 5502;
|
|
||||||
const int FG_VIEW_PORT = 5503;
|
const int FG_VIEW_PORT = 5503;
|
||||||
_base_port = BASE_PORT;
|
_base_port = BASE_PORT;
|
||||||
_rcin_port = RCIN_PORT;
|
_rcin_port = RCIN_PORT;
|
||||||
_rcout_port = RCOUT_PORT;
|
|
||||||
_fg_view_port = FG_VIEW_PORT;
|
_fg_view_port = FG_VIEW_PORT;
|
||||||
|
|
||||||
const int SIM_IN_PORT = 9003;
|
const int SIM_IN_PORT = 9003;
|
||||||
@ -158,8 +153,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
_irlock_port = IRLOCK_PORT;
|
_irlock_port = IRLOCK_PORT;
|
||||||
|
|
||||||
enum long_options {
|
enum long_options {
|
||||||
CMDLINE_CLIENT = 0,
|
CMDLINE_GIMBAL = 1,
|
||||||
CMDLINE_GIMBAL,
|
|
||||||
CMDLINE_FGVIEW,
|
CMDLINE_FGVIEW,
|
||||||
CMDLINE_AUTOTESTDIR,
|
CMDLINE_AUTOTESTDIR,
|
||||||
CMDLINE_DEFAULTS,
|
CMDLINE_DEFAULTS,
|
||||||
@ -172,8 +166,7 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
CMDLINE_RTSCTS,
|
CMDLINE_RTSCTS,
|
||||||
CMDLINE_BASE_PORT,
|
CMDLINE_BASE_PORT,
|
||||||
CMDLINE_RCIN_PORT,
|
CMDLINE_RCIN_PORT,
|
||||||
CMDLINE_RCOUT_PORT,
|
CMDLINE_SIM_ADDRESS = 15,
|
||||||
CMDLINE_SIM_ADDRESS,
|
|
||||||
CMDLINE_SIM_PORT_IN,
|
CMDLINE_SIM_PORT_IN,
|
||||||
CMDLINE_SIM_PORT_OUT,
|
CMDLINE_SIM_PORT_OUT,
|
||||||
CMDLINE_IRLOCK_PORT,
|
CMDLINE_IRLOCK_PORT,
|
||||||
@ -192,7 +185,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
{"home", true, 0, 'O'},
|
{"home", true, 0, 'O'},
|
||||||
{"model", true, 0, 'M'},
|
{"model", true, 0, 'M'},
|
||||||
{"fdm", false, 0, 'F'},
|
{"fdm", false, 0, 'F'},
|
||||||
{"client", true, 0, CMDLINE_CLIENT},
|
|
||||||
{"gimbal", false, 0, CMDLINE_GIMBAL},
|
{"gimbal", false, 0, CMDLINE_GIMBAL},
|
||||||
{"disable-fgview", false, 0, CMDLINE_FGVIEW},
|
{"disable-fgview", false, 0, CMDLINE_FGVIEW},
|
||||||
{"autotest-dir", true, 0, CMDLINE_AUTOTESTDIR},
|
{"autotest-dir", true, 0, CMDLINE_AUTOTESTDIR},
|
||||||
@ -206,7 +198,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
{"rtscts", false, 0, CMDLINE_RTSCTS},
|
{"rtscts", false, 0, CMDLINE_RTSCTS},
|
||||||
{"base-port", true, 0, CMDLINE_BASE_PORT},
|
{"base-port", true, 0, CMDLINE_BASE_PORT},
|
||||||
{"rc-in-port", true, 0, CMDLINE_RCIN_PORT},
|
{"rc-in-port", true, 0, CMDLINE_RCIN_PORT},
|
||||||
{"rc-out-port", true, 0, CMDLINE_RCOUT_PORT},
|
|
||||||
{"sim-address", true, 0, CMDLINE_SIM_ADDRESS},
|
{"sim-address", true, 0, CMDLINE_SIM_ADDRESS},
|
||||||
{"sim-port-in", true, 0, CMDLINE_SIM_PORT_IN},
|
{"sim-port-in", true, 0, CMDLINE_SIM_PORT_IN},
|
||||||
{"sim-port-out", true, 0, CMDLINE_SIM_PORT_OUT},
|
{"sim-port-out", true, 0, CMDLINE_SIM_PORT_OUT},
|
||||||
@ -248,9 +239,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
if (_base_port == BASE_PORT) {
|
if (_base_port == BASE_PORT) {
|
||||||
_base_port += _instance * 10;
|
_base_port += _instance * 10;
|
||||||
}
|
}
|
||||||
if (_rcout_port == RCOUT_PORT) {
|
|
||||||
_rcout_port += _instance * 10;
|
|
||||||
}
|
|
||||||
if (_rcin_port == RCIN_PORT) {
|
if (_rcin_port == RCIN_PORT) {
|
||||||
_rcin_port += _instance * 10;
|
_rcin_port += _instance * 10;
|
||||||
}
|
}
|
||||||
@ -283,9 +271,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
case 'F':
|
case 'F':
|
||||||
_fdm_address = gopt.optarg;
|
_fdm_address = gopt.optarg;
|
||||||
break;
|
break;
|
||||||
case CMDLINE_CLIENT:
|
|
||||||
_client_address = gopt.optarg;
|
|
||||||
break;
|
|
||||||
case CMDLINE_GIMBAL:
|
case CMDLINE_GIMBAL:
|
||||||
enable_gimbal = true;
|
enable_gimbal = true;
|
||||||
break;
|
break;
|
||||||
@ -315,9 +300,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
|||||||
case CMDLINE_RCIN_PORT:
|
case CMDLINE_RCIN_PORT:
|
||||||
_rcin_port = atoi(gopt.optarg);
|
_rcin_port = atoi(gopt.optarg);
|
||||||
break;
|
break;
|
||||||
case CMDLINE_RCOUT_PORT:
|
|
||||||
_rcout_port = atoi(gopt.optarg);
|
|
||||||
break;
|
|
||||||
case CMDLINE_SIM_ADDRESS:
|
case CMDLINE_SIM_ADDRESS:
|
||||||
_simulator_address = gopt.optarg;
|
_simulator_address = gopt.optarg;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user