Skip to content

Commit

Permalink
pwm_out: delete fake() test command
Browse files Browse the repository at this point in the history
 - we have better motor test facilities these days
  • Loading branch information
dagar committed Mar 31, 2020
1 parent ca81175 commit 2e2b9a9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
48 changes: 0 additions & 48 deletions src/drivers/pwm_out/PWMOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1802,48 +1802,6 @@ int PWMOut::test()
return rv;
}

int PWMOut::fake(int argc, char *argv[])
{
if (argc < 5) {
print_usage("not enough arguments");
return -1;
}

actuator_controls_s ac;

ac.control[0] = strtol(argv[1], 0, 0) / 100.0f;

ac.control[1] = strtol(argv[2], 0, 0) / 100.0f;

ac.control[2] = strtol(argv[3], 0, 0) / 100.0f;

ac.control[3] = strtol(argv[4], 0, 0) / 100.0f;

orb_advert_t handle = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &ac);

if (handle == nullptr) {
PX4_ERR("advertise failed");
return -1;
}

orb_unadvertise(handle);

actuator_armed_s aa;

aa.armed = true;
aa.lockdown = false;

handle = orb_advertise(ORB_ID(actuator_armed), &aa);

if (handle == nullptr) {
PX4_ERR("advertise failed 2");
return -1;
}

orb_unadvertise(handle);
return 0;
}

int PWMOut::custom_command(int argc, char *argv[])
{
PortMode new_mode = PORT_MODE_UNSET;
Expand Down Expand Up @@ -1983,10 +1941,6 @@ int PWMOut::custom_command(int argc, char *argv[])
return test();
}

if (!strcmp(verb, "fake")) {
return fake(argc - 1, argv + 1);
}

return print_usage("unknown command");
}

Expand Down Expand Up @@ -2115,8 +2069,6 @@ mixer files.
PRINT_MODULE_USAGE_ARG("<bus_id> <rate>", "Specify the bus id (>=0) and rate in Hz", false);

PRINT_MODULE_USAGE_COMMAND_DESCR("test", "Test inputs and outputs");
PRINT_MODULE_USAGE_COMMAND_DESCR("fake", "Arm and send an actuator controls command");
PRINT_MODULE_USAGE_ARG("<roll> <pitch> <yaw> <thrust>", "Control values in range [-100, 100]", false);
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/pwm_out/PWMOut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ class PWMOut : public cdev::CDev, public ModuleBase<PWMOut>, public OutputModule

static int test();

static int fake(int argc, char *argv[]);

virtual int ioctl(file *filp, int cmd, unsigned long arg);

virtual int init();
Expand Down

0 comments on commit 2e2b9a9

Please sign in to comment.