Accessing raw thrust channel values in firmware (PS4 controller)
Posted: Sun Dec 08, 2019 8:19 pm
Hey,
I am trying to implement a controller for the rate of ascend/descend, in which the ascend/descend speed is the setpoint given by the PS4-Controller. Therefore I need to read the raw "thrust" value from the gamepad, but with negative values as well. So that the midpoint is zero.
At which point of the firmware I can access these values? I already logged different values from the files "crtp_commander_generic.c" and "crtp_commander_rpyt.c" (e.g. values->channelThrust, rawThrust, values->thrust), but didn't get any value which could be negative. For me, it doesn't matter which assist-mode is chosen, because I am using my own attitude controller either way.
I also want to implement an autonomous flight maneuver which starts if a certain button is pressed on the gamepad. For this, I additionally need to read the state of another aux button. Does anybody know how to do that?
I would be very glad if someone could provide further information. Thank you very much!
I am trying to implement a controller for the rate of ascend/descend, in which the ascend/descend speed is the setpoint given by the PS4-Controller. Therefore I need to read the raw "thrust" value from the gamepad, but with negative values as well. So that the midpoint is zero.
At which point of the firmware I can access these values? I already logged different values from the files "crtp_commander_generic.c" and "crtp_commander_rpyt.c" (e.g. values->channelThrust, rawThrust, values->thrust), but didn't get any value which could be negative. For me, it doesn't matter which assist-mode is chosen, because I am using my own attitude controller either way.
I also want to implement an autonomous flight maneuver which starts if a certain button is pressed on the gamepad. For this, I additionally need to read the state of another aux button. Does anybody know how to do that?
I would be very glad if someone could provide further information. Thank you very much!