Skip to content

Commit 21f6a8b

Browse files
committed
Delete SITL's --param feature, which is broken anyway
1 parent f9fcf06 commit 21f6a8b

File tree

3 files changed

+0
-39
lines changed

3 files changed

+0
-39
lines changed

libraries/AP_HAL_SITL/SITL_State.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,6 @@ extern const AP_HAL::HAL& hal;
3131

3232
using namespace HALSITL;
3333

34-
void SITL_State::_set_param_default(const char *parm)
35-
{
36-
char *pdup = strdup(parm);
37-
char *p = strchr(pdup, '=');
38-
if (p == nullptr) {
39-
printf("Please specify parameter as NAME=VALUE");
40-
exit(1);
41-
}
42-
float value = strtof(p+1, nullptr);
43-
*p = 0;
44-
enum ap_var_type var_type;
45-
AP_Param *vp = AP_Param::find(pdup, &var_type);
46-
if (vp == nullptr) {
47-
printf("Unknown parameter %s\n", pdup);
48-
exit(1);
49-
}
50-
if (var_type == AP_PARAM_FLOAT) {
51-
((AP_Float *)vp)->set_and_save(value);
52-
} else if (var_type == AP_PARAM_INT32) {
53-
((AP_Int32 *)vp)->set_and_save(value);
54-
} else if (var_type == AP_PARAM_INT16) {
55-
((AP_Int16 *)vp)->set_and_save(value);
56-
} else if (var_type == AP_PARAM_INT8) {
57-
((AP_Int8 *)vp)->set_and_save(value);
58-
} else {
59-
printf("Unable to set parameter %s\n", pdup);
60-
exit(1);
61-
}
62-
printf("Set parameter %s to %f\n", pdup, value);
63-
free(pdup);
64-
}
65-
66-
6734
/*
6835
setup for SITL handling
6936
*/

libraries/AP_HAL_SITL/SITL_State.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class HALSITL::SITL_State : public SITL_State_Common {
5757

5858
private:
5959
void _parse_command_line(int argc, char * const argv[]);
60-
void _set_param_default(const char *parm);
6160
void _usage(void);
6261
void _sitl_setup();
6362
void _setup_timer(void);

libraries/AP_HAL_SITL/SITL_cmdline.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ void SITL_State::_usage(void)
8686
"\t--rate|-r RATE set SITL framerate\n"
8787
"\t--console|-C use console instead of TCP ports\n"
8888
"\t--instance|-I N set instance of SITL (adds 10*instance to all port numbers)\n"
89-
// "\t--param|-P NAME=VALUE set some param\n" CURRENTLY BROKEN!
9089
"\t--synthetic-clock|-S set synthetic clock mode\n"
9190
"\t--home|-O HOME set start location (lat,lng,alt,yaw) or location name\n"
9291
"\t--model|-M MODEL set simulation model\n"
@@ -322,7 +321,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
322321
{"rate", true, 0, 'r'},
323322
{"console", false, 0, 'C'},
324323
{"instance", true, 0, 'I'},
325-
{"param", true, 0, 'P'},
326324
{"synthetic-clock", false, 0, 'S'},
327325
{"home", true, 0, 'O'},
328326
{"model", true, 0, 'M'},
@@ -444,9 +442,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
444442
}
445443
}
446444
break;
447-
case 'P':
448-
_set_param_default(gopt.optarg);
449-
break;
450445
case 'S':
451446
printf("Ignoring stale command-line parameter '-S'");
452447
break;

0 commit comments

Comments
 (0)