|
@@ -68,6 +68,7 @@ void NavigationMain::SendMoveCmd(int mode, ActionType type,
|
|
bool NavigationMain::CreateRobotStatuMsg(NavMessage::RobotStatu &robotStatu) {
|
|
bool NavigationMain::CreateRobotStatuMsg(NavMessage::RobotStatu &robotStatu) {
|
|
if (Navigation::CreateRobotStatuMsg(robotStatu)) {
|
|
if (Navigation::CreateRobotStatuMsg(robotStatu)) {
|
|
robotStatu.mutable_agvstatu()->set_clamp_other(timed_other_clamp_.Get());
|
|
robotStatu.mutable_agvstatu()->set_clamp_other(timed_other_clamp_.Get());
|
|
|
|
+ robotStatu.mutable_agvstatu()->set_clamp_other(timed_other_lifter_.Get());
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
//std::cout<<agvStatu.DebugString()<<std::endl;
|
|
//std::cout<<agvStatu.DebugString()<<std::endl;
|
|
@@ -78,12 +79,18 @@ void NavigationMain::ResetOtherClamp(ClampStatu statu) {
|
|
timed_other_clamp_.reset(statu, 1);
|
|
timed_other_clamp_.reset(statu, 1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void NavigationMain::ResetOtherLifter(LifterStatus status) {
|
|
|
|
+ timed_other_lifter_.reset(status, 1);
|
|
|
|
+}
|
|
|
|
+
|
|
void NavigationMain::HandleAgvStatu(const MqttMsg &msg) {
|
|
void NavigationMain::HandleAgvStatu(const MqttMsg &msg) {
|
|
NavMessage::AgvStatu speed;
|
|
NavMessage::AgvStatu speed;
|
|
if (msg.toProtoMessage(speed)) {
|
|
if (msg.toProtoMessage(speed)) {
|
|
ResetStatu(speed.v(), speed.w());
|
|
ResetStatu(speed.v(), speed.w());
|
|
ResetClamp((ClampStatu) speed.clamp());
|
|
ResetClamp((ClampStatu) speed.clamp());
|
|
ResetOtherClamp((ClampStatu) speed.clamp_other());
|
|
ResetOtherClamp((ClampStatu) speed.clamp_other());
|
|
|
|
+ ResetLifter((LifterStatus) speed.lifter());
|
|
|
|
+ ResetOtherLifter((LifterStatus) speed.lifter_other());
|
|
//printf(" clamp:%d other:%d\n",speed.clamp(),speed.clamp_other());
|
|
//printf(" clamp:%d other:%d\n",speed.clamp(),speed.clamp_other());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -135,6 +142,54 @@ bool NavigationMain::clamp_open() {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool NavigationMain::lifter_rise() {
|
|
|
|
+ if (move_mode_ == eSingle) {
|
|
|
|
+ return Navigation::lifter_rise();
|
|
|
|
+ }
|
|
|
|
+ if (monitor_) {
|
|
|
|
+ printf("双车提升机构提升\n");
|
|
|
|
+ monitor_->lifter_rise(move_mode_);
|
|
|
|
+ while (exit_ == false) {
|
|
|
|
+ if (timed_lifter_.timeout() || timed_other_lifter_.timeout()) {
|
|
|
|
+ printf("timed lifter is timeout\n");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (timed_lifter_.Get() == eRose && timed_other_lifter_.Get() == eRose) {
|
|
|
|
+ printf("双车提升机构提升completed!!!\n");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
|
|
|
+ monitor_->lifter_rise(move_mode_);
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool NavigationMain::lifter_down() {
|
|
|
|
+ if (move_mode_ == eSingle) {
|
|
|
|
+ return Navigation::lifter_down();
|
|
|
|
+ }
|
|
|
|
+ if (monitor_) {
|
|
|
|
+ printf("双车提升机构下降\n");
|
|
|
|
+ monitor_->lifter_down(move_mode_);
|
|
|
|
+ while (exit_ == false) {
|
|
|
|
+ if (timed_lifter_.timeout() || timed_other_lifter_.timeout()) {
|
|
|
|
+ printf("timed lifter is timeout\n");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (timed_lifter_.Get() == eRose && timed_other_lifter_.Get() == eRose) {
|
|
|
|
+ printf("双车提升机构下降completed!!!\n");
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
|
|
|
+ monitor_->lifter_down(move_mode_);
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
|
Navigation::MpcResult
|
|
Navigation::MpcResult
|
|
NavigationMain::RotateBeforeEnterSpace(NavMessage::PathNode space, double wheelbase, NavMessage::PathNode &target) {
|
|
NavigationMain::RotateBeforeEnterSpace(NavMessage::PathNode space, double wheelbase, NavMessage::PathNode &target) {
|
|
// if (timedBrotherNavStatu_.timeout() || timedPose_.timeout()) {
|
|
// if (timedBrotherNavStatu_.timeout() || timedPose_.timeout()) {
|