Changeset 11 for trunk/extremum_seeking/esc_ros/src
- Timestamp:
- 08/16/12 15:19:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/extremum_seeking/esc_ros/src/esc_ros.cpp
r5 r11 49 49 50 50 if(monitor_){ 51 pub_monitor_ = n_->advertise<esc_ros:: monitor>("monitor_out",1);51 pub_monitor_ = n_->advertise<esc_ros::Monitors>("monitor_out",1); 52 52 } 53 53 … … 57 57 } 58 58 59 void ESCROS::objValWithStateCallback(esc_ros:: esc_w_state msg)59 void ESCROS::objValWithStateCallback(esc_ros::StateValue msg) 60 60 { 61 obj_val_ = msg.obj_val; 62 state_vec_ = msg.states; 61 obj_val_ = msg.value; 62 state_vec_.resize(msg.state.size()); 63 for (size_t ii=0; ii < state_vec_.size(); ++ii) 64 state_vec_[ii] = msg.state[ii]; 63 65 if(!first_obj_val_received_) 64 66 first_obj_val_received_ = true; … … 97 99 98 100 if(monitor_){ 99 esc_ros::monitor msg_monitor; 100 msg_monitor.monitor_values = esc_->monitor(); 101 msg_monitor.monitor_names = esc_->monitorNames(); 101 esc_ros::Monitors msg_monitor; 102 std::vector<double> values = esc_->monitor(); 103 104 msg_monitor.values.resize(values.size()); 105 for (size_t ii=0; ii < values.size(); ++ii) 106 msg_monitor.values[ii] = values[ii]; 107 msg_monitor.names = esc_->monitorNames(); 102 108 pub_monitor_.publish(msg_monitor); 103 109 }
Note: See TracChangeset
for help on using the changeset viewer.