示例#1
0
void wgt_spkm_int::init()
{

	try {

		if (robot->state.edp.pid != -1) {
			if (robot->state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				//ui.pushButton_execute->setDisabled(false);

				robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.set_request();
				robot->ui_ecp_robot->execute_motion();
				robot->ui_ecp_robot->the_robot->epos_joint_reply_data_request_port.get();

				for (int i = 0; i < robot->number_of_servos; i++) {
					set_single_axis(i, doubleSpinBox_mcur_Vector[i], doubleSpinBox_cur_Vector[i], radioButton_mip_Vector[i]);
					robot->desired_pos[i] = robot->current_pos[i];
				}

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				//ui.pushButton_execute->setDisabled(true);
			}
		}

	} // end try
	CATCH_SECTION_UI_PTR
}
示例#2
0
int wgt_spkm_ext::init()
{

	try {

		if (robot.state.edp.pid != -1) {
			if (robot.state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				//ui.pushButton_execute->setDisabled(false);

				robot.ui_ecp_robot->epos_external_reply_data_request_port->set_request();
				robot.ui_ecp_robot->execute_motion();
				robot.ui_ecp_robot->epos_external_reply_data_request_port->get();

				set_single_axis(0, ui.doubleSpinBox_mcur_0, ui.radioButton_mip_0);
				set_single_axis(1, ui.doubleSpinBox_mcur_1, ui.radioButton_mip_1);
				set_single_axis(2, ui.doubleSpinBox_mcur_2, ui.radioButton_mip_2);
				set_single_axis(3, ui.doubleSpinBox_mcur_3, ui.radioButton_mip_3);
				set_single_axis(4, ui.doubleSpinBox_mcur_4, ui.radioButton_mip_4);
				set_single_axis(5, ui.doubleSpinBox_mcur_5, ui.radioButton_mip_5);

				lib::epos::epos_reply &er = robot.ui_ecp_robot->epos_external_reply_data_request_port->data;

				lib::Homog_matrix tmp_frame(er.current_frame);
				lib::Xyz_Angle_Axis_vector tmp_vector;
				double current_position[6];
				tmp_frame.get_xyz_angle_axis(tmp_vector);
				tmp_vector.to_table(current_position);

				ui.doubleSpinBox_cur_p0->setValue(current_position[0]);
				ui.doubleSpinBox_cur_p1->setValue(current_position[1]);
				ui.doubleSpinBox_cur_p2->setValue(current_position[2]);
				ui.doubleSpinBox_cur_p3->setValue(current_position[3]);
				ui.doubleSpinBox_cur_p4->setValue(current_position[4]);
				ui.doubleSpinBox_cur_p5->setValue(current_position[5]);

				for (int i = 0; i < robot.number_of_servos; i++) {
					robot.desired_pos[i] = robot.current_pos[i];
				}

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				//ui.pushButton_execute->setDisabled(true);
			}
		}

	} // end try
	CATCH_SECTION_UI

	return 1;
}
示例#3
0
int wgt_spkm_ext::init()
{

	try {

		if (robot.state.edp.pid != -1) {
			if (robot.state.edp.is_synchronised) // Czy robot jest zsynchronizowany?
			{
				//ui.pushButton_execute->setDisabled(false);

				robot.ui_ecp_robot->the_robot->epos_external_reply_data_request_port.set_request();
				robot.ui_ecp_robot->execute_motion();
				robot.ui_ecp_robot->the_robot->epos_external_reply_data_request_port.get();

				for (int i = 0; i < 6; i++) {
					set_single_axis(i, doubleSpinBox_mcur_Vector[i], radioButton_mip_Vector[i]);
				}

				lib::epos::epos_reply &er = robot.ui_ecp_robot->the_robot->epos_external_reply_data_request_port.data;

				lib::Homog_matrix tmp_frame(er.current_frame);
				lib::Xyz_Angle_Axis_vector tmp_vector;
				double current_position[6];
				tmp_frame.get_xyz_angle_axis(tmp_vector);
				tmp_vector.to_table(current_position);

				for (int i = 0; i < 6; i++) {
					doubleSpinBox_cur_Vector[i]->setValue(current_position[i]);
					robot.desired_pos[i] = robot.current_pos[i];
				}

			} else {
				// Wygaszanie elementow przy niezsynchronizowanym robocie
				//ui.pushButton_execute->setDisabled(true);
			}
		}

	} // end try
	CATCH_SECTION_UI

	return 1;
}