Hello everyone,
I am just getting started with a BlueROV Heavy and as a first “programming exercise” I tried implementing a couple of custom joystick button functions to turn the lights on and off. However, I can’t get it to work.
Going on the information I found on Joystick Setup Page · GitBook, I added my code to the custom case
statements in the big switch in Sub::handle_jsbutton_press
in ArduSub/joystick.cpp
and then assigned those custom functions to joystick buttons in QGC. However, when I upload my .apj file to the ROV, QGC occasionally says “IMU forced reset” and also the normal lights functions (brighter and darker) don’t seem anymore. Here is my code, starting on line 573 in joystick.cpp
. I simply copied from the k_lights1_brighter
and k_lights1_darker
cases and modified it slightly.
case JSButton::button_function_t::k_custom_1:
// make lights really bright
if (!held) {
RC_Channel* chan = RC_Channels::rc_channel(8);
uint16_t max = chan->get_radio_max();
lights1 = max;
}
break;
case JSButton::button_function_t::k_custom_2:
// make lights really dark
if (!held) {
RC_Channel* chan = RC_Channels::rc_channel(8);
uint16_t min = chan->get_radio_min();
lights1 = min;
}
break;
There are no errors when building the package. I am on Windows 10 with Eclipse and my code base is the most current version from Github.
Could anybody please point me into the right direction? I’m sure I must be missing something but I don’t really know where to start looking.
Thank you!
Anne