Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion libraries/AP_HAL/SIMState.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class AP_HAL::SIMState {
SITL::SIM *_sitl;

#if CONFIG_HAL_BOARD != HAL_BOARD_SITL
void _set_param_default(const char *parm);
void _sitl_setup(const char *home_str);
void _setup_timer(void);
void _setup_adc(void);
Expand Down
33 changes: 0 additions & 33 deletions libraries/AP_HAL_SITL/SITL_State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,6 @@ extern const AP_HAL::HAL& hal;

using namespace HALSITL;

void SITL_State::_set_param_default(const char *parm)
{
char *pdup = strdup(parm);
char *p = strchr(pdup, '=');
if (p == nullptr) {
printf("Please specify parameter as NAME=VALUE");
exit(1);
}
float value = strtof(p+1, nullptr);
*p = 0;
enum ap_var_type var_type;
AP_Param *vp = AP_Param::find(pdup, &var_type);
if (vp == nullptr) {
printf("Unknown parameter %s\n", pdup);
exit(1);
}
if (var_type == AP_PARAM_FLOAT) {
((AP_Float *)vp)->set_and_save(value);
} else if (var_type == AP_PARAM_INT32) {
((AP_Int32 *)vp)->set_and_save(value);
} else if (var_type == AP_PARAM_INT16) {
((AP_Int16 *)vp)->set_and_save(value);
} else if (var_type == AP_PARAM_INT8) {
((AP_Int8 *)vp)->set_and_save(value);
} else {
printf("Unable to set parameter %s\n", pdup);
exit(1);
}
printf("Set parameter %s to %f\n", pdup, value);
free(pdup);
}


/*
setup for SITL handling
*/
Expand Down
1 change: 0 additions & 1 deletion libraries/AP_HAL_SITL/SITL_State.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class HALSITL::SITL_State : public SITL_State_Common {

private:
void _parse_command_line(int argc, char * const argv[]);
void _set_param_default(const char *parm);
void _usage(void);
void _sitl_setup();
void _setup_timer(void);
Expand Down
5 changes: 0 additions & 5 deletions libraries/AP_HAL_SITL/SITL_cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ void SITL_State::_usage(void)
"\t--rate|-r RATE set SITL framerate\n"
"\t--console|-C use console instead of TCP ports\n"
"\t--instance|-I N set instance of SITL (adds 10*instance to all port numbers)\n"
// "\t--param|-P NAME=VALUE set some param\n" CURRENTLY BROKEN!
"\t--synthetic-clock|-S set synthetic clock mode\n"
"\t--home|-O HOME set start location (lat,lng,alt,yaw) or location name\n"
"\t--model|-M MODEL set simulation model\n"
Expand Down Expand Up @@ -322,7 +321,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
{"rate", true, 0, 'r'},
{"console", false, 0, 'C'},
{"instance", true, 0, 'I'},
{"param", true, 0, 'P'},
{"synthetic-clock", false, 0, 'S'},
{"home", true, 0, 'O'},
{"model", true, 0, 'M'},
Expand Down Expand Up @@ -444,9 +442,6 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
}
}
break;
case 'P':
_set_param_default(gopt.optarg);
break;
case 'S':
printf("Ignoring stale command-line parameter '-S'");
break;
Expand Down
Loading