|
@@ -332,15 +332,16 @@ bool Navigation::execute_adjust_action(const Pose2d& target,const Pose2d& target
|
|
|
//停止状态
|
|
|
if (action == 0) {
|
|
|
//优先进入旋转
|
|
|
- if (Pose2d::abs(diff).theta() > thresh.theta()) {
|
|
|
- action = 1; //原地旋转
|
|
|
- } else if (Pose2d::abs(diff).x() > thresh.x()) {
|
|
|
+ if (Pose2d::abs(diff).x() > thresh.x()) {
|
|
|
//前进
|
|
|
action = 3;
|
|
|
}else if (Pose2d::abs(diff).y() > thresh.y()) {
|
|
|
//横移
|
|
|
action = 2;
|
|
|
}
|
|
|
+ else if (Pose2d::abs(diff).theta() > thresh.theta()) {
|
|
|
+ action = 1; //原地旋转
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -348,6 +349,7 @@ bool Navigation::execute_adjust_action(const Pose2d& target,const Pose2d& target
|
|
|
if (Pose2d::abs(diff).theta() > thresh.theta()) {
|
|
|
double theta = limit(diff.theta(),limit_rotate.min*M_PI/180.0,limit_rotate.max*M_PI/180.0);
|
|
|
SendMoveCmd(move_mode_,Monitor_emqx::eRotate, 0, theta);
|
|
|
+ //std::cout<<"current:"<<timedPose_.Get()<<" target:"<<target<<" diff:"<<diff<<std::endl;
|
|
|
printf(" Ratate :%f\n",theta);
|
|
|
continue;
|
|
|
}
|