Exemplo n.º 1
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """
    global_ns.exclude()
    classes = []

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    # EventPlayer
    EventPlayer = local_ns.class_('EventPlayer')
    EventPlayer.include()
    classes.append(EventPlayer)

    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Do class wide items
    wrap.add_needed_includes(classes)

    # Add registrations functions for hand wrapped classes
    module_builder.add_registration_code("registerLoggingPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/logging/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 2
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that corresponds to the given namespace
    global_ns: is the module builder for the entire library
    """

    local_ns.exclude()
    classes = []

    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    # NetworkPublisher
    NetworkPublisher = local_ns.class_('NetworkPublisher')
    NetworkPublisher.include()
    classes.append(NetworkPublisher)

    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    wrap.registerSubsystemConverter(NetworkPublisher)

    wrap.add_needed_includes(classes)

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/network/include/RegisterFunctions.h'
            ] + list(include_files)
Exemplo n.º 3
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that coresponds to the given namespace
    global_ns: is the module builder for the entire library
    """
    global_ns.exclude()
    classes = []

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    # EventPlayer
    EventPlayer = local_ns.class_('EventPlayer')
    EventPlayer.include()
    classes.append(EventPlayer)

    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Do class wide items
    wrap.add_needed_includes(classes)

    # Add registrations functions for hand wrapped classes
    module_builder.add_registration_code("registerLoggingPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/logging/include/RegisterFunctions.h'
            ] + list(include_files)
Exemplo n.º 4
0
def generate(module_builder, local_ns, global_ns):
    """
    local_ns: is the namespace that corresponds to the given namespace
    global_ns: is the module builder for the entire library
    """

    local_ns.exclude()
    classes = []

    module_builder.class_('::ram::core::Subsystem').already_exposed = True

    # NetworkPublisher
    NetworkPublisher = local_ns.class_('NetworkPublisher')
    NetworkPublisher.include()
    classes.append(NetworkPublisher)

    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    wrap.registerSubsystemConverter(NetworkPublisher)

    wrap.add_needed_includes(classes)

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/network/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 5
0
def generate(module_builder, local_ns, global_ns):
    classes = []

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True
    module_builder.class_('::ram::math::Vector3').already_exposed = True
    Quaternion = module_builder.class_('::ram::math::Quaternion')
    Quaternion.already_exposed = True
    Quaternion.constructors().allow_implicit_conversion = False

    # Include controller classes
    IController = local_ns.class_('IController')
    IController.include()

    IController.include_files.append(os.environ['RAM_SVN_DIR'] +
                                     '/packages/control/include/IController.h')
    classes.append(IController)

    # Include desired state class
    DesiredState = global_ns.class_('DesiredState')
    DesiredState.include()
    DesiredState.include_files.append(
        os.environ['RAM_SVN_DIR'] + '/packages/control/include/DesiredState.h')
    classes.append(DesiredState)

    yawVehicleHelper = local_ns.free_function('yawVehicleHelper')
    pitchVehicleHelper = local_ns.free_function('pitchVehicleHelper')
    rollVehicleHelper = local_ns.free_function('rollVehicleHelper')
    holdCurrentHeadingHelper = local_ns.free_function(
        'holdCurrentHeadingHelper')

    yawVehicleHelper.include()
    pitchVehicleHelper.include()
    rollVehicleHelper.include()
    holdCurrentHeadingHelper.include()

    # Wrap Events
    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Add a castTo
    wrap.registerSubsystemConverter(IController)

    wrap.add_needed_includes(classes)
    module_builder.add_registration_code("registerIControllerPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    include_files.add('packages/control/include/Helpers.h')
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/control/include/RegisterFunctions.h'
            ] + list(include_files)
Exemplo n.º 6
0
def generate(module_builder, local_ns, global_ns):
    classes = []

    # Mark class from other modules as already exposed
    module_builder.class_('::ram::core::Subsystem').already_exposed = True
    module_builder.class_('::ram::math::Vector3').already_exposed = True
    Quaternion = module_builder.class_('::ram::math::Quaternion')
    Quaternion.already_exposed = True
    Quaternion.constructors().allow_implicit_conversion = False

    # Include controller classes
    IController = local_ns.class_('IController')
    IController.include()
    
    IController.include_files.append(os.environ['RAM_SVN_DIR'] +
                                     '/packages/control/include/IController.h')
    classes.append(IController)

    # Include desired state class
    DesiredState = global_ns.class_('DesiredState')
    DesiredState.include()
    DesiredState.include_files.append(os.environ['RAM_SVN_DIR'] +
                                     '/packages/control/include/DesiredState.h')
    classes.append(DesiredState)

    yawVehicleHelper = local_ns.free_function('yawVehicleHelper')
    pitchVehicleHelper = local_ns.free_function('pitchVehicleHelper')
    rollVehicleHelper = local_ns.free_function('rollVehicleHelper')
    holdCurrentHeadingHelper = local_ns.free_function('holdCurrentHeadingHelper')

    yawVehicleHelper.include()
    pitchVehicleHelper.include()
    rollVehicleHelper.include()
    holdCurrentHeadingHelper.include()

    # Wrap Events
    events = wrap.expose_events(local_ns)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Add a castTo
    wrap.registerSubsystemConverter(IController)

    wrap.add_needed_includes(classes)
#    wrap.make_already_exposed(global_ns, 'ram::pattern', 'Subject')
    module_builder.add_registration_code("registerIControllerPtrs();")

    include_files = set([cls.location.file_name for cls in classes])
    include_files.add('packages/control/include/Helpers.h')
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/control/include/RegisterFunctions.h'] + list(include_files)
Exemplo n.º 7
0
def generate(module_builder, local_ns, global_ns):
    """
    global_ns: is the module builder for the entire library
    local_ns: is the namespace that coresponds to the given namespace
    """
    global_ns.exclude()
    classes = []

    # Lets Py++ know to make VisionSystem a subclass of Subsystem
    module_builder.class_('::ram::core::Subsystem').already_exposed = True
    module_builder.class_('::ram::core::Event').already_exposed = True

    # Vision System
    VisionSystem = local_ns.class_('VisionSystem')
    VisionSystem.include()
    VisionSystem.include_files.append('vision/include/Camera.h')
    classes.append(VisionSystem)   

    # Wrap Events
    EventType = local_ns.class_('EventType')
    EventType.include()
    classes.append(EventType)

    Symbol = local_ns.class_('Symbol')
    Symbol.include()
    Symbol.member_function('getSymbolNames').exclude()
    Symbol.member_function('symbolToText').exclude()
    classes.append(Symbol)

    Color = local_ns.class_('Color')
    Color.include()
    Color.member_function('getColorNames').exclude()
    Color.member_function('colorToText').exclude()
    classes.append(Color)
    
    events = wrap.expose_events(local_ns)
    classes += events

    ImageEvent = local_ns.class_('ImageEvent')
    ImageEvent.include_files.append('vision/include/Image.h')
    wrap.set_implicit_conversions([ImageEvent], False)

    BinEvent = local_ns.class_('BinEvent')
    wrap.set_implicit_conversions([BinEvent], False)

    if events:
        wrap.make_already_exposed(global_ns, 'ram::core', ['Event'])
        classes += events

    # Append the approaite include files
#    for cls in classes:
#        cls.include()
    wrap.add_needed_includes(classes)

    module_builder.add_registration_code("registerImageClass();")
    module_builder.add_registration_code("registerCameraClass();")

    include_files = set([cls.location.file_name for cls in classes])
    for cls in classes:
        include_files.update(cls.include_files)
    return ['wrappers/vision/include/RegisterFunctions.h'] + list(include_files)