29 #include <boost/foreach.hpp> 35 template<
class CommandType>
38 :
GenericUpdater<CommandType>(update_configs_vector, update_state), even_motors(1)
42 template<
class CommandType>
46 if (!this->
mutex->try_lock())
73 command->from_motor_data_type =
76 ROS_DEBUG_STREAM(
"Updating initialization data type: " << command->from_motor_data_type <<
" | [" <<
77 this->which_data_to_request <<
"/" << this->initialization_configs_vector.size() <<
"] ");
85 command->which_motors = 0;
86 command->from_motor_data_type =
88 ROS_DEBUG_STREAM(
"Updating important data type: " << command->from_motor_data_type <<
" | [" <<
89 this->which_data_to_request <<
"/" << this->important_update_configs_vector.size() <<
"] ");
92 this->
mutex->unlock();
97 template<
class CommandType>
100 if (!this->
mutex->try_lock())
130 ROS_DEBUG_STREAM(
"Updating unimportant data type: " << command->from_motor_data_type <<
" | queue size: " <<
131 this->unimportant_data_queue.size());
136 command->from_motor_data_type =
139 ROS_DEBUG_STREAM(
"Updating important data type: " << command->from_motor_data_type <<
" | [" <<
140 this->which_data_to_request <<
"/" << this->important_update_configs_vector.size() <<
"] ");
143 this->
mutex->unlock();
std::queue< int32u, std::list< int32u > > unimportant_data_queue
int which_data_to_request
iterate through the important or initialization data types.
operation_mode::device_update_state::DeviceUpdateState update_state
operation_mode::device_update_state::DeviceUpdateState build_init_command(CommandType *command)
boost::shared_ptr< boost::mutex > mutex
operation_mode::device_update_state::DeviceUpdateState build_command(CommandType *command)
std::vector< UpdateConfig > initialization_configs_vector
#define ROS_DEBUG_STREAM(args)
std::vector< UpdateConfig > important_update_configs_vector
Contains all the important data types.
MotorUpdater(std::vector< UpdateConfig > update_configs_vector, operation_mode::device_update_state::DeviceUpdateState update_state)