|
@@ -273,10 +273,18 @@ void Dispatch_process::Main()
|
|
|
{
|
|
|
std::this_thread::sleep_for(std::chrono::microseconds(1));
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
|
-// std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
|
+#ifdef TIME_TEST
|
|
|
+ std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
|
+#endif
|
|
|
// std::cout << " huli test :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: " << " m_dispatch_process_status = " << m_dispatch_process_status << std::endl;
|
|
|
|
|
|
- switch ( (Dispatch_process_status)m_dispatch_process_status )
|
|
|
+ std::shared_ptr<Dispatch_device_base> following_carrier = Dispatch_manager::get_instance_references().m_carrier_map[2];
|
|
|
+ Error_manager err = following_carrier->check_task_level(Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_TWO_LEVEL);
|
|
|
+LOG(INFO) << " err = "<<err.to_string()<< " " << this;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ switch ( (Dispatch_process_status)m_dispatch_process_status )
|
|
|
{
|
|
|
case DISPATCH_PROCESS_CREATED://流程创建,
|
|
|
{
|
|
@@ -902,7 +910,7 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
|
{
|
|
|
//机器人移到42号口
|
|
|
float t_x = tp_dispatch_coordinates->m_carrier_coordinates_map[42].x;
|
|
|
- catcher_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_avoid_catcher, tp_avoid_catcher_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_catcher_4th_floor_z);
|
|
|
+ catcher_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_avoid_catcher, tp_avoid_catcher_task, tp_dispatch_coordinates, t_x);
|
|
|
m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
}
|
|
|
//else 无限等待
|
|
@@ -917,7 +925,7 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
|
{
|
|
|
//机器人移到34号口
|
|
|
float t_x = tp_dispatch_coordinates->m_carrier_coordinates_map[34].x;
|
|
|
- catcher_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_avoid_catcher, tp_avoid_catcher_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_catcher_4th_floor_z);
|
|
|
+ catcher_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_avoid_catcher, tp_avoid_catcher_task, tp_dispatch_coordinates, t_x);
|
|
|
m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
}
|
|
|
//else 无限等待
|
|
@@ -1509,25 +1517,26 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
|
|
|
|
std::cout << " huli test :::: " << " ======================================================================================== = " << 1 << std::endl;
|
|
|
std::cout << " huli test :::: " << " m_dispatch_carrier_node.m_dispatch_control_status = " << m_dispatch_carrier_node.m_dispatch_control_status << std::endl;
|
|
|
- if ( tp_main_carrier != NULL )
|
|
|
+ if ( m_dispatch_carrier_node.mp_main_carrier.get() != NULL )
|
|
|
{
|
|
|
- std::cout << " huli test :::: " << " tp_main_carrier->get_device_id() = " << tp_main_carrier->get_device_id() << std::endl;
|
|
|
+ std::cout << " huli test :::: " << " tp_main_carrier->get_device_id() = " << m_dispatch_carrier_node.mp_main_carrier->get_device_id() << std::endl;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
std::cout << " huli test :::: " << " tp_main_carrier->get_device_id() = " << -8888 << std::endl;
|
|
|
}
|
|
|
- if ( tp_avoid_catcher != NULL )
|
|
|
+ if ( m_dispatch_carrier_node.mp_avoid_catcher.get() != NULL )
|
|
|
{
|
|
|
- std::cout << " huli test :::: " << " tp_avoid_catcher->get_device_id() = " << tp_avoid_catcher->get_device_id() << std::endl;
|
|
|
+ std::cout << " huli test :::: " << " tp_avoid_catcher->get_device_id() = " << m_dispatch_carrier_node.mp_avoid_catcher->get_device_id() << std::endl;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
std::cout << " huli test :::: " << " tp_avoid_catcher->get_device_id() = " << -8888 << std::endl;
|
|
|
}
|
|
|
-// char cr;
|
|
|
-// std::cin >> cr ;
|
|
|
-
|
|
|
+#ifdef PROCESS_TEST
|
|
|
+ char cr;
|
|
|
+ std::cin >> cr ;
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
Error_manager t_catcher_error;
|
|
@@ -1955,7 +1964,7 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
|
m_dispatch_catcher_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_catcher_node.m_dispatch_control_status+1);
|
|
|
}
|
|
|
else if(m_dispatch_carrier_node.m_dispatch_control_status == Dispatch_process::Dispatch_control_status::DISPATCH_CARRIER_PICKUP_54 &&
|
|
|
- Common_data::approximate_difference(tp_main_carrier->m_actual_x, tp_main_catcher->m_actual_x, tp_dispatch_coordinates->m_separated_distance_x) == false )
|
|
|
+ (Common_data::approximate_difference(tp_main_carrier->m_actual_x, tp_main_catcher->m_actual_x, tp_dispatch_coordinates->m_separated_distance_x) == false) )
|
|
|
{
|
|
|
m_dispatch_catcher_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_catcher_node.m_dispatch_control_status+1);
|
|
|
}
|
|
@@ -2084,17 +2093,17 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
|
|
|
|
std::cout << " huli test :::: " << " ----------------------------------------------------------------------------------------- = " << 2 << std::endl;
|
|
|
std::cout << " huli test :::: " << " m_dispatch_catcher_node.m_dispatch_control_status = " << m_dispatch_catcher_node.m_dispatch_control_status << std::endl;
|
|
|
- if ( tp_main_catcher != NULL )
|
|
|
+ if ( m_dispatch_catcher_node.mp_main_catcher.get() != NULL )
|
|
|
{
|
|
|
- std::cout << " huli test :::: " << " tp_main_catcher->get_device_id() = " << tp_main_catcher->get_device_id() << std::endl;
|
|
|
+ std::cout << " huli test :::: " << " tp_main_catcher->get_device_id() = " << m_dispatch_catcher_node.mp_main_catcher->get_device_id() << std::endl;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
std::cout << " huli test :::: " << " tp_main_catcher->get_device_id() = " << -8888 << std::endl;
|
|
|
}
|
|
|
- if ( tp_following_carrier != NULL )
|
|
|
+ if ( m_dispatch_catcher_node.mp_following_carrier.get() != NULL )
|
|
|
{
|
|
|
- std::cout << " huli test :::: " << " tp_following_carrier->get_device_id() = " << tp_following_carrier->get_device_id() << std::endl;
|
|
|
+ std::cout << " huli test :::: " << " tp_following_carrier->get_device_id() = " << m_dispatch_catcher_node.mp_following_carrier->get_device_id() << std::endl;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2104,14 +2113,17 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
|
std::cout << " huli test :::: " << " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ = " << 3 << std::endl;
|
|
|
std::cout << " huli test :::: " << " m_parkspace_information_optimal.parkingspace_index_id = " << m_parkspace_information_optimal.parkingspace_index_id << std::endl;
|
|
|
std::cout << " huli test :::: " << " m_dispatch_destination = " << m_dispatch_destination << std::endl;
|
|
|
-
|
|
|
-// char ch;
|
|
|
-// std::cin >> ch ;
|
|
|
|
|
|
+#ifdef PROCESS_TEST
|
|
|
+ char ch;
|
|
|
+ std::cin >> ch ;
|
|
|
+#endif
|
|
|
|
|
|
//结果汇总
|
|
|
if ( m_dispatch_carrier_node.m_dispatch_control_status == DISPATCH_CARRIER_PICKUP_END &&
|
|
|
- m_dispatch_catcher_node.m_dispatch_control_status == DISPATCH_CATCHER_PICKUP_END)
|
|
|
+ m_dispatch_catcher_node.m_dispatch_control_status == DISPATCH_CATCHER_PICKUP_END &&
|
|
|
+ m_dispatch_carrier_node.m_error == Error_code::SUCCESS &&
|
|
|
+ m_dispatch_catcher_node.m_error == Error_code::SUCCESS)
|
|
|
{
|
|
|
return Error_code::SUCCESS;
|
|
|
}
|
|
@@ -2294,7 +2306,7 @@ Error_manager Dispatch_process::connect_dispatch_catcher(std::shared_ptr<Dispatc
|
|
|
tp_catcher_task->m_request_wheelbase = Dispatch_coordinates::get_instance_references().m_default_wheelbase;
|
|
|
tp_catcher_task->m_request_clamp_motion = (Catcher_task::Clamp_motion)tp_catcher->m_actual_clamp_motion1;
|
|
|
|
|
|
- t_error = tp_catcher->execute_task(m_dispatch_catcher_node.mp_main_catcher_task, dispatch_task_level);
|
|
|
+ t_error = tp_catcher->execute_task(p_catcher_task, dispatch_task_level);
|
|
|
}
|
|
|
}
|
|
|
else
|