How to replan route in vehicle

The picture shows route of a vehicle : Moving along line AB, rotating in point B, moving to point C at last.

Generally,VehicleController and it’s method addControllPoint are used to realize the movement. But sometimes I have to stop the vehicle at a certain point, such as point p, to avoid other vehicles, and then move it again.

How to achieve the processes above? Do method rePlan and clearPassedPoints help? If so, how to use them?

Best wishes.

Hi, Please have a look into the attached layout and video explanation of the python logic.

Refer to vcSimVehicle in Python API. You can use clearMove() to completely stop the vehicle. If you do not want the vehicle to stop, you can use rePlan() to reroute the vehicle. In both cases, you would need to tell the vehicle where to go next. You can use clearPassedPoints() to update the path length of vehicle.

Notes:

  • I would recommend you create a Path component that contains a set of Frames for a path, and then a separate Vehicle component. You can also use signals to have vehicles communicate with one another and Transport Protocol behaviors to make work orders more automated.
  • I have not been able to attach a vehicle to a OneWayPath, which would be nice for use routing rules and capacity tests to avoid collisions and simple flow of vehicles along a wired path.

DemoVehicle.vcmx (10.3 KB)

Hi,

There seems something wrong with the attachment. The picture shows the error when I tried to decompress it.

attachment again.

AGV_Kiva.zip (5.47 MB)

Hello,

Thank you for your help.

I now mainly want to achieve collision avoidance between AGVs according to actual control logic, so that we can optimize the system control through simulation.

The real logic to realize collision avoidance as below: the No.1 AGV will apply for next three points in calculated path when reaching a new point. If a certain point has been occupied by other AGV, the No.1 AGV will stop waiting until this point was released.

My confusion now is how to get the position coordinates of the AGV in real time. I don’t know where the AGV is when it is moving if simply adding points one by one . Event OnMovementFinished was used in attached layout, but the AGV will stop and go.

 

vehicleExp2.vcmx (1.78 MB)

A vehicle is a component, so get its position matrix in 3D world.

vcMatrix has an example of how to detect components at a 3D position. Likewise, there is a rayCast() method available in vcApplication for detecting components.

One way for vehicles/components to communicate is with an Action Container, which can be connected to a Python Script and used with the OnAction event. In a nutshell, an Action Container combined with a script allows you to send, receive and route data packets. Another option is to use signals.

I know the thread is very old, but for completeness, you can get the Path from OneWayPath.

from __future__ import print_function
from vcScript import *


def getPath(comp_name, owp_name):
  comp = getApplication().findComponent(comp_name)
  if comp:
    owp = comp.findBehaviour(owp_name)
    if owp:
      return owp.Path
  return []


def getPositions(comp_name, owp_name):
  return [pos.PositionMatrix.P for pos in getPath(comp_name, owp_name)]

pos = getPositions('Transfersystem', 'OneWayPath')
print(pos)

I’m working currently on a transfersystem. I used this before I switched over to my own implementation (csv-like).