commonroad-io Interface

collision_detection

commonroad_cc.collision_detection.pycrcc_collision_dispatch.create_collision_checker(obj, params=None, collision_checker_func=None)[source]

Function to convert a commonroad-io scenario to a C++ collision checker.

Parameters
  • obj – the commonroad-io scenario

  • params – optional parameters, e.g. adding the minkowski sum with a circle

  • collision_object_func – specify the converter function (it is usually not necessary to change the default)

Return type

CollisionChecker

Returns

Returns the C++ collision checker

commonroad_cc.collision_detection.pycrcc_collision_dispatch.create_collision_object(obj, params=None, collision_object_func=None)[source]

Main function to convert a commonroad-io shape to a C++ collision object.

Parameters
  • obj – the object or list of objects (with all the same type) to be converted to C++ collision objects

  • params – optional parameters, e.g. adding the minkowski sum with a circle

  • collision_object_func – specify the converter function (it is usually not necessary to change the default)

Return type

CollisionObject

Returns

Returns the C++ collision object

draw_dispatch

commonroad_cc.visualization.draw_dispatch.draw_object(obj, plot_limits=None, ax=None, draw_params=None, draw_func=None, handles=None, call_stack=None)[source]

Main function for drawing objects from the commonroad-collision-checker.

Parameters
  • obj – the object or list of objects (with all the same type) to be plotted

  • plot_limits – list of [x_min, x_max, y_min, y_max] that defines the plotted area

  • ax – axes object from matplotlib

  • draw_params – parameters for plotting given by a nested dict that recreates the structure of an object, see documentation for full overview over the structure. If parameters are not set, the default setting are used.

  • draw_func – specify the drawing function (usually not necessary to change default)

  • handles – dict that assign to every object_id of all plotted obstacles the corresponding patch handles

  • call_stack – tuple of string containing the call stack, which allows for differentiation of plotting styles depending on the call stack of draw_object, (usually ‘None’!)

Returns

Returns matplotlib patch object for draw_funcs that actually draw a patch (used internally for creating handles dict)