Exemplo n.º 1
0
def main():
    print('Starting Non-model-based Sliding Mode Controller')
    rclpy.init()

    try:
        sim_time_param = is_sim_time()

        tf_world_ned_to_enu = get_world_ned_to_enu(sim_time_param)

        node = ROV_NMB_SMController('rov_nmb_sm_controller',
                                    world_ned_to_enu=tf_world_ned_to_enu,
                                    parameter_overrides=[sim_time_param])
        executor = rclpy.executors.MultiThreadedExecutor()
        executor.add_node(node)
        executor.spin()
        # rclpy.spin(node)
    except KeyboardInterrupt:
        pass
    except Exception as e:
        print('Caught exception: ' + repr(e))
        traceback.print_exc()
    finally:
        if rclpy.ok():
            rclpy.shutdown()

    print('Exiting')
Exemplo n.º 2
0
def main():
    rclpy.init()

    try:
        sim_time_param = is_sim_time()

        tf_world_ned_to_enu = get_world_ned_to_enu(sim_time_param)

        node = ROV_NLPIDController('rov_nl_pid_controller',
                                   world_ned_to_enu=tf_world_ned_to_enu,
                                   parameter_overrides=[sim_time_param])
        rclpy.spin(node)
    except Exception as e:
        print('Caught exception: ' + repr(e))
        traceback.print_exc()
    finally:
        if rclpy.ok():
            rclpy.shutdown()
    print('exiting')
Exemplo n.º 3
0
def main():
    print('Starting Model-based Sliding Mode Controller')
    rclpy.init()

    try:
        sim_time_param = is_sim_time()

        tf_world_ned_to_enu = get_world_ned_to_enu(sim_time_param)

        node = ROV_MB_SMController('rov_mb_sm_controller',
                                   parameter_overrides=[sim_time_param],
                                   world_ned_to_enu=tf_world_ned_to_enu)
        rclpy.spin(node)
    except Exception as e:
        print('Caught exception: ' + repr(e))
        traceback.print_exc()
    finally:
        if rclpy.ok():
            rclpy.shutdown()
    print('Exiting')
Exemplo n.º 4
0
def main():
    print('Starting PD controller with compensation of restoring forces')
    rclpy.init()

    try:
        sim_time_param = is_sim_time()

        tf_world_ned_to_enu = get_world_ned_to_enu(sim_time_param)

        node = ROV_PD_GComp_Controller('rov_pd_grav_compensation_controller',
                                       world_ned_to_enu=tf_world_ned_to_enu,
                                       parameter_overrides=[sim_time_param])

        rclpy.spin(node)
    except Exception as e:
        print('Caught exception: ' + repr(e))
        traceback.print_exc()
    finally:
        if rclpy.ok():
            rclpy.shutdown()
    print('Exiting')
def main():
    print('Starting AUV trajectory tracker')
    rclpy.init()

    try:
        sim_time_param = is_sim_time()

        tf_world_ned_to_enu = get_world_ned_to_enu(sim_time_param)

        node = AUVGeometricTrackingController(
            'auv_geometric_tracking_controller',
            world_ned_to_enu=tf_world_ned_to_enu,
            parameter_overrides=[sim_time_param])
        rclpy.spin(node)

    except Exception as e:
        print('caught exception: ' + repr(e))
        traceback.print_exc()
    finally:
        if rclpy.ok():
            rclpy.shutdown()
Exemplo n.º 6
0
def main():
    print('Starting Modelbased Feedback Linearization Controller')
    rclpy.init()

    try:
        sim_time_param = is_sim_time()

        tf_world_ned_to_enu = get_world_ned_to_enu(sim_time_param)

        node = ROV_MBFLController('rov_mb_fl_controller',
                                  world_ned_to_enu=tf_world_ned_to_enu,
                                  parameter_overrides=[sim_time_param])
        rclpy.spin(node)
    except rclpy.exceptions.ROSInterruptException as excep:
        print('Caught ROSInterruptException exception: ' + str(excep))
    except Exception as e:
        print('Caught exception: ' + repr(e))
        traceback.print_exc()
    finally:
        if rclpy.ok():
            rclpy.shutdown()
    print('Exiting')
                        + np.dot(self._Ki, self._int)
        self._tau = np.array(
            [ua_tau[0], ua_tau[1], ua_tau[2], 0, 0, ua_tau[3]])
        self.publish_control_wrench(self._tau)
        return True


# =============================================================================
if __name__ == '__main__':
    print('Starting Underactuated PID Controller')
    rclpy.init()

    try:
        sim_time_param = is_sim_time()

        tf_world_ned_to_enu = get_world_ned_to_enu(sim_time_param)

        node = ROVUnderActuatedPIDController(
            'rov_ua_pid_controller',
            world_ned_to_enu=tf_world_ned_to_enu,
            parameter_overrides=[sim_time_param])

        rclpy.spin(node)
    except Exception as e:
        print('Caught exception: ' + repr(e))
        traceback.print_exc()
    finally:
        if rclpy.ok():
            rclpy.shutdown()
    print('Exiting')