Permalink
Browse files

wait_for_task_termination: interface cleanup

  • Loading branch information...
1 parent 7c5fa05 commit 13cd8879a758720ffc287a08cd91457ae6b84a66 @ptroja committed Feb 9, 2012
@@ -73,11 +73,11 @@ void ball::configure_edp_force_sensor(bool configure_track, bool configure_postu
}
if ((configure_track) && (!configure_postument)) {
- wait_for_task_termination(false, 1, lib::irp6ot_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6ot_m::ROBOT_NAME);
} else if ((!configure_track) && (configure_postument)) {
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
} else if ((configure_track) && (configure_postument)) {
- wait_for_task_termination(false, 2, lib::irp6ot_m::ROBOT_NAME.c_str(), lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, {lib::irp6ot_m::ROBOT_NAME, lib::irp6p_m::ROBOT_NAME});
}
}
@@ -90,7 +90,7 @@ void ball::main_task_algorithm(void)
//set_next_ecp_state(ecp_mp::generator::ECP_GEN_SMOOTH, (int) ecp_mp::task::ABSOLUTE, "src/application/ball/irp6ot_init.trj", 0, lib::irp6ot_m::ROBOT_NAME);
//set_next_ecp_state(ecp_mp::generator::ECP_GEN_SMOOTH, (int) ecp_mp::task::ABSOLUTE, "src/application/ball/irp6p_init.trj", 0, lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 2, lib::irp6ot_m::ROBOT_NAME.c_str(), lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, {lib::irp6ot_m::ROBOT_NAME, lib::irp6p_m::ROBOT_NAME});
sr_ecp_msg->message("New series");
// wlaczenie generatora do konfiguracji czujnika w EDP w obydwu robotach
@@ -66,7 +66,7 @@ void bclike_mp_i::main_task_algorithm(void){
set_next_ecp_state (ecp_mp::task::ECP_ST_POSITION_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, actual_robot);
sr_ecp_msg->message("MOVE left");
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
//Setup end position
vec.clear();
@@ -76,7 +76,7 @@ void bclike_mp_i::main_task_algorithm(void){
//Start moving
set_next_ecp_state (ecp_mp::task::ECP_ST_SCAN_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, actual_robot);
sr_ecp_msg->message("MOVE right");
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
std::vector<std::pair<ecp::common::task::mrrocpp_regions, bool> >::iterator it;
@@ -97,18 +97,18 @@ void bclike_mp_i::main_task_algorithm(void){
//Go to code
tmp = msg.robotPositionToString(vec);
set_next_ecp_state (ecp_mp::task::ECP_ST_POSITION_MOVE, 0, tmp, lib::ECP_2_MP_STRING_SIZE, actual_robot);
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
//Get back to previous position
tmp = msg.robotPositionToString(pos);
set_next_ecp_state (ecp_mp::task::ECP_ST_POSITION_MOVE, 0, tmp, lib::ECP_2_MP_STRING_SIZE, actual_robot);
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
}
}
set_next_ecp_state (ecp_mp::task::ECP_ST_SCAN_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, actual_robot);
sr_ecp_msg->message("MOVE right");
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
}
sr_ecp_msg->message("KONIEC");
@@ -64,7 +64,7 @@ void bclike_mp_test::main_task_algorithm(void){
set_next_ecp_state (ecp_mp::task::ECP_ST_POSITION_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, actual_robot);
sr_ecp_msg->message("MOVE left");
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
int i = 0;
@@ -97,7 +97,7 @@ void bclike_mp_test::main_task_algorithm(void){
i = i % 3;
set_next_ecp_state (ecp_mp::task::ECP_ST_POSITION_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, actual_robot);
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
sr_ecp_msg->message("MP end loop");
@@ -65,7 +65,7 @@ void bclike_mp_ui::main_task_algorithm(void){
set_next_ecp_state (ecp_mp::task::ECP_ST_POSITION_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, actual_robot);
sr_ecp_msg->message("MOVE left");
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
//Setup end position
vec.clear();
@@ -75,7 +75,7 @@ void bclike_mp_ui::main_task_algorithm(void){
//Start moving
set_next_ecp_state (ecp_mp::task::ECP_ST_SCAN_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, 1, actual_robot.c_str());
sr_ecp_msg->message("MOVE right");
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
while(strcmp(robot_m[actual_robot]->ecp_reply_package.recognized_command, "KONIEC") != 0){
@@ -86,7 +86,7 @@ void bclike_mp_ui::main_task_algorithm(void){
set_next_ecp_state (ecp_mp::task::ECP_ST_SCAN_MOVE, 0, tab, lib::ECP_2_MP_STRING_SIZE, 1, actual_robot.c_str());
sr_ecp_msg->message("MOVE right");
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
}
sr_ecp_msg->message("KONIEC RUCHU");
std::vector<std::pair<ecp::common::task::mrrocpp_regions, bool> >::iterator it;
@@ -105,7 +105,7 @@ void bclike_mp_ui::main_task_algorithm(void){
//Move to code position
tmp = msg.robotPositionToString(vec);
set_next_ecp_state (ecp_mp::task::ECP_ST_POSITION_MOVE, 0, tmp, lib::ECP_2_MP_STRING_SIZE, 1, actual_robot.c_str());
- wait_for_task_termination(false, 1, actual_robot.c_str());
+ wait_for_task_termination(false, actual_robot);
//TODO: przelaczyc zadanie FrDIA
//TODO: wywolac subtaks Marcina
@@ -63,7 +63,7 @@ void bird_hand_test::main_task_algorithm(void)
set_next_ecp_state(ecp_mp::bird_hand::generator::ECP_GEN_BIRD_HAND_TEST, (int) 5, "", lib::bird_hand::ROBOT_NAME);
sr_ecp_msg->message("5");
- wait_for_task_termination(false, 1, lib::bird_hand::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::bird_hand::ROBOT_NAME);
sr_ecp_msg->message("END");
@@ -56,13 +56,13 @@ void block_move::main_task_algorithm(void)
sr_ecp_msg->message("Start position for searching");
set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_JOINT_FILE_FROM_MP, 5, "../../src/application/block_move/pos_search_area_start.trj", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
wait_ms(4000);
sr_ecp_msg->message("Final position for searching");
set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_JOINT_FILE_FROM_MP, 5, "../../src/application/block_move/pos_search_area_final.trj", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
//Tutaj powinno być przekazanie parametru i dojście
@@ -74,7 +74,7 @@ void block_move::main_task_algorithm(void)
sr_ecp_msg->message("Reach the block");
set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_ANGLE_AXIS_FILE_FROM_MP, 5, "../../src/application/block_move/block_reaching.trj", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
//sr_ecp_msg->message("Zwarcie szczek");
//set_next_ecp_state();
@@ -84,35 +84,35 @@ void block_move::main_task_algorithm(void)
sr_ecp_msg->message("Get the block");
set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_ANGLE_AXIS_FILE_FROM_MP, 5, "../../src/application/block_move/up_to_p0.trj", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
wait_ms(4000);
sr_ecp_msg->message("Start position for building");
set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_JOINT_FILE_FROM_MP, 5, "../../src/application/block_move/pos_build_start.trj", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
//Tutaj powinno byc przekazanie parametru i dojscie - ruch sklada sie z dwoch czesci
wait_ms(4000);
sr_ecp_msg->message("Put the block in its place");
set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_ANGLE_AXIS_FILE_FROM_MP, 5, "../../src/application/block_move/build.trj", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
//sr_ecp_msg->message("Rozwarcie szczek");
//set_next_ecp_state(ecp_mp::sub_task::ECP_ST_GRIPPER_OPENING, 0, NULL, 0, lib::irp6p_tfg::ROBOT_NAME);
- //wait_for_task_termination(false, 1, lib::irp6p_tfg::ROBOT_NAME.c_str());
+ //wait_for_task_termination(false, lib::irp6p_tfg::ROBOT_NAME);
//wait_ms(4000);
//sr_ecp_msg->message("Final position for building");
//set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_ANGLE_AXIS_FILE_FROM_MP, 5, "../../src/application/block_move/pos_build_final.trj", 0, lib::irp6p_m::ROBOT_NAME);
- //wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ //wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
//sr_ecp_msg->message("Zwarcie szczek");
//set_next_ecp_state();
- //wait_for_task_termination(false, 1, lib::irp6p_tfg::ROBOT_NAME.c_str());
+ //wait_for_task_termination(false, lib::irp6p_tfg::ROBOT_NAME);
wait_ms(4000);
@@ -110,15 +110,15 @@ void edge_follow_mr::main_task_algorithm(void)
// sekwencja generator na wybranym manipulatorze
set_next_ecp_state(ecp_mp::generator::ECP_GEN_BIAS_EDP_FORCE, (int) 5, "", manipulator_name);
- wait_for_task_termination(false, 1, manipulator_name.c_str());
+ wait_for_task_termination(false, manipulator_name);
set_next_ecp_state(ecp_mp::generator::ECP_GEN_TFF_NOSE_RUN, (int) 0, "", manipulator_name);
- wait_for_task_termination(false, 1, manipulator_name.c_str());
+ wait_for_task_termination(false, manipulator_name);
set_next_ecp_state(ecp_mp::generator::EDGE_FOLLOW, (int) 0, "", manipulator_name);
- wait_for_task_termination(false, 1, manipulator_name.c_str());
+ wait_for_task_termination(false, manipulator_name);
sr_ecp_msg->message("END");
@@ -92,7 +92,7 @@ void gen_test::main_task_algorithm(void)
//------------------- SMOOTH GENERATOR -------------------
set_next_ecp_state(ecp_mp::sub_task::ECP_ST_SMOOTH_GEN_TEST, (int) 5, "", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
//------------------- SMOOTH GENERATOR END -------------------
//------------------- SPLINE GENERATOR -------------------
@@ -146,11 +146,11 @@ void graspit::main_task_algorithm(void)
set_next_ecp_state(ecp_mp::task::ECP_GEN_BIRD_HAND, (int) 5, tmp_string1, gripper_name);
- wait_for_task_termination(false, 1, gripper_name.c_str());
+ wait_for_task_termination(false, gripper_name);
set_next_ecp_state(ecp_mp::task::ECP_GEN_IRP6, (int) 5, tmp_string2, manipulator_name);
- wait_for_task_termination(false, 1, manipulator_name.c_str());
+ wait_for_task_termination(false, manipulator_name);
//last IRp6 position from GraspI
for (int i = 0; i < 6; ++i)
@@ -181,11 +181,11 @@ void graspit::main_task_algorithm(void)
set_next_ecp_state(ecp_mp::task::ECP_GEN_IRP6, (int) 5, tmp_string2, manipulator_name);
- wait_for_task_termination(false, 1, manipulator_name.c_str());
+ wait_for_task_termination(false, manipulator_name);
set_next_ecp_state(ecp_mp::task::ECP_GEN_BIRD_HAND, (int) 5, tmp_string1, gripper_name);
- wait_for_task_termination(false, 1, gripper_name.c_str());
+ wait_for_task_termination(false, gripper_name);
//debugging
// std::stringstream ss(std::stringstream::in | std::stringstream::out);
@@ -144,11 +144,11 @@ void graspit::main_task_algorithm(void)
set_next_ecp_state(ecp_mp::generator::ECP_GEN_TFG, (int) 5, tmp_string1, gripper_name);
- wait_for_task_termination(false, 1, gripper_name.c_str());
+ wait_for_task_termination(false, gripper_name);
set_next_ecp_state(ecp_mp::task::ECP_GEN_IRP6, (int) 5, tmp_string2, manipulator_name);
- wait_for_task_termination(false, 1, manipulator_name.c_str());
+ wait_for_task_termination(false, manipulator_name);
for (int i = 0; i < 6; ++i)
mp_ecp_irp6_command.joint[i] = trgraspit->from_va.grasp_joint[i + 6];
@@ -159,11 +159,11 @@ void graspit::main_task_algorithm(void)
set_next_ecp_state(ecp_mp::task::ECP_GEN_IRP6, (int) 5, tmp_string2, manipulator_name);
- wait_for_task_termination(false, 1, manipulator_name.c_str());
+ wait_for_task_termination(false, manipulator_name);
set_next_ecp_state(ecp_mp::generator::ECP_GEN_TFG, (int) 5, tmp_string1, gripper_name);
- wait_for_task_termination(false, 1, gripper_name.c_str());
+ wait_for_task_termination(false, gripper_name);
std::stringstream ss(std::stringstream::in | std::stringstream::out);
for (int i = 6; i < 13; ++i)
@@ -58,11 +58,11 @@ void haptic::configure_edp_force_sensor(bool configure_track, bool configure_pos
}
if ((configure_track) && (!configure_postument)) {
- wait_for_task_termination(false, 1, lib::irp6ot_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6ot_m::ROBOT_NAME);
} else if ((!configure_track) && (configure_postument)) {
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
} else if ((configure_track) && (configure_postument)) {
- wait_for_task_termination(false, 2, lib::irp6ot_m::ROBOT_NAME.c_str(), lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, {lib::irp6ot_m::ROBOT_NAME, lib::irp6p_m::ROBOT_NAME});
}
}
@@ -54,11 +54,11 @@ void haptic_stiffness::configure_edp_force_sensor(bool configure_track, bool con
}
if ((configure_track) && (!configure_postument)) {
- wait_for_task_termination(false, 1, lib::irp6ot_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6ot_m::ROBOT_NAME);
} else if ((!configure_track) && (configure_postument)) {
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
} else if ((configure_track) && (configure_postument)) {
- wait_for_task_termination(false, 2, lib::irp6ot_m::ROBOT_NAME.c_str(), lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, {lib::irp6ot_m::ROBOT_NAME, lib::irp6p_m::ROBOT_NAME});
}
}
@@ -76,7 +76,7 @@ void neuron::main_task_algorithm(void)
sr_ecp_msg->message("Neuron task initialization");
set_next_ecp_state(ecp_mp::task::ECP_T_NEURON, 5, "", lib::irp6p_m::ROBOT_NAME);
- wait_for_task_termination(false, 1, lib::irp6p_m::ROBOT_NAME.c_str());
+ wait_for_task_termination(false, lib::irp6p_m::ROBOT_NAME);
sr_ecp_msg->message("END");
}
@@ -7,17 +7,29 @@
#include "base/lib/sr/srlib.h"
#include "ecp_mp_t_rcsc.h"
#include "subtask/ecp_st_smooth_file_from_mp.h"
+
+#include "ecp_t_rcsc.h"
+
+#include "generator/ecp/ecp_mp_g_newsmooth.h"
+#include "generator/ecp/ecp_mp_g_teach_in.h"
#include "generator/ecp/tff_gripper_approach/ecp_mp_g_tff_gripper_approach.h"
+#include "generator/ecp/transparent/ecp_mp_g_transparent.h"
#include "generator/ecp/tff_rubik_face_rotate/ecp_mp_g_tff_rubik_face_rotate.h"
-#include "ecp_t_rcsc.h"
+#include "generator/ecp/ecp_g_newsmooth.h"
#include "generator/ecp/bias_edp_force/ecp_g_bias_edp_force.h"
#include "generator/ecp/tff_nose_run/ecp_g_tff_nose_run.h"
#include "generator/ecp/sleep/ecp_g_sleep.h"
-#include "generator/ecp/transparent/ecp_mp_g_transparent.h"
-#include "generator/ecp/ecp_mp_g_newsmooth.h"
-#include "generator/ecp/ecp_mp_g_teach_in.h"
+#include "generator/ecp/transparent/ecp_g_transparent.h"
+#include "generator/ecp/tff_rubik_face_rotate/ecp_g_tff_rubik_face_rotate.h"
+#include "generator/ecp/tff_gripper_approach/ecp_g_tff_gripper_approach.h"
#include "generator/ecp/weight_measure/ecp_mp_g_weight_measure.h"
+#include "generator/ecp/weight_measure/ecp_g_weight_measure.h"
+
+#include "robot/irp6ot_m/ecp_r_irp6ot_m.h"
+#include "robot/irp6p_m/ecp_r_irp6p_m.h"
+
+#include "base/ecp/ecp_task.h"
namespace mrrocpp {
namespace ecp {
@@ -27,7 +39,6 @@ namespace task {
rcsc::rcsc(lib::configurator &_config) :
common::task::task(_config)
{
-
// the robot is choose dependently on the section of configuration file sent as argv[4]
if (config.robot_name == lib::irp6ot_m::ROBOT_NAME) {
ecp_m_robot = (boost::shared_ptr <robot_t>) new irp6ot_m::robot(*this);
@@ -43,11 +54,7 @@ rcsc::rcsc(lib::configurator &_config) :
register_generator(new generator::bias_edp_force(*this));
register_generator(new generator::tff_gripper_approach(*this, 8));
register_generator(new generator::tff_rubik_face_rotate(*this, 8));
- {
- common::generator::tff_nose_run *ecp_gen = new common::generator::tff_nose_run(*this, 8);
- register_generator(ecp_gen);
- }
-
+ register_generator(new common::generator::tff_nose_run(*this, 8));
register_generator(new generator::weight_measure(*this, 1));
register_subtask(new sub_task::sub_task_smooth_file_from_mp(*this, lib::ECP_JOINT, ecp_mp::sub_task::ECP_ST_SMOOTH_JOINT_FILE_FROM_MP, true));
@@ -56,11 +63,6 @@ rcsc::rcsc(lib::configurator &_config) :
sr_ecp_msg->message("ecp loaded");
}
-rcsc::~rcsc()
-{
-
-}
-
}
} // namespace irp6ot
@@ -76,4 +78,3 @@ task_base* return_created_ecp_task(lib::configurator &_config)
} // namespace common
} // namespace ecp
} // namespace mrrocpp
-
Oops, something went wrong.

0 comments on commit 13cd887

Please sign in to comment.