9 PTHREAD_MUTEX_INITIALIZER;
28 #include <gui_main_control_settings_t.hpp> 32 #include <rc_channels_t.hpp> 41 const lcm::ReceiveBuffer *rbuf,
const std::string &channel,
42 const gui_main_control_settings_t *msg) {
53 const std::string &channel,
54 const rc_channels_t *msg) {
92 float v_scale = 2.0f * (((float)(ch7 - 172)) / 1811.0
f) + 1.0f;
98 }
else if (ch10 == 992) {
100 }
else if (ch10 == 1811) {
112 else if (ch9 == 992) {
115 else if ((ch9 == 172) && (ch13 == 1811)) {
118 else if ((ch9 == 172) && (ch13 == 992)) {
121 else if ((ch9 == 172) && (ch13 == 172)) {
139 -v_scale * ((float)ch4 - 1000) * .0005f;
146 -v_scale * ((float)ch2 - 1000) * .003f;
173 printf(
"[RT Interface LCM] Initializing...\n");
178 g_lcm->subscribe(
"INTERFACE_gui_main_control_settings",
185 printf(
"[RT Interface LCM] Done\n");
191 void *
v_memcpy(
void *dest,
volatile void *src,
size_t n) {
192 void *src_2 = (
void *)src;
193 return memcpy(dest, src_2, n);
void main_control_settings_handler(const lcm::ReceiveBuffer *rbuf, const std::string &channel, const gui_main_control_settings_t *msg)
Handler for main control settings from MATLAB interface. Never call this yourself, leave it to LCM.
void init_interface_lcm(lcm::LCM *main_lcm)
Initializer for all handlers related to the interface LCM streams.
void get_rc_channels(void *settings)
void * v_memcpy(void *dest, volatile void *src, size_t n)
void get_main_control_settings(void *settings)
rc_channels_t rc_channels
int read_sbus_channel(int channel)
void sbus_packet_complete()
Function which handles the completion of an SBUS Packet and overrides the LCM control settings as des...
static pthread_mutex_t lcm_get_set_mutex
int get_iterations_since_last_lcm()
Gets the iterations since the last lcm.
void rc_channels_handler(const lcm::ReceiveBuffer *rbuf, const std::string &channel, const rc_channels_t *msg)
gui_main_control_settings_t main_control_settings
void control_iteration_lcm()
Increments the number of control iterations since the last LCM packet.
int iterations_since_last_lcm
MX f(const MX &x, const MX &u)