Merge branch 'new_opentcs' of http://git.picaiba.com/agv/opentcs into new_opentcs
This commit is contained in:
@@ -1032,6 +1032,14 @@ public class DefaultVehicleController
|
||||
Point currentVehiclePosition = originalCommand.getStep().getDestinationPoint();
|
||||
Deque<Set<TCSResource<?>>> allocatedResources
|
||||
= commandProcessingTracker.getAllocatedResources();
|
||||
|
||||
// KernelApplicationConfiguration.VehicleResourceManagementType vehicleResourceManagementType
|
||||
// = configuration.vehicleResourceManagementType();
|
||||
// System.out.println("vehicleResourceManagementType: " + vehicleResourceManagementType);
|
||||
//
|
||||
// long length = commAdapter.getProcessModel().getBoundingBox().getLength();
|
||||
// System.out.println("vehicle_length: " + length);
|
||||
|
||||
switch (configuration.vehicleResourceManagementType()) {
|
||||
case LENGTH_IGNORED:
|
||||
while (!allocatedResources.peek().contains(currentVehiclePosition)) {
|
||||
@@ -1044,11 +1052,13 @@ public class DefaultVehicleController
|
||||
case LENGTH_RESPECTED:
|
||||
// Free resources allocated for executed commands, but keep as many as needed for the
|
||||
// vehicle's current length.
|
||||
long vehicleLeghtRadius = 3700 / 2; //车辆长度半径
|
||||
BoundingBox boundingBox = commAdapter.getProcessModel().getBoundingBox().withLength(vehicleLeghtRadius); //长度有问题
|
||||
int freeableResourceSetCount
|
||||
= ResourceMath.freeableResourceSetCount(
|
||||
SplitResources.from(allocatedResources, Set.of(currentVehiclePosition))
|
||||
.getResourcesPassed(),
|
||||
commAdapter.getProcessModel().getBoundingBox().getLength()
|
||||
boundingBox.getLength()
|
||||
);
|
||||
for (int i = 0; i < freeableResourceSetCount; i++) {
|
||||
Set<TCSResource<?>> oldResources = allocatedResources.poll();
|
||||
|
||||
@@ -451,6 +451,7 @@ public class TransportOrderPoolManager
|
||||
throws ObjectUnknownException {
|
||||
TransportOrder order = getObjectRepo().getObject(TransportOrder.class, ref);
|
||||
// Make sure only orders in a final state are removed.
|
||||
LOG.info("removeTransportOrder name: {}, state: {}", order.getName(), order.getState());
|
||||
checkArgument(
|
||||
order.getState().isFinalState(),
|
||||
"Transport order %s is not in a final state.",
|
||||
|
||||
Reference in New Issue
Block a user