00001 00002 #pragma once 00003 00005 // These variables are global b/c a ROS callback only takes 1 argument 00007 00008 static double t=0; // time will be updated by listening to the 'plant' ROS topic 00009 static double V=0; //current Lyapunov value 00010 static double V_initial=0; 00011 static int first_callback=1; // 1 signals that the callback has not been run yet. Triggers setup calcs 00012 00013 // Read the size of a plant_msg 00014 lyap_control::plant_msg temp_plant_msg; // Just to read the msg size 00015 const static int num_states = temp_plant_msg.x.size(); 00016 00017 // Message variable for the control effort message 00018 lyap_control::controller_msg u_msg; 00019 // Read the size of a 'controller' message 00020 const static int num_inputs = u_msg.u.size(); 00021 00022 ublas_vector x(num_states); 00023 ublas_vector setpoint(num_states); 00024 ublas_vector u(num_inputs); 00025 00026 // Convert user-specified aggressiveness from log to linear value 00027 static double V_dot_target_initial = 0;