78 chprintf(sh,
"Actuator %d: driver no %d, servo idx %d\r\n", i,
80 chprintf(sh,
" min: %d, max: %d, neutral %d\r\n",
83 chprintf(sh,
" no set function registered");
93 chprintf(sh,
"Usage: actuator [command] [options]\r\n");
94 chprintf(sh,
" show [pprz_idx] Print list of actuators with their config or a single one\r\n");
95 chprintf(sh,
" get_pprz pprz_idx Get current actuator value in pprz unit\r\n");
96 chprintf(sh,
" get_driver driver_no servo_idx Get current actuator value in driver unit\r\n");
97 chprintf(sh,
" set_pprz pprz_idx value Set actuator value in pprz unit (values are bounded to [-9600; 9600])\r\n");
98 chprintf(sh,
" set_driver driver_no servo_idx value Set actuator value in driver unit (warning: values are not bounded)\r\n");
99 chprintf(sh,
" set_conf pprz_idx min max neutral Set actuator min, max and neutral values in driver unit (warning: values are not bounded)\r\n");
113 }
else if (
strcmp(
argv[0],
"get_pprz") == 0) {
118 }
else if (
strcmp(
argv[0],
"get_driver") == 0) {
124 }
else if (
strcmp(
argv[0],
"set_pprz") == 0) {
130 }
else if (
strcmp(
argv[0],
"set_driver") == 0) {
141 }
else if (
strcmp(
argv[0],
"set_conf") == 0) {
154 chprintf(sh,
"unknown actuator command\r\n");
164#if defined ACTUATORS_START_DELAY && ! defined SITL
173#if (defined INTERMCU_AP)
175#elif (defined INTERMCU_FBW)
183#if PERIODIC_TELEMETRY
217#if (defined INTERMCU_AP)
220#elif (defined INTERMCU_FBW)
257 actuators[i].config.servo_idx == servo_idx) {
uint8_t autopilot_get_mode(void)
get autopilot mode
pprz_t command_pitch_trim
Hardware independent code for commands handling.
static void send_actuators(struct transport_tx *trans, struct link_device *dev)
void chprintf(BaseSequentialStream *lchp, const char *fmt,...)
void intermcu_send_commands(pprz_t *command_values, uint8_t ap_mode)
send command vector over intermcu link instead of actuators
Inter-MCU on the AP side.
void actuators_periodic(void)
void actuators_init(void)
Hardware independent API for actuators (servos, motor controllers).
Mini printf-like functionality.
static const ShellCommand commands[]
void shell_add_entry(char *cmd_name, shell_cmd_t *cmd)
Add dynamic entry.
BaseSequentialStream shell_stream_t
static const struct usb_config_descriptor config
static const struct usb_device_descriptor dev
Architecture independent timing functions.
#define SysTimeTimerStart(_t)
int16_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint16_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.