some adjustment

This commit is contained in:
acki
2026-01-28 13:55:30 +01:00
parent 94c00f5ad4
commit 272294bc88
5 changed files with 21 additions and 9 deletions

View File

@@ -54,10 +54,10 @@ class SimulatedPCB:
# --- motion ---
if wp['type'] == 1: # precise waypoint
speed = min(120.0, distance * 1)
self.vtheta = max(-6.0, min(6.0, theta_error * 2))
speed = min(250.0, distance * 2.0)
self.vtheta = max(-10.0, min(10.0, theta_error * 4.0))
else: # transit waypoint
speed = min(180.0, distance * 2)
speed = min(400.0, distance * 3.0)
self.vtheta = 0.0
self.vx = speed * math.cos(target_angle)

View File

@@ -36,8 +36,8 @@
<home>
<!--<blue x="2650" y="1600" theta="-1.5708"/>
<yellow x="350" y="1600" theta="-1.5708"/>-->
<blue x="2650" y="1700" theta="-1.5708"/>
<yellow x="350" y="1700" theta="-1.5708"/>
<blue x="2650" y="1750" theta="-1.5708"/>
<yellow x="350" y="1750" theta="-1.5708"/>
</home>
<spawn>
<yellow>

View File

@@ -1,8 +1,8 @@
<pami_zone>
<!--
<zone id="1000" x="725" y="1625" theta="-1.5708" width="150" height="450" type="pami-middle" />
<zone id="1001" x="900" y="1550" theta="-1.5708" width="200" height="500" type="pami-middle" />
<zone id="1002" x="1500" y="1500" theta="-1.5708" width="1000" height="600" type="pami-middle" />
<zone id="1003" x="2100" y="1550" theta="-1.5708" width="200" height="500" type="pami-middle" />
<zone id="1004" x="2275" y="1625" theta="-1.5708" width="150" height="450" type="pami-middle" />
<zone id="1004" x="2275" y="1625" theta="-1.5708" width="150" height="450" type="pami-middle" />-->
</pami_zone>

View File

@@ -74,11 +74,17 @@ namespace Modelec {
{
auto currPos = nav_->GetCurrentPos();
target_deposite_zone_ = nav_->GetClosestDepositeZone(currPos, {}, true);
if (target_deposite_zone_ == nullptr)
{
status_ = MissionStatus::FAILED;
return;
}
auto dist = std::clamp(Point::distance(Point(currPos->x, currPos->y, currPos->theta),
nav_->GetClosestDepositeZone(nav_->GetCurrentPos())->GetPosition()), 0.0, 200.0);
target_deposite_zone_ = nav_->GetClosestDepositeZone(nav_->GetCurrentPos(), {}, true);
auto depoPoint = target_deposite_zone_->GetBestTakePosition(Point(currPos->x, currPos->y, currPos->theta));
auto pos = depoPoint.GetTakePosition(dist);

View File

@@ -74,6 +74,12 @@ namespace Modelec {
closestBox = nav_->GetClosestObstacle<BoxObstacle>(nav_->GetCurrentPos());
if (closestBox == nullptr)
{
status_ = MissionStatus::FAILED;
break;
}
action_executor_->box_obstacles_[front_] = closestBox;
auto pos = closestBox->GetOptimizedGetPos(nav_->GetCurrentPos()).GetTakeBasePosition();