|
@@ -428,6 +428,7 @@ bool Navigation::RotateReferToTarget(const Pose2d &target, stLimit limit_rotate,
|
|
|
|
|
|
|
|
|
bool Navigation::AdjustReferToTarget(const Pose2d& target, stLimit limit_rotate) {
|
|
|
+ std::cout<<"Adjust to : "<<target<<std::endl;
|
|
|
if (inited_ == false) {
|
|
|
printf(" MPC_rotate has not inited\n");
|
|
|
return false;
|
|
@@ -442,8 +443,8 @@ bool Navigation::AdjustReferToTarget(const Pose2d& target, stLimit limit_rotate)
|
|
|
yawTarget.set_x(current.x() + 100.);
|
|
|
yawTarget.set_y(current.y());
|
|
|
int directions = Direction::eForward | Direction::eRight | Direction::eLeft | Direction::eBackward;
|
|
|
+ std::cout<<"Adjust RotateRefer : "<<Pose2d(yawTarget.x(),yawTarget.y(),0)<<std::endl;
|
|
|
RotateReferToTarget(yawTarget, limit_rotate, directions);
|
|
|
- printf(" exec MPC_rotate autoDirect:%d\n", directions);
|
|
|
|
|
|
current = timedPose_.Get();
|
|
|
Pose2d diff=target-current;
|
|
@@ -463,6 +464,7 @@ bool Navigation::AdjustReferToTarget(const Pose2d& target, stLimit limit_rotate)
|
|
|
|
|
|
stLimit limitV={0.03,0.5};
|
|
|
stLimit limitW={0.03,0.1};
|
|
|
+ std::cout<<" Adjust MoveTarget:"<<Pose2d(node.x(),node.y(),node.theta())<<std::endl;
|
|
|
return MoveToTarget(node,limitV,limitW,true,true);
|
|
|
|
|
|
}
|
|
@@ -1507,7 +1509,8 @@ Navigation::MpcResult Navigation::MpcToTarget(NavMessage::PathNode node, stLimit
|
|
|
}
|
|
|
double Y1=0.0,Y2=0.0;
|
|
|
if(move_mode_==eDouble){
|
|
|
- Y1=timeYawDiff1_.Get();
|
|
|
+ double dy=-timeYawDiff1_.Get();
|
|
|
+ Y1=0.2*(1.0/(1+exp(-16.*dy))-0.5)*1.0;
|
|
|
Y2=timeYawDiff2_.Get();
|
|
|
}
|
|
|
if (directY == false)
|
|
@@ -1540,6 +1543,8 @@ Navigation::MpcResult Navigation::MpcToTarget(NavMessage::PathNode node, stLimit
|
|
|
log_inf_line += " ";
|
|
|
log_inf_line += std::to_string(out[4]) + " " + std::to_string(out[5]);//下发速度
|
|
|
log_inf_line += " ";
|
|
|
+ log_inf_line += std::to_string(Y1) + " " + std::to_string(Y2);//下发速度
|
|
|
+ log_inf_line += " ";
|
|
|
|
|
|
auto cur_time = std::chrono::steady_clock::now();
|
|
|
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(cur_time - beg_time);
|
|
@@ -1670,7 +1675,7 @@ void Navigation::Start(const NavMessage::NavCmd &cmd, NavMessage::NavResponse &r
|
|
|
NavMessage::NewAction last_act = newUnfinished_cations_.back();
|
|
|
if (act.type() == 1) { //入库
|
|
|
space_id_ = act.spacenode().id();
|
|
|
- obs_w_ = 1.25;
|
|
|
+ obs_w_ = 1.1;
|
|
|
obs_h_ = 1.87;
|
|
|
if (!execute_InOut_space(act)) {
|
|
|
printf(" In space failed\n");
|
|
@@ -1687,7 +1692,7 @@ void Navigation::Start(const NavMessage::NavCmd &cmd, NavMessage::NavResponse &r
|
|
|
isInSpace_ = false;
|
|
|
}
|
|
|
} else if (act.type() == 3 || act.type() == 4) { //马路导航
|
|
|
- obs_w_ = 1.25;
|
|
|
+ obs_w_ = 1.1;
|
|
|
obs_h_ = 1.87;
|
|
|
int space_id = -1;
|
|
|
if (last_act.type() == 1) {
|