Example #1
0
                HardwareInterfaceResources(
                    hardware_interface='hardware_interface::FooInterface',
                    resources=['one', 'two', 'three'])
            ]),
        CtrlState(
            name='bar_controller',
            state='running',
            type='bar_base/bar',
            claimed_resources=[
                HardwareInterfaceResources(
                    hardware_interface='hardware_interface::BarInterface',
                    resources=['four'])
            ])
    ]

    resp = ListControllersResponse()
    resp.controller = ctrl_list
    cm_default.list_ctrl_resp = resp

    # Partial controller manager ROS API: missing service
    cm_incomplete = ControllerManagerDummy('/incomplete')
    cm_incomplete.reload_libs.shutdown()

    # Partial controller manager ROS API: service with wrong type
    cm_bad_type = ControllerManagerDummy('/bad_type')
    cm_bad_type.unload_ctrl.shutdown()
    cm_bad_type.unload_ctrl = rospy.Service(
        '/bad_type/unload_controller',
        LoadController,  # NOTE: Wrong type
        cm_bad_type._unload_ctrl_cb)
Example #2
0
              claimed_resources=[
                  HardwareInterfaceResources(
                      hardware_interface='hardware_interface::FooInterface',
                      resources=['one', 'two', 'three'])
              ]),
    CtrlState(name='bar_controller',
              state='running',
              type='bar_base/bar',
              claimed_resources=[
                  HardwareInterfaceResources(
                      hardware_interface='hardware_interface::BarInterface',
                      resources=['four'])
              ])
    ]

    resp = ListControllersResponse()
    resp.controller = ctrl_list
    cm_default.list_ctrl_resp = resp

    # Partial controller manager ROS API: missing service
    cm_incomplete = ControllerManagerDummy('/incomplete')
    cm_incomplete.reload_libs.shutdown()

    # Partial controller manager ROS API: service with wrong type
    cm_bad_type = ControllerManagerDummy('/bad_type')
    cm_bad_type.unload_ctrl.shutdown()
    cm_bad_type.unload_ctrl = rospy.Service('/bad_type/unload_controller',
                                            LoadController,  # NOTE: Wrong type
                                            cm_bad_type._unload_ctrl_cb)

    rospy.spin()
Example #3
0
    cm_foo2 = ControllerManagerDummy('/foo/robot/controller_manager2')
    cm_default = ControllerManagerDummy()

    c_foo = ControllerState()
    c_foo.name = 'foo_controller'
    c_foo.type = 'foo_base/foo'
    c_foo.state = 'running'
    c_foo.hardware_interface='hardware_interface::FooInterface'

    c_bar = ControllerState()
    c_bar.name = 'bar_controller'
    c_bar.type = 'bar_base/bar'
    c_bar.state = 'stopped'
    c_bar.hardware_interface='hardware_interface::BarInterface'

    resp = ListControllersResponse()
    resp.controller = [c_foo, c_bar]
    cm_default.list_ctrl_resp = resp

    # Partial controller manager ROS API: missing service
    cm_incomplete = ControllerManagerDummy('/incomplete')
    cm_incomplete.reload_libs.shutdown()

    # Partial controller manager ROS API: service with wrong type
    cm_bad_type = ControllerManagerDummy('/bad_type')
    cm_bad_type.unload_ctrl.shutdown()
    cm_bad_type.unload_ctrl = rospy.Service('/bad_type/unload_controller',
                                            LoadController,  # NOTE: Wrong type
                                            cm_bad_type._unload_ctrl_cb)

    rospy.spin()