|
@@ -475,12 +475,19 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
Dispatch_coordinates * tp_dispatch_coordinates = Dispatch_coordinates::get_instance_pointer();
|
|
Dispatch_coordinates * tp_dispatch_coordinates = Dispatch_coordinates::get_instance_pointer();
|
|
|
|
|
|
Error_manager t_carrier_error;
|
|
Error_manager t_carrier_error;
|
|
- Carrier * tp_carrier = NULL;
|
|
|
|
- Carrier_task * tp_carrier_task = NULL;
|
|
|
|
|
|
+ Carrier * tp_main_carrier = NULL;
|
|
|
|
+ Carrier_task * tp_main_carrier_task = NULL;
|
|
if ( m_dispatch_carrier_node.mp_main_carrier.get() != NULL && m_dispatch_carrier_node.mp_main_carrier_task.get() != NULL )
|
|
if ( m_dispatch_carrier_node.mp_main_carrier.get() != NULL && m_dispatch_carrier_node.mp_main_carrier_task.get() != NULL )
|
|
{
|
|
{
|
|
- tp_carrier = (Carrier *)m_dispatch_carrier_node.mp_main_carrier.get();
|
|
|
|
- tp_carrier_task = (Carrier_task *)m_dispatch_carrier_node.mp_main_carrier_task.get();
|
|
|
|
|
|
+ tp_main_carrier = (Carrier *)m_dispatch_carrier_node.mp_main_carrier.get();
|
|
|
|
+ tp_main_carrier_task = (Carrier_task *)m_dispatch_carrier_node.mp_main_carrier_task.get();
|
|
|
|
+ }
|
|
|
|
+ Catcher * tp_avoid_catcher = NULL;
|
|
|
|
+ Catcher_task * tp_avoid_catcher_task = NULL;
|
|
|
|
+ if ( m_dispatch_carrier_node.mp_avoid_catcher.get() != NULL && m_dispatch_carrier_node.mp_avoid_catcher_task.get() != NULL )
|
|
|
|
+ {
|
|
|
|
+ tp_avoid_catcher = (Catcher *)m_dispatch_carrier_node.mp_avoid_catcher.get();
|
|
|
|
+ tp_avoid_catcher_task = (Catcher_task *)m_dispatch_carrier_node.mp_avoid_catcher_task.get();
|
|
}
|
|
}
|
|
|
|
|
|
//搬运器的控制动作
|
|
//搬运器的控制动作
|
|
@@ -504,12 +511,21 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
//else 原地等待
|
|
//else 原地等待
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- case DISPATCH_CARRIER_PICKUP_START:
|
|
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_START://连接搬运器, 创建新的任务单 与设备建立连接
|
|
{
|
|
{
|
|
- m_dispatch_carrier_node.m_error = connect_dispatch_carrier(m_dispatch_carrier_node.mp_main_carrier, m_dispatch_carrier_node.mp_main_carrier_task, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
|
|
|
+ //连接搬运器, 创建新的任务单 与设备建立连接, 只能成功, 失败就要进入故障处理
|
|
|
|
+ m_dispatch_carrier_node.m_error = m_dispatch_carrier_node.mp_main_carrier->check_task_level(Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
{
|
|
{
|
|
- m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
|
|
+ m_dispatch_carrier_node.m_error = connect_dispatch_carrier(m_dispatch_carrier_node.mp_main_carrier, m_dispatch_carrier_node.mp_main_carrier_task, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_ONE_LEVEL);
|
|
|
|
+ if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -519,32 +535,471 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
}
|
|
}
|
|
case DISPATCH_CARRIER_PICKUP_1:
|
|
case DISPATCH_CARRIER_PICKUP_1:
|
|
{
|
|
{
|
|
- check_task(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- case DISPATCH_CARRIER_PICKUP_2:
|
|
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_2://搬运器 准备开始, 需要同步任务单和设备真实数据
|
|
{
|
|
{
|
|
- //检查姿态
|
|
|
|
- if ( tp_carrier->m_actual_load_status == Dispatch_device_base::Load_status::NO_CAR )
|
|
|
|
|
|
+ //搬运器 准备开始, 需要同步任务单和设备真实数据.//注意了:连接设备只是预约, 设备不一定立刻执行.所以需要在连接成功之后进行数据同步
|
|
|
|
+ carrier_ready_to_start(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_3:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_4://检查姿态 //搬运器调整到 正常待机的姿态(调节夹杆和轴距)
|
|
|
|
+ {
|
|
|
|
+ if ( tp_main_carrier->m_actual_load_status == Dispatch_device_base::Load_status::NO_CAR )
|
|
{
|
|
{
|
|
- if ( tp_carrier_task->m_request_clamp_motion == Carrier_task::Clamp_motion::E_CLAMP_LOOSE &&
|
|
|
|
- Common_data::approximate_difference(m_wheel_base, tp_carrier->m_actual_y1-tp_carrier->m_actual_y2, DISPATCH_DEFAULT_DIFFERENCE))
|
|
|
|
|
|
+ if ( tp_main_carrier_task->m_request_clamp_motion == Carrier_task::Clamp_motion::E_CLAMP_LOOSE &&
|
|
|
|
+ Common_data::approximate_difference(m_wheel_base, tp_main_carrier->m_actual_y1-tp_main_carrier->m_actual_y2, DISPATCH_DEFAULT_DIFFERENCE))
|
|
{
|
|
{
|
|
- tp_carrier_task->m_step +=2;
|
|
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+2);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- carrier_adjust_to_ready(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_carrier, tp_carrier_task, tp_dispatch_coordinates);
|
|
|
|
- tp_carrier_task->m_step++;
|
|
|
|
|
|
+ //搬运器调整到 正常待机的姿态(调节夹杆和轴距)
|
|
|
|
+ carrier_adjust_to_ready(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- return Error_manager(Error_code::CARRIER_POSE_ERROR, Error_level::MINOR_ERROR,
|
|
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ m_dispatch_carrier_node.m_error = Error_manager(Error_code::CARRIER_POSE_ERROR, Error_level::MINOR_ERROR,
|
|
"tp_carrier->m_actual_load_status != Dispatch_device_base::Load_status::NO_CAR fun error ");
|
|
"tp_carrier->m_actual_load_status != Dispatch_device_base::Load_status::NO_CAR fun error ");
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_5:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_6://让小跑车回到中跑车上, y轴移动
|
|
|
|
+ {
|
|
|
|
+ if ( Common_data::approximate_difference(tp_main_carrier->m_actual_y, tp_dispatch_coordinates->m_carrier_default_y_back, DISPATCH_DEFAULT_DIFFERENCE) )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+2);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ carrier_move_y(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_carrier_default_y_back);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_7:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_8://让中跑车回到电梯井, 进行x轴路径检查
|
|
|
|
+ {
|
|
|
|
+ float t_z = tp_dispatch_coordinates->m_carrier_coordinates[m_parkspace_information_optimal.parkingspace_index_id].z;
|
|
|
|
+ if ( Common_data::approximate_difference(tp_main_carrier->m_actual_z, t_z, DISPATCH_DEFAULT_DIFFERENCE) )
|
|
|
|
+ {
|
|
|
|
+ //直接到 20步 , 准备同层移动到车位
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status::DISPATCH_CARRIER_PICKUP_20);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ //如果是3楼, 直接报错, 因为3楼搬运器只能在3楼移动, z轴真实值和目标值 一定是相同的
|
|
|
|
+ if ( tp_main_carrier->get_device_id() !=0 && tp_main_carrier->get_device_id() !=1 )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ m_dispatch_carrier_node.m_error = Error_manager(Error_code::CARRIER_CONRTOL_PARAMETER_ERROR, Error_level::MINOR_ERROR,
|
|
|
|
+ " tp_main_carrier->get_device_id() PARAMRTER ERROR ");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ int t_avoid_catcher_id = -1; //需要避让的机器人
|
|
|
|
+ //空间锁判断, 是否需要机器人避让
|
|
|
|
+ if ( tp_main_carrier->get_device_id() == 0 )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, 0,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 1 )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, tp_dispatch_coordinates->m_space_lock_columns,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+ //判断结果
|
|
|
|
+ if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ //成功则直接跳转到 13步, 不用避让, 直接控制搬运器直到电梯井
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status::DISPATCH_CARRIER_PICKUP_13);
|
|
|
|
+ }
|
|
|
|
+ else if(t_avoid_catcher_id != -1)
|
|
|
|
+ {
|
|
|
|
+ //连接避让设备 使得避让机器人进行避让
|
|
|
|
+ m_dispatch_carrier_node.m_error = m_dispatch_carrier_node.mp_avoid_catcher->check_task_level(Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_TWO_LEVEL);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_catcher_node.m_error = connect_dispatch_catcher(m_dispatch_carrier_node.mp_avoid_catcher, m_dispatch_carrier_node.mp_avoid_catcher_task, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_TWO_LEVEL);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_catcher_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_catcher_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //else 抓取器的资源自由争抢, 如果没有抢到, 那么重复连接
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ m_dispatch_carrier_node.m_error = Error_manager(Error_code::CARRIER_CONRTOL_PARAMETER_ERROR, Error_level::MINOR_ERROR,
|
|
|
|
+ " carrier_try_space_lock fun ERROR ");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_9:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_avoid_catcher_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_10://机器人避让到最高点, 机器人上升不需要判断空间锁
|
|
|
|
+ {
|
|
|
|
+ catcher_move_z(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);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_11://机器人释放 空间锁
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_catcher_node.m_error = check_task_status(m_dispatch_carrier_node.mp_avoid_catcher_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ tp_dispatch_coordinates->catcher_space_unlock(tp_avoid_catcher->m_actual_coordinates_id, tp_avoid_catcher->get_device_id());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_12://空间锁判断, 必须成功
|
|
|
|
+ {
|
|
|
|
+ int t_avoid_catcher_id = -1; //需要避让的机器人
|
|
|
|
+ if ( tp_main_carrier->get_device_id() == 0 )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, 0,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 1 )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, tp_dispatch_coordinates->m_space_lock_columns,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+ //判断结果
|
|
|
|
+ if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_13://让中跑车回到电梯井, x轴移动
|
|
|
|
+ {
|
|
|
|
+ if ( tp_main_carrier->get_device_id() == 0 )
|
|
|
|
+ {
|
|
|
|
+ carrier_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_carrier_default_x_left);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 1 )
|
|
|
|
+ {
|
|
|
|
+ carrier_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_carrier_default_x_right);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ m_dispatch_carrier_node.m_error = Error_manager(Error_code::CARRIER_CONRTOL_PARAMETER_ERROR, Error_level::MINOR_ERROR,
|
|
|
|
+ " tp_main_carrier->get_device_id() PARAMRTER ERROR ");
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_14://搬运器 释放空间锁
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_space_unlock(tp_main_carrier->get_device_id());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_15://避让机器人 断连
|
|
|
|
+ {
|
|
|
|
+ if ( m_dispatch_carrier_node.mp_avoid_catcher.get() != NULL && m_dispatch_carrier_node.mp_avoid_catcher_task.get() != NULL )
|
|
|
|
+ {
|
|
|
|
+ disconnect_dispatch_device(m_dispatch_carrier_node.mp_avoid_catcher, m_dispatch_carrier_node.mp_avoid_catcher_task);
|
|
|
|
+ }
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_16://收回对接,之后中跑车固定在电梯上不能X轴移动,电梯可以Z轴移动
|
|
|
|
+ {
|
|
|
|
+ carrier_joint_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_TAKE_BACK);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_17:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_18: //电梯移动到对应的楼层, 搬运器在电梯里面z轴移动, 不需要判断空间锁
|
|
|
|
+ {
|
|
|
|
+ float t_z = tp_dispatch_coordinates->m_carrier_coordinates[m_parkspace_information_optimal.parkingspace_index_id].z;
|
|
|
|
+ carrier_move_z(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, t_z);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_19:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_20://伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
|
|
+ {
|
|
|
|
+ if ( tp_main_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
+ {
|
|
|
|
+ carrier_joint_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+2);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_21:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_22://中跑车 x轴移动, 进行x轴路径检查
|
|
|
|
+ {
|
|
|
|
+ float t_x = tp_dispatch_coordinates->m_carrier_coordinates[m_parkspace_information_optimal.parkingspace_index_id].x;
|
|
|
|
+ float t_column = (m_parkspace_information_optimal.parkingspace_index_id-1) % tp_dispatch_coordinates->m_space_lock_columns;
|
|
|
|
+ if ( Common_data::approximate_difference(tp_main_carrier->m_actual_x, t_x, DISPATCH_DEFAULT_DIFFERENCE) )
|
|
|
|
+ {
|
|
|
|
+ //搬运器不用x轴运动, 直接到29步, 去车位取车
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status::DISPATCH_CARRIER_PICKUP_29);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ int t_avoid_catcher_id = -1; //需要避让的机器人
|
|
|
|
+ if ( tp_main_carrier->get_device_id() == 0 && t_column <13-1)
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, t_column+1,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 1 && t_column >3-1)
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, t_column-1,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 2 )
|
|
|
|
+ {
|
|
|
|
+ //3楼搬运器不用加锁, 直接x轴移动
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status::DISPATCH_CARRIER_PICKUP_27);
|
|
|
|
+ break;//切换流程
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ m_dispatch_carrier_node.m_error = Error_manager(Error_code::CARRIER_CONRTOL_PARAMETER_ERROR, Error_level::MINOR_ERROR,
|
|
|
|
+ " tp_main_carrier->get_device_id() and m_parkspace_information_optimal.parkingspace_index_id PARAMRTER ERROR ");
|
|
|
|
+ break;//切换流程
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //判断结果
|
|
|
|
+ if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ //左右搬运器加锁成功, 直接x轴移动
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status::DISPATCH_CARRIER_PICKUP_27);
|
|
|
|
+ }
|
|
|
|
+ else if(t_avoid_catcher_id != -1 && tp_main_carrier->m_actual_coordinates_rows == 2)//4楼取车, 机器人进行避让
|
|
|
|
+ {
|
|
|
|
+ //连接避让设备 使得避让机器人进行避让
|
|
|
|
+ m_dispatch_carrier_node.m_error = m_dispatch_carrier_node.mp_avoid_catcher->check_task_level(Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_TWO_LEVEL);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_catcher_node.m_error = connect_dispatch_catcher(m_dispatch_carrier_node.mp_avoid_catcher, m_dispatch_carrier_node.mp_avoid_catcher_task, Dispatch_device_base::Dispatch_task_level::DISPATCH_TASK_TWO_LEVEL);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_catcher_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_catcher_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //else 抓取器的资源自由争抢, 如果没有抢到, 那么重复连接
|
|
|
|
+ }
|
|
|
|
+ //else 无限等待
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_23:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_avoid_catcher_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_24://让4楼机器人进行避让, 先加锁, 在避让
|
|
|
|
+ {
|
|
|
|
+ if ( tp_main_carrier->get_device_id() == 0 )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->catcher_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, tp_avoid_catcher->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, 14-1,
|
|
|
|
+ tp_avoid_catcher->get_device_id());
|
|
|
|
+ //判断结果
|
|
|
|
+ if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ float t_x = tp_dispatch_coordinates->m_carrier_coordinates[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);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ //else 无限等待
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 1 )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->catcher_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, 2-1,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, tp_avoid_catcher->m_actual_coordinates_columns,
|
|
|
|
+ tp_avoid_catcher->get_device_id());
|
|
|
|
+ //判断结果
|
|
|
|
+ if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ float t_x = tp_dispatch_coordinates->m_carrier_coordinates[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);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ //else 无限等待
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_25://机器人释放 空间锁
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_avoid_catcher_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ tp_dispatch_coordinates->catcher_space_unlock(tp_avoid_catcher->m_actual_coordinates_id, tp_avoid_catcher->get_device_id());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_26://空间锁判断, 必须成功
|
|
|
|
+ {
|
|
|
|
+ float t_column = (m_parkspace_information_optimal.parkingspace_index_id-1) % tp_dispatch_coordinates->m_space_lock_columns;
|
|
|
|
+ int t_avoid_catcher_id = -1; //需要避让的机器人
|
|
|
|
+ if ( tp_main_carrier->get_device_id() == 0 && t_column <13-1)
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, t_column+1,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 1 && t_column >3-1)
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_try_space_lock(tp_main_carrier->m_actual_coordinates_rows, t_column-1,
|
|
|
|
+ tp_main_carrier->m_actual_coordinates_rows, tp_main_carrier->m_actual_coordinates_columns,
|
|
|
|
+ tp_main_carrier->get_device_id(), t_avoid_catcher_id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //判断结果
|
|
|
|
+ if ( m_dispatch_carrier_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = Dispatch_process::Dispatch_control_status::DISPATCH_CONTROL_FAULT;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_27://搬运器x轴移动到车位
|
|
|
|
+ {
|
|
|
|
+ float t_x = tp_dispatch_coordinates->m_carrier_coordinates[m_parkspace_information_optimal.parkingspace_index_id].x;
|
|
|
|
+ carrier_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_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);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_28:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_29://小跑车 进入车位
|
|
|
|
+ {
|
|
|
|
+ carrier_move_y(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_carrier_default_y_leave);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_30:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_31://小跑车 夹车
|
|
|
|
+ {
|
|
|
|
+ carrier_move_c(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, Carrier_task::Clamp_motion::E_CLAMP_TIGHT);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_32:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_33://小跑车 回到中跑车
|
|
|
|
+ {
|
|
|
|
+ carrier_move_y(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_carrier_default_y_back);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_34:
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_35://让中跑车回到电梯井
|
|
|
|
+ {
|
|
|
|
+ //如果不在2楼, 那么就要退回电梯井
|
|
|
|
+ if ( tp_main_carrier->get_device_id() == 0 && tp_main_carrier->m_actual_coordinates_rows != 0)
|
|
|
|
+ {
|
|
|
|
+ carrier_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_carrier_default_x_left);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else if ( tp_main_carrier->get_device_id() == 1 && tp_main_carrier->m_actual_coordinates_rows != 0 )
|
|
|
|
+ {
|
|
|
|
+ carrier_move_x(get_dispatch_control_command_key(m_dispatch_carrier_node), tp_main_carrier, tp_main_carrier_task, tp_dispatch_coordinates, tp_dispatch_coordinates->m_carrier_default_x_right);
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+1);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_dispatch_control_status = (Dispatch_process::Dispatch_control_status)(m_dispatch_carrier_node.m_dispatch_control_status+999);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ case DISPATCH_CARRIER_PICKUP_36://搬运器 释放空间锁
|
|
|
|
+ {
|
|
|
|
+ check_task_status(m_dispatch_carrier_node.mp_main_carrier_task, m_dispatch_carrier_node.m_dispatch_control_status);
|
|
|
|
+ if ( m_dispatch_catcher_node.m_error == Error_code::SUCCESS )
|
|
|
|
+ {
|
|
|
|
+ m_dispatch_carrier_node.m_error = tp_dispatch_coordinates->carrier_space_unlock(tp_main_carrier->get_device_id());
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
default:
|
|
default:
|
|
{
|
|
{
|
|
|
|
|
|
@@ -553,12 +1008,12 @@ Error_manager Dispatch_process::dispatch_control_motion_pickup()
|
|
}
|
|
}
|
|
|
|
|
|
Error_manager t_catcher_error;
|
|
Error_manager t_catcher_error;
|
|
- Carrier * tp_catcher = NULL;
|
|
|
|
- Carrier_task * tp_catcher_task = NULL;
|
|
|
|
|
|
+ Catcher * tp_main_catcher = NULL;
|
|
|
|
+ Catcher_task * tp_main_catcher_task = NULL;
|
|
if ( m_dispatch_catcher_node.mp_main_catcher.get() != NULL && m_dispatch_catcher_node.mp_main_catcher_task.get() != NULL )
|
|
if ( m_dispatch_catcher_node.mp_main_catcher.get() != NULL && m_dispatch_catcher_node.mp_main_catcher_task.get() != NULL )
|
|
{
|
|
{
|
|
- tp_catcher = (Carrier *)m_dispatch_catcher_node.mp_main_catcher.get();
|
|
|
|
- tp_catcher_task = (Carrier_task *)m_dispatch_catcher_node.mp_main_catcher_task.get();
|
|
|
|
|
|
+ tp_main_catcher = (Catcher *)m_dispatch_catcher_node.mp_main_catcher.get();
|
|
|
|
+ tp_main_catcher_task = (Catcher_task *)m_dispatch_catcher_node.mp_main_catcher_task.get();
|
|
}
|
|
}
|
|
|
|
|
|
//抓取器的控制动作
|
|
//抓取器的控制动作
|
|
@@ -776,7 +1231,22 @@ Error_manager Dispatch_process::connect_dispatch_catcher(std::shared_ptr<Dispatc
|
|
return t_error;
|
|
return t_error;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+//断开调度设备, 收回任务单, 释放任务单 与设备解除连接
|
|
|
|
+Error_manager Dispatch_process::disconnect_dispatch_device(std::shared_ptr<Dispatch_device_base> & p_device, std::shared_ptr<Task_Base> & p_device_task)
|
|
|
|
+{
|
|
|
|
+ if ( p_device.get() != NULL && p_device_task.get() != NULL )
|
|
|
|
+ {
|
|
|
|
+ p_device_task->set_task_statu(Task_Base::Task_statu::TASK_WITHDRAW);
|
|
|
|
+ p_device.reset();
|
|
|
|
+ p_device_task.reset();
|
|
|
|
+ return Error_code::SUCCESS;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ return Error_manager(Error_code::POINTER_IS_NULL, Error_level::MINOR_ERROR,
|
|
|
|
+ " POINTER IS NULL ");
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2000,7 +2470,7 @@ Error_manager Dispatch_process::excute_carrier_receive_car_from_robot(Dispatch_c
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
{
|
|
{
|
|
- if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
|
|
+ if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK && tp_carrier->get_device_id() !=2)
|
|
{
|
|
{
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
tp_carrier_task->m_step++;
|
|
tp_carrier_task->m_step++;
|
|
@@ -2173,7 +2643,7 @@ Error_manager Dispatch_process::excute_carrier_store_car_to_parkingspace(Dispatc
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 13 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
if ( tp_carrier_task->m_step == 13 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
{
|
|
{
|
|
- if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
|
|
+ if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK && tp_carrier->get_device_id() !=2)
|
|
{
|
|
{
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
tp_carrier_task->m_step++;
|
|
tp_carrier_task->m_step++;
|
|
@@ -2404,7 +2874,7 @@ Error_manager Dispatch_process::excute_carrier_store_car_to_parkingspace_ex(Disp
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 13 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
if ( tp_carrier_task->m_step == 13 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
{
|
|
{
|
|
- if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
|
|
+ if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK && tp_carrier->get_device_id() !=2)
|
|
{
|
|
{
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
tp_carrier_task->m_step++;
|
|
tp_carrier_task->m_step++;
|
|
@@ -2596,7 +3066,7 @@ Error_manager Dispatch_process::excute_carrier_pickup_car_from_parkingspace(Disp
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
{
|
|
{
|
|
- if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
|
|
+ if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK && tp_carrier->get_device_id() != 2)
|
|
{
|
|
{
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
tp_carrier_task->m_step++;
|
|
tp_carrier_task->m_step++;
|
|
@@ -2677,8 +3147,16 @@ Error_manager Dispatch_process::excute_carrier_pickup_car_from_parkingspace(Disp
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 23 )//收回对接,之后中跑车固定在电梯上不能X轴移动,电梯可以Z轴移动
|
|
if ( tp_carrier_task->m_step == 23 )//收回对接,之后中跑车固定在电梯上不能X轴移动,电梯可以Z轴移动
|
|
{
|
|
{
|
|
- carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_TAKE_BACK);
|
|
|
|
- tp_carrier_task->m_step++;
|
|
|
|
|
|
+ if ( tp_carrier->get_device_id() != 2 )
|
|
|
|
+ {
|
|
|
|
+ carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_TAKE_BACK);
|
|
|
|
+ tp_carrier_task->m_step++;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ tp_carrier_task->m_step +=2;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 24 )
|
|
if ( tp_carrier_task->m_step == 24 )
|
|
{
|
|
{
|
|
@@ -2819,7 +3297,7 @@ Error_manager Dispatch_process::excute_carrier_pickup_car_from_parkingspace_ex(D
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
{
|
|
{
|
|
- if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
|
|
+ if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK && tp_carrier->get_device_id() != 2)
|
|
{
|
|
{
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
tp_carrier_task->m_step++;
|
|
tp_carrier_task->m_step++;
|
|
@@ -3004,7 +3482,7 @@ Error_manager Dispatch_process::excute_carrier_deliver_car_to_robot(Dispatch_con
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
if ( tp_carrier_task->m_step == 11 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
{
|
|
{
|
|
- if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
|
|
+ if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK && tp_carrier->get_device_id() !=2)
|
|
{
|
|
{
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
tp_carrier_task->m_step++;
|
|
tp_carrier_task->m_step++;
|
|
@@ -3152,7 +3630,7 @@ Error_manager Dispatch_process::excute_carrier_move(Dispatch_control_node & disp
|
|
}
|
|
}
|
|
if ( tp_carrier_task->m_step == 9 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
if ( tp_carrier_task->m_step == 9 )//伸出对接,之后中跑车可以x轴移动,电梯不能Z轴移动
|
|
{
|
|
{
|
|
- if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK )
|
|
|
|
|
|
+ if ( tp_carrier->m_actual_joint_motion_x1 == Dispatch_device_base::Joint_motion::E_JOINT_TAKE_BACK && tp_carrier->get_device_id() !=2)
|
|
{
|
|
{
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
carrier_joint_x(dispatch_control_node, tp_carrier, tp_carrier_task, tp_dispatch_coordinates, Carrier_task::Joint_motion::E_JOINT_HOLD_OUT);
|
|
tp_carrier_task->m_step++;
|
|
tp_carrier_task->m_step++;
|
|
@@ -3198,7 +3676,7 @@ Error_manager Dispatch_process::excute_passageway_motion(Dispatch_control_node &
|
|
|
|
|
|
|
|
|
|
//检查 任务单 是否完成任务, 里面会调整短步骤
|
|
//检查 任务单 是否完成任务, 里面会调整短步骤
|
|
-Error_manager Dispatch_process::check_task(std::shared_ptr<Task_Base> p_task, Dispatch_control_status & dispatch_control_status)
|
|
|
|
|
|
+Error_manager Dispatch_process::check_task_status(std::shared_ptr<Task_Base> p_task, Dispatch_control_status & dispatch_control_status)
|
|
{
|
|
{
|
|
if ( p_task.get() == NULL )
|
|
if ( p_task.get() == NULL )
|
|
{
|
|
{
|
|
@@ -3210,7 +3688,9 @@ Error_manager Dispatch_process::check_task(std::shared_ptr<Task_Base> p_task, Di
|
|
if ( p_task->get_task_statu() == Task_Base::Task_statu::TASK_OVER )
|
|
if ( p_task->get_task_statu() == Task_Base::Task_statu::TASK_OVER )
|
|
{
|
|
{
|
|
dispatch_control_status = (Dispatch_control_status)(dispatch_control_status+1);
|
|
dispatch_control_status = (Dispatch_control_status)(dispatch_control_status+1);
|
|
- return Error_code::NODATA; //这里返回nodata 表示任务继续下一步
|
|
|
|
|
|
+// return Error_code::NODATA; //这里返回nodata 表示任务继续下一步
|
|
|
|
+ //注意了, 这里返回成功, 用作动作完成判断
|
|
|
|
+ return Error_code::SUCCESS; //这里返回nodata 表示任务继续下一步
|
|
}
|
|
}
|
|
else if ( p_task->get_task_statu() == Task_Base::Task_statu::TASK_ERROR )
|
|
else if ( p_task->get_task_statu() == Task_Base::Task_statu::TASK_ERROR )
|
|
{
|
|
{
|
|
@@ -3737,8 +4217,42 @@ Error_manager Dispatch_process::catcher_adjust_to_ready(std::string dispatch_con
|
|
return Error_code::SUCCESS;
|
|
return Error_code::SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//机器手 移动x
|
|
|
|
+Error_manager Dispatch_process::catcher_move_x(std::string dispatch_control_command_key, Catcher * tp_catcher, Catcher_task * tp_catcher_task, Dispatch_coordinates * tp_dispatch_coordinates, float target_x)
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+ std::unique_lock<std::mutex> t_lock2(tp_catcher_task->m_lock);
|
|
|
|
+ tp_catcher_task->m_request_key = dispatch_control_command_key;
|
|
|
|
+ tp_catcher_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
|
|
+
|
|
|
|
+ //机器手 移动x
|
|
|
|
+ tp_catcher_task->m_request_x = target_x;
|
|
|
|
+
|
|
|
|
+ std::cout << " huli test :::: " << " catcher_move_x = " << tp_catcher_task->m_request_key << std::endl;
|
|
|
|
+ std::cout << " huli test :::: " << " catcher_move_x = " << tp_catcher_task->m_respons_key << std::endl;
|
|
|
|
+ std::cout << " huli test :::: " << " tp_catcher_task->m_request_x = " << tp_catcher_task->m_request_x << std::endl;
|
|
|
|
+
|
|
|
|
+ return Error_code::SUCCESS;
|
|
|
|
+}
|
|
|
|
+//机器手 移动y
|
|
|
|
+Error_manager Dispatch_process::catcher_move_y(std::string dispatch_control_command_key, Catcher * tp_catcher, Catcher_task * tp_catcher_task, Dispatch_coordinates * tp_dispatch_coordinates, float target_y)
|
|
|
|
+{
|
|
|
|
+
|
|
|
|
+ std::unique_lock<std::mutex> t_lock2(tp_catcher_task->m_lock);
|
|
|
|
+ tp_catcher_task->m_request_key = dispatch_control_command_key;
|
|
|
|
+ tp_catcher_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
|
|
+
|
|
|
|
+ //机器手 移动y
|
|
|
|
+ tp_catcher_task->m_request_y = target_y;
|
|
|
|
+
|
|
|
|
+ std::cout << " huli test :::: " << " catcher_move_y = " << tp_catcher_task->m_request_key << std::endl;
|
|
|
|
+ std::cout << " huli test :::: " << " catcher_move_y = " << tp_catcher_task->m_respons_key << std::endl;
|
|
|
|
+ std::cout << " huli test :::: " << " tp_catcher_task->m_request_y = " << tp_catcher_task->m_request_y << std::endl;
|
|
|
|
+
|
|
|
|
+ return Error_code::SUCCESS;
|
|
|
|
+}
|
|
//机器手 移动z
|
|
//机器手 移动z
|
|
-Error_manager Dispatch_process::catcher_move_z(std::string dispatch_control_command_key, Catcher * tp_catcher, Catcher_task * tp_catcher_task, Dispatch_coordinates * tp_dispatch_coordinates, float target)
|
|
|
|
|
|
+Error_manager Dispatch_process::catcher_move_z(std::string dispatch_control_command_key, Catcher * tp_catcher, Catcher_task * tp_catcher_task, Dispatch_coordinates * tp_dispatch_coordinates, float target_z)
|
|
{
|
|
{
|
|
|
|
|
|
std::unique_lock<std::mutex> t_lock2(tp_catcher_task->m_lock);
|
|
std::unique_lock<std::mutex> t_lock2(tp_catcher_task->m_lock);
|
|
@@ -3746,7 +4260,7 @@ Error_manager Dispatch_process::catcher_move_z(std::string dispatch_control_comm
|
|
tp_catcher_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
tp_catcher_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
|
|
|
|
//机器手 移动z
|
|
//机器手 移动z
|
|
- tp_catcher_task->m_request_z = target;
|
|
|
|
|
|
+ tp_catcher_task->m_request_z = target_z;
|
|
|
|
|
|
std::cout << " huli test :::: " << " catcher_move_z = " << tp_catcher_task->m_request_key << std::endl;
|
|
std::cout << " huli test :::: " << " catcher_move_z = " << tp_catcher_task->m_request_key << std::endl;
|
|
std::cout << " huli test :::: " << " catcher_move_z = " << tp_catcher_task->m_respons_key << std::endl;
|
|
std::cout << " huli test :::: " << " catcher_move_z = " << tp_catcher_task->m_respons_key << std::endl;
|
|
@@ -3970,7 +4484,27 @@ Error_manager Dispatch_process::catcher_adjust_from_carrier(std::string dispatch
|
|
return Error_code::SUCCESS;
|
|
return Error_code::SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//搬运器 准备开始, 需要同步任务单和设备真实数据.
|
|
|
|
+Error_manager Dispatch_process::carrier_ready_to_start(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates)
|
|
|
|
+{
|
|
|
|
+ std::unique_lock<std::mutex> t_lock2(tp_carrier_task->m_lock);
|
|
|
|
+ tp_carrier_task->m_request_key = dispatch_control_command_key;
|
|
|
|
+ tp_carrier_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
|
|
+
|
|
|
|
+ tp_carrier_task->m_request_x = tp_carrier->m_actual_x;
|
|
|
|
+ tp_carrier_task->m_request_y = tp_carrier->m_actual_y;
|
|
|
|
+ tp_carrier_task->m_request_z = tp_carrier->m_actual_z;
|
|
|
|
+ tp_carrier_task->m_request_y1 = tp_carrier->m_actual_y1;
|
|
|
|
+ tp_carrier_task->m_request_y2 = tp_carrier->m_actual_y2;
|
|
|
|
+ tp_carrier_task->m_request_clamp_motion = (Carrier_task::Clamp_motion)tp_carrier->m_actual_clamp_motion1;
|
|
|
|
+ tp_carrier_task->m_request_joint_motion_x = (Carrier_task::Joint_motion)tp_carrier->m_actual_joint_motion_x1;
|
|
|
|
+ tp_carrier_task->m_request_joint_motion_y = Carrier_task::Joint_motion::E_JOINT_NO_ACTION;
|
|
|
|
+ tp_carrier_task->m_request_space_id = 0;
|
|
|
|
+ tp_carrier_task->m_request_floor_id = 0;
|
|
|
|
+ tp_carrier_task->m_request_wheelbase = Dispatch_coordinates::get_instance_references().m_default_wheelbase;
|
|
|
|
|
|
|
|
+ return Error_code::SUCCESS;
|
|
|
|
+}
|
|
//搬运器调整到 正常待机的姿态(调节夹杆和轴距)
|
|
//搬运器调整到 正常待机的姿态(调节夹杆和轴距)
|
|
Error_manager Dispatch_process::carrier_adjust_to_ready(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates)
|
|
Error_manager Dispatch_process::carrier_adjust_to_ready(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates)
|
|
{
|
|
{
|
|
@@ -3995,14 +4529,14 @@ Error_manager Dispatch_process::carrier_adjust_to_ready(std::string dispatch_con
|
|
}
|
|
}
|
|
|
|
|
|
//搬运器 移动x
|
|
//搬运器 移动x
|
|
-Error_manager Dispatch_process::carrier_move_x(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates, float target)
|
|
|
|
|
|
+Error_manager Dispatch_process::carrier_move_x(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates, float target_x)
|
|
{
|
|
{
|
|
|
|
|
|
std::unique_lock<std::mutex> t_lock2(tp_carrier_task->m_lock);
|
|
std::unique_lock<std::mutex> t_lock2(tp_carrier_task->m_lock);
|
|
tp_carrier_task->m_request_key = dispatch_control_command_key;
|
|
tp_carrier_task->m_request_key = dispatch_control_command_key;
|
|
tp_carrier_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
tp_carrier_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
|
|
|
|
- tp_carrier_task->m_request_x = target;
|
|
|
|
|
|
+ tp_carrier_task->m_request_x = target_x;
|
|
|
|
|
|
std::cout << " huli test :::: " << " carrier_move_x = " << tp_carrier_task->m_request_key << std::endl;
|
|
std::cout << " huli test :::: " << " carrier_move_x = " << tp_carrier_task->m_request_key << std::endl;
|
|
std::cout << " huli test :::: " << " carrier_move_x = " << tp_carrier_task->m_respons_key << std::endl;
|
|
std::cout << " huli test :::: " << " carrier_move_x = " << tp_carrier_task->m_respons_key << std::endl;
|
|
@@ -4012,14 +4546,14 @@ Error_manager Dispatch_process::carrier_move_x(std::string dispatch_control_comm
|
|
}
|
|
}
|
|
|
|
|
|
//搬运器 移动y
|
|
//搬运器 移动y
|
|
-Error_manager Dispatch_process::carrier_move_y(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates, float target)
|
|
|
|
|
|
+Error_manager Dispatch_process::carrier_move_y(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates, float target_y)
|
|
{
|
|
{
|
|
|
|
|
|
std::unique_lock<std::mutex> t_lock2(tp_carrier_task->m_lock);
|
|
std::unique_lock<std::mutex> t_lock2(tp_carrier_task->m_lock);
|
|
tp_carrier_task->m_request_key = dispatch_control_command_key;
|
|
tp_carrier_task->m_request_key = dispatch_control_command_key;
|
|
tp_carrier_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
tp_carrier_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
|
|
|
|
- tp_carrier_task->m_request_y = target;
|
|
|
|
|
|
+ tp_carrier_task->m_request_y = target_y;
|
|
tp_carrier_task->m_request_wheelbase = m_wheel_base;
|
|
tp_carrier_task->m_request_wheelbase = m_wheel_base;
|
|
tp_carrier_task->m_request_y1 = tp_carrier_task->m_request_y + tp_dispatch_coordinates->m_carrier_y_y1_distance;
|
|
tp_carrier_task->m_request_y1 = tp_carrier_task->m_request_y + tp_dispatch_coordinates->m_carrier_y_y1_distance;
|
|
tp_carrier_task->m_request_y2 = tp_carrier_task->m_request_y1 - tp_carrier_task->m_request_wheelbase;
|
|
tp_carrier_task->m_request_y2 = tp_carrier_task->m_request_y1 - tp_carrier_task->m_request_wheelbase;
|
|
@@ -4035,14 +4569,14 @@ Error_manager Dispatch_process::carrier_move_y(std::string dispatch_control_comm
|
|
}
|
|
}
|
|
|
|
|
|
//搬运器 移动z
|
|
//搬运器 移动z
|
|
-Error_manager Dispatch_process::carrier_move_z(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates, float target)
|
|
|
|
|
|
+Error_manager Dispatch_process::carrier_move_z(std::string dispatch_control_command_key, Carrier * tp_carrier, Carrier_task * tp_carrier_task, Dispatch_coordinates * tp_dispatch_coordinates, float target_z)
|
|
{
|
|
{
|
|
|
|
|
|
std::unique_lock<std::mutex> t_lock2(tp_carrier_task->m_lock);
|
|
std::unique_lock<std::mutex> t_lock2(tp_carrier_task->m_lock);
|
|
tp_carrier_task->m_request_key = dispatch_control_command_key;
|
|
tp_carrier_task->m_request_key = dispatch_control_command_key;
|
|
tp_carrier_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
tp_carrier_task->set_task_statu(Task_Base::TASK_CREATED);
|
|
|
|
|
|
- tp_carrier_task->m_request_z = target;
|
|
|
|
|
|
+ tp_carrier_task->m_request_z = target_z;
|
|
|
|
|
|
std::cout << " huli test :::: " << " carrier_move_z = " << tp_carrier_task->m_request_key << std::endl;
|
|
std::cout << " huli test :::: " << " carrier_move_z = " << tp_carrier_task->m_request_key << std::endl;
|
|
std::cout << " huli test :::: " << " carrier_move_z = " << tp_carrier_task->m_respons_key << std::endl;
|
|
std::cout << " huli test :::: " << " carrier_move_z = " << tp_carrier_task->m_respons_key << std::endl;
|