|
@@ -919,6 +919,18 @@ void Navigation::SendMoveCmd(int mode, ActionType type,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void Navigation::SendMoveCmd(int mode, ActionType type, double v, double angular, int space_id, double distance) {
|
|
|
+ if (monitor_) {
|
|
|
+ monitor_->set_ToAgvCmd(mode, type, v, angular, 0,space_id, distance);
|
|
|
+ if (type == eRotation)
|
|
|
+ RWheel_position_ = eR;
|
|
|
+ if (type == eVertical)
|
|
|
+ RWheel_position_ = eX;
|
|
|
+ if (type == eHorizontal)
|
|
|
+ RWheel_position_ = eY;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
bool Navigation::clamp_close() {
|
|
|
if (monitor_) {
|
|
|
printf("Clamp closing...\n");
|
|
@@ -1085,10 +1097,17 @@ Navigation::MpcResult Navigation::MpcToTarget(NavMessage::PathNode node, stLimit
|
|
|
}
|
|
|
//下发速度
|
|
|
//printf(" nav input :%f out:%f\n",timedV_.Get(),out[0]);
|
|
|
+ //添加车位号,距目标点距离信息
|
|
|
+ double distance = Pose2d::distance(target_in_agv, Pose2d(0,0,0));
|
|
|
+ int space_id = 0;
|
|
|
+ if(node.id().find('S')){
|
|
|
+ std::string id = node.id().substr(1,node.id().length()-1);
|
|
|
+ space_id = stoi(id);
|
|
|
+ }
|
|
|
if (directY == false)
|
|
|
- SendMoveCmd(move_mode_, eVertical, out[0], out[1]);
|
|
|
+ SendMoveCmd(move_mode_, eVertical, out[0], out[1], space_id, distance);
|
|
|
else
|
|
|
- SendMoveCmd(move_mode_, eHorizontal, out[0], out[1]);
|
|
|
+ SendMoveCmd(move_mode_, eHorizontal, out[0], out[1], space_id, distance);
|
|
|
actionType_ = directY ? eHorizontal : eVertical;
|
|
|
/*
|
|
|
* 判断车辆是否在终点附近徘徊,无法到达终点
|