Skip to content

Commit

Permalink
set the minimum scheduling interval for voxl2_io module to 5ms in ord…
Browse files Browse the repository at this point in the history
…er to fix rc input lag when all pwm outputs are disabled
  • Loading branch information
Alex Kushleyev authored and katzfey committed Jun 5, 2024
1 parent d150e6b commit 636ffef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/drivers/voxl2_io/voxl2_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Voxl2IO::Voxl2IO() :
_mixing_output.setMaxNumOutputs(VOXL2_IO_OUTPUT_CHANNELS);
_uart_port = new Voxl2IoSerial();
voxl2_io_packet_init(&_voxl2_io_packet);

//set low rate scheduling interval to 200hz so that RC can be updated even if all actuators are disabled
//otherwise, the default low rate scheduling interval is 300ms and RC packets are delayed and lost
_mixing_output.setLowrateSchedulingInterval(5_ms);
}

Voxl2IO::~Voxl2IO()
Expand Down Expand Up @@ -731,6 +735,10 @@ int Voxl2IO::custom_command(int argc, char *argv[])
return get_instance()->calibrate_escs();
}

if (!strcmp(verb,"enable_debug")){
get_instance()->_debug = true;
}

return print_usage("unknown custom command");
}

Expand Down

0 comments on commit 636ffef

Please sign in to comment.