Example #1
0
def setParametersBeforeCreation():
    """set parameters as strings before plug-ins/vehicles creation"""

    steerMgr = OSSteerManager.get_global_ptr()
    valueList = ValueList_string()
    # set plug-in type
    steerMgr.set_parameter_value(OSSteerManager.STEERPLUGIN, "plugin_type",
                                 "boid")

    # set vehicle's type, max force, max speed, speed
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "vehicle_type",
                                 "boid")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "max_force",
                                 "5.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "max_speed",
                                 "10.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "speed", "3.0")

    # set vehicle throwing events
    valueList.clear()
    valueList.add_value("avoid_obstacle@avoid_obstacle@")
    steerMgr.set_parameter_values(OSSteerManager.STEERVEHICLE, "thrown_events",
                                  valueList)
    #
    printCreationParameters()
Example #2
0
def setParametersBeforeCreation():
    """set parameters as strings before plug-ins/vehicles creation"""

    steerMgr = OSSteerManager.get_global_ptr()
    valueList = ValueList_string()
    # set plug-in type
    steerMgr.set_parameter_value(OSSteerManager.STEERPLUGIN, "plugin_type",
                                 "map_drive")

    # set vehicle's type, mass, speed
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "vehicle_type",
                                 "map_driver")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "max_speed",
                                 "20.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "max_force",
                                 "8.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "up_axis_fixed",
                                 "true")

    # set vehicle throwing events
    valueList.clear()
    valueList.add_value(
        "avoid_obstacle@[email protected]:path_following@[email protected]")
    steerMgr.set_parameter_values(OSSteerManager.STEERVEHICLE, "thrown_events",
                                  valueList)
    #
    printCreationParameters()
Example #3
0
def setParametersBeforeCreation():
    """set parameters as strings before plug-ins/vehicles creation"""

    steerMgr = OSSteerManager.get_global_ptr()
    valueList = ValueList_string()
    # set plug-in type
    steerMgr.set_parameter_value(OSSteerManager.STEERPLUGIN, "plugin_type",
                                 "soccer")

    # set vehicle throwing events
    valueList.clear()
    valueList.add_value("avoid_neighbor@avoid_neighbor@")
    steerMgr.set_parameter_values(OSSteerManager.STEERVEHICLE, "thrown_events",
                                  valueList)
    #
    printCreationParameters()
def setParametersBeforeCreation():
    """set parameters as strings before plug-ins/vehicles creation"""

    steerMgr = OSSteerManager.get_global_ptr()
    valueList = ValueList_string()
    # set plug-in type
    steerMgr.set_parameter_value(OSSteerManager.STEERPLUGIN, "plugin_type",
                                 "multiple_pursuit")

    # set vehicle's max force, max speed, up axis fixed
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "max_force",
                                 "1.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "max_speed",
                                 "2.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "up_axis_fixed",
                                 "true")
    #
    printCreationParameters()
def setParametersBeforeCreation():
    """set parameters as strings before plug-ins/vehicles creation"""
    
    steerMgr = OSSteerManager.get_global_ptr()
    valueList = ValueList_string()
    # set vehicle's mass, speed
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "external_update", 
            "false")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "mass",
            "2.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "speed",
            "0.01")

    # set vehicle throwing events
    valueList.clear()
    valueList.add_value("avoid_obstacle@[email protected]:"
            "avoid_close_neighbor@[email protected]:"
            "avoid_neighbor@[email protected]")
    steerMgr.set_parameter_values(OSSteerManager.STEERVEHICLE,
            "thrown_events", valueList)
    #
    printCreationParameters()
Example #6
0
def setParametersBeforeCreation():
    """set parameters as strings before plug-ins/vehicles creation"""

    steerMgr = OSSteerManager.get_global_ptr()
    valueList = ValueList_string()
    # set plug-in type
    steerMgr.set_parameter_value(OSSteerManager.STEERPLUGIN, "plugin_type",
                                 "low_speed_turn")

    # set vehicle type, mass, speed
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "vehicle_type",
                                 "low_speed_turn")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "mass", "2.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "speed", "0.01")

    # set vehicle throwing events
    valueList.clear()
    valueList.add_value("move@[email protected]")
    steerMgr.set_parameter_values(OSSteerManager.STEERVEHICLE, "thrown_events",
                                  valueList)
    #
    printCreationParameters()
Example #7
0
def setParametersBeforeCreation():
    """set parameters as strings before plug-ins/vehicles creation"""

    steerMgr = OSSteerManager.get_global_ptr()
    valueList = ValueList_string()
    # set plug-in type
    steerMgr.set_parameter_value(OSSteerManager.STEERPLUGIN, "plugin_type",
                                 "pedestrian")

    # set vehicle's type, mass, speed
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "vehicle_type",
                                 "pedestrian")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "mass", "2.0")
    steerMgr.set_parameter_value(OSSteerManager.STEERVEHICLE, "speed", "0.01")

    # set vehicle throwing events
    valueList.clear()
    valueList.add_value(
        "avoid_obstacle@[email protected]:avoid_close_neighbor@avoid_close_neighbor@"
    )
    steerMgr.set_parameter_values(OSSteerManager.STEERVEHICLE, "thrown_events",
                                  valueList)
    #
    printCreationParameters()
        "- press \"d\" to toggle debug drawing\n"
        "- press \"w\" to add 'wanderer' vehicle\n"
        "- press \"p\" to add 'pursuer' vehicle\n"
        "- press \"s\"/\"shift-s\" to increase/decrease last inserted vehicle's max speed\n"
        "- press \"f\"/\"shift-f\" to increase/decrease last inserted vehicle's max force\n"
    )
    textNodePath = app.aspect2d.attach_new_node(text)
    textNodePath.set_pos(-1.25, 0.0, -0.5)
    textNodePath.set_scale(0.035)

    # create a steer manager; set root and mask to manage 'kinematic' vehicles
    steerMgr = OSSteerManager(app.render, mask)

    # print creation parameters: defult values
    print("\n" + "Default creation parameters:")
    printCreationParameters()

    # load or restore all scene stuff: if passed an argument
    # try to read it from bam file
    if (not len(sys.argv) > 1) or (not readFromBamFile(sys.argv[1])):
        # no argument or no valid bamFile
        # reparent the reference node to render
        steerMgr.get_reference_node_path().reparent_to(app.render)

        # get a sceneNP, naming it with "SceneNP" to ease restoring from bam
        # file
        sceneNP = loadTerrain("SceneNP")
        # and reparent to the reference node
        sceneNP.reparent_to(steerMgr.get_reference_node_path())

        # set sceneNP's collide mask