00001 #include "ros/ros.h" 00002 00003 // Header for 'plant_msg.msg' 00004 #include "lyap_control/plant_msg.h" 00005 00006 // Header for controller_msg.msg 00007 #include "lyap_control/controller_msg.h" 00008 00010 // User-defined variables -- Make changes here. 00012 00013 static const int num_states=2; 00014 static const int num_inputs=2; 00015 00016 // Initial conditions 00017 static const double x_IC [num_states] = {0.1, -0.2}; 00018 static const double t_IC = 0.0; 00019 static const double setpoint [num_states] = {1.0, -2.0}; 00020 00021 double delta_t = 0.001; // control period in seconds 00022 00023 // Global so it can be passed from the callback fxn to main 00024 static double u[num_inputs] = {0.0, 0.0}; 00025 00026 00028 // Functions 00030 00031 void chatterCallback(const lyap_control::controller_msg& u_msg);