34 std::vector<UpdateConfig> initialization_configs_vector)
37 init(joints_vector, initialization_configs_vector);
44 for (
unsigned int j = 0; j <
msg_checkers_.at(i).msg_from_motor_checkers.size(); j++)
52 std::vector<UpdateConfig> initialization_configs_vector)
60 std::vector<UpdateConfig>::iterator msg_it;
62 for (msg_it = initialization_configs_vector.begin(); msg_it < initialization_configs_vector.end(); msg_it++)
64 MessageChecker tmp_msg_checker(static_cast<FROM_MOTOR_DATA_TYPE>(msg_it->what_to_update));
65 for (std::vector<shadow_joints::Joint>::iterator joint = joints_vector.begin();
66 joint != joints_vector.end();
69 if (joint->has_actuator)
90 int index_motor_data_type = 0;
92 index_motor_data_type =
find(motor_data_type);
93 if (index_motor_data_type != (-1))
95 int index_motor_id = 0;
98 index_motor_id =
msg_checkers_.at(index_motor_data_type).find(motor_wrapper->motor_id);
99 if (index_motor_id != (-1))
105 msg_checkers_.at(index_motor_data_type).msg_from_motor_checkers.at(index_motor_id));
107 if (ptr_tmp_checker != NULL)
109 ptr_tmp_checker->
set_received(static_cast<FROM_MOTOR_SLOW_DATA_TYPE>(motor_slow_data_type));
118 msg_checkers_.at(index_motor_data_type).msg_from_motor_checkers.at(index_motor_id)->set_received();
131 std::vector<MessageChecker>::iterator it;
135 std::vector<MessageFromMotorChecker *>::iterator it2;
137 for (it2 = it->msg_from_motor_checkers.begin(); it2 < it->msg_from_motor_checkers.end(); it2++)
139 if (!(*it2)->get_received())
169 ROS_ERROR_STREAM(
"Motor Initialization Timeout: the static information in the diagnostics may not be uptodate.");
175 for (
unsigned int i = 0; i < msg_from_motor_checkers.size(); i++)
177 if (msg_from_motor_checkers.at(i)->motor_id_ == motor_id)
virtual void set_received()
void timer_callback(const ros::TimerEvent &event)
int find(FROM_MOTOR_DATA_TYPE motor_data_type)
ros::Duration init_max_duration
MOTOR_SLOW_DATA_SVN_REVISION
ros::Timer check_timeout_timer
operation_mode::device_update_state::DeviceUpdateState update_state
MotorDataChecker(std::vector< shadow_joints::Joint > joints_vector, std::vector< UpdateConfig > initialization_configs_vector)
boost::array< bool, MOTOR_SLOW_DATA_LAST+1 > slow_data_received
std::vector< MessageFromMotorChecker * > msg_from_motor_checkers
std::vector< MessageChecker > msg_checkers_
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
virtual void set_received(FROM_MOTOR_SLOW_DATA_TYPE slow_data_type)
bool check_message(std::vector< shadow_joints::Joint >::iterator joint_tmp, FROM_MOTOR_DATA_TYPE motor_data_type, int16u motor_slow_data_type)
void init(std::vector< shadow_joints::Joint > joints_vector, std::vector< UpdateConfig > initialization_configs_vector)
bool is_everything_checked()
SlowMessageFromMotorChecker(int id)
#define ROS_ERROR_STREAM(args)
FROM_MOTOR_SLOW_DATA_TYPE
static const double timeout