delphyne
delphyne.utilities Namespace Reference

Functions

def get_from_env_or_fail (var)
 Environment. More...
 
def get_delphyne_resource_root ()
 
def get_delphyne_resource (path)
 
def add_simple_car (builder, name, position_x, position_y, heading=0.0, speed=0.0)
 Agents. More...
 
def add_mobil_car (builder, name, scene_x, scene_y, heading, speed)
 
def add_rail_car (builder, name, lane, position, offset, speed, direction_of_travel=True)
 
def add_trajectory_agent (builder, name, times, headings, waypoints)
 
def emplace (method)
 Other. More...
 

Function Documentation

◆ add_mobil_car()

def delphyne.utilities.add_mobil_car (   builder,
  name,
  scene_x,
  scene_y,
  heading,
  speed 
)
Adds a lane changing (MOBIL) car to the simulation and returns
its blueprint.

◆ add_rail_car()

def delphyne.utilities.add_rail_car (   builder,
  name,
  lane,
  position,
  offset,
  speed,
  direction_of_travel = True 
)
Adds a centre-line following rail car to the simulation and
returns its blueprint.

◆ add_simple_car()

def delphyne.utilities.add_simple_car (   builder,
  name,
  position_x,
  position_y,
  heading = 0.0,
  speed = 0.0 
)

Agents.

These are methods that typically don't do much, but basically ensure that adding an agent to the simulation is pythonic and doesn't leave you with zombie objects after ownership has been transferred to a simulation

  • construct the agent
  • add it to the simulator
  • check that the operation succeeded
  • failure : throw an exception
  • success : return a handle to the agent

TODO(daniel.stonier) exception handling and return handles to the agent

Adds a simple car to the simulation and returns its blueprint.

◆ add_trajectory_agent()

def delphyne.utilities.add_trajectory_agent (   builder,
  name,
  times,
  headings,
  waypoints 
)
Adds a trajectory agent to the simulation and returns its blueprint.
The trajectory is a time parameterised curve that is constructed
from lists of knot points defined by times, headings and translations.
Args:
    builder: the agent simulation builder object
    name: name of the agent
    times: list of times defining the trajectory (floats)
    headings: list of yaw headings defining the trajectory (floats)
    waypoints: list of points (x,y,z) defining the trajectory (x, y, z)
An example waypoints argument:
    waypoints = [[0.0, 0.0, 0.0], [1.25, 0.0, 0.0]]

◆ emplace()

def delphyne.utilities.emplace (   method)

Other.

Python decorator that performs an in-place replacement of the given
`method` using the decorated function, that takes the associated
class object and the method itself as arguments, in that order.

:param method: unbound class method.

◆ get_delphyne_resource()

def delphyne.utilities.get_delphyne_resource (   path)
Resolve the path against delphyne resources root location.

◆ get_delphyne_resource_root()

def delphyne.utilities.get_delphyne_resource_root ( )
Return the root path where delphyne resources live

◆ get_from_env_or_fail()

def delphyne.utilities.get_from_env_or_fail (   var)

Environment.

Retrieves an env variable for a given name, fails if not found.