• aaasdsdd
    了解作者
  • Java
    开发工具
  • 442KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 11
    下载次数
  • 2020-06-15 09:37
    上传日期
车辆模型预测控制方式 其中一种基于几何模型的控制方法
stanley.rar
内容介绍
classdef HelperPathAnalyzer < matlab.System & matlab.system.mixin.Propagates & ... matlab.system.mixin.SampleTime & matlab.system.mixin.CustomIcon %HelperPathAnalyzer Provide reference inputs for vehicle controllers. % HelperPathAnalyzer computes the reference pose and the reference % velocity based on the current pose of the vehicle. % % pathAnalyzer = HelperPathAnalyzer creates a system object, % pathAnalyzer, that calculate reference inputs for vehicle controllers. % % pathAnalyzer = HelperPathAnalyzer(Name,Value) creates a system object, % pathAnalyzer, with additional options specified by one or more % Name,Value pair arguments: % % 'Wheelbase' Wheelbase of the vehicle % % Default: 2.8 (meters) % % 'RefPoses' A N-by-3 matrix representing the poses of the % reference path % % 'Directions' A N-by-1 vector representing the driving % directions at each point on the reference path. % The vector is composed by possible values: 1 % for forward motion and -1 for reverse motion. % % 'Curvatures' A N-by-1 vector representing the curvature % of the reference path % % 'SpeedProfile' A N-by-1 vector representing the speeds along % the reference path (in meters/second) % % % Step method syntax: % [refPose, refVel, direction] = step(pathAnalyzer, currPose, currVel) % returns the reference pose, refPose, reference velocity, refVel, and % the driving direction based on the current pose, currPose and the % current velocity, currVel of the vehicle. % % System objects may be called directly like a function instead of using % the step method. For example, y = step(obj) and y = obj() are equivalent. % % HelperPathAnalyzer properties: % Wheelbase - Wheelbase of the vehicle % RefPoses - Poses of the reference path % SpeedProfile - Speeds along the reference path % Directions - Driving directions at each point on the path % Curvatures - Path curvaturesa at each point on the path % % HelperPathAnalyzer methods: % step - Compute reference poses, velocity and direction % release - Allow property value changes % clone - Create a copy of the object % isLocked - Locked status (logical) % % See also lateralControllerStanley, HelperLongitudinalController, % smoothPathSpline, HelperSpeedProfileGenerator % Copyright 2018 The MathWorks, Inc. % Public, non-tunable properties properties(Nontunable) %Wheelbase Vehicle wheelbase (m) % A scalar specifying the distance between the front and the rear % axles. % % Default: 2.8 (m) Wheelbase = 2.8 end % Public properties (Only used in MATLAB) properties %RefPoses Vehicle poses along the reference path % RefPoses %SpeedProfile Speed profile along the reference path % SpeedProfile %Directions Driving directions corresponding to RefPoses % Directions %Curvatures Path curvatures % Curvatures end % Public properties (Only used in Simulink) properties(Nontunable, Logical) %HasResetOutput Show Reset output port % Flag indicating if the Reset output port is enabled. % % Default: false HasResetOutput = false; end properties(Access = private) %ClosestPointIndex Store the previous projection point index % to handle encircled path % % Default: 1 ClosestPointIndex = 1 %NumPathSegments Number of segments in a path. When % % Default: 1 NumPathSegments = 1 %CurrentSegmentIndex Index of the current segment % CurrentSegmentIndex = 1 %SegmentStartIndex A vector storing the indices of the starting % points of all the path segments % SegmentStartIndex %SegmentStartIndex A vector storing the indices of the ending % points of all the path segments SegmentEndIndex % The following four properties are used to transfer reference % data within the system object. Depending on the environment the % object is executing in, they are assigned either by public % properties, RefPoses, SpeedProfile, Directions and Curvatures % in MATLAB, or by the input ports in Simulink. The selection is % determined by the HasReferenceInports property. %RefPosesInternal RefPosesInternal %DirectionsInternal DirectionsInternal %CurvaturesInternal CurvaturesInternal %SpeedProfileInternal SpeedProfileInternal % The following four properties are used to store the last output. %LastRefPoseOutput LastRefPoseOutput = [0 0 0] %LastRefVelocityOutput LastRefVelocityOutput = 0 %LastCurvatureOutput LastCurvatureOutput = 0 %LastDirectionOutput LastDirectionOutput = 1 end properties(Access = private, Nontunable, Logical) %HasReferenceInports Flag indicating if there are refPose, directions % and speedProfile inputs in stepImp. In MATLAB, all these % values are set via properties while in Simulink they are % passed as inputs via input ports. % % Default: false HasReferenceInports = false end %---------------------------------------------------------------------- % Setter and constructor %---------------------------------------------------------------------- methods %------------------------------------------------------------------ function set.RefPoses(obj, refPoses) validateattributes(refPoses, {'single', 'double'}, ... {'nonnan', 'real', 'ncols', 3, 'finite', 'nonempty'}, ... mfilename, 'RefPoses'); obj.RefPoses = refPoses; end %------------------------------------------------------------------ function set.Directions(obj, directions) validateattributes(directions, {'single', 'double'}, ... {'nonnan', 'real', 'column', 'finite', 'nonempty'}, ... mfilename, 'Directions'); obj.Directions = directions; end %------------------------------------------------------------------ function set.Curvatures(obj, kappas) validateattributes(kappas, {'single', 'double'}, ... {'nonnan', 'real', 'column', 'finite', 'nonempty'}, ... mfilename, 'SpeedProfile'); obj.Curvatures = kappas; end %------------------------------------------------------------------ function set.SpeedProfile(obj, speedProfile) validateattributes(speedProfile, {'single', 'double'}, ... {'nonnan', 'real', 'column', 'finite', '>=', 0, 'nonempty'}, ... mfilename, 'SpeedProfile'); obj.SpeedProfile = speedProfile; end %------------------------------------------------------------------ function set.Wheelbase(obj, wheelbase) validateattributes(wheelbase, {'single', 'double'}, ... {'nonnan', 'real', 'scalar', 'finite', 'nonempty
评论
    相关推荐
    • 3G手机编程与游戏开发
      有关3G手机编程的开发文档,里面比较详细得写了开发过程。
    • ZxingDemo.rar
      android上使用ZXing识别条形码和二维码,代码简单易懂,相信能帮助读者迅速掌握相关的开发
    • android-order-system.rar
      基于Java的android点餐系统--android手机点餐系统,实现基本点菜功能,供大家参考学习
    • MTK-MT6235-USB-driver-2009082823351054.rar
      MTK 6235 USB driver for Nokia N97
    • Mine.zip
      Android 扫雷游戏源代码,代码中附加了详细的注释,另附加Ophone游戏开发文档,有详细搭建开发环境过程,与开发Android类似
    • J2ME_(chinese)api.rar
      J2ME 中文api以及应用 J2ME 中文api以及应用
    • Gallery3D.rar
      安卓系统原生的3D图片浏览器源代码,有兴趣的可以研究一下
    • wpctsc.rar
      wpctsc.exe for windows mobile 可以使WM手机远程登入PC
    • Animation-J2ME.rar
      手机游戏中的动画和CG是怎么做的呢,这个源代码中给了清晰的讲解,此代码是手机游戏巨头智乐(gameloft)公司所使用的引擎,很值得学习
    • androidexample.rar
      androidexample有130多个实例,是现在国内最全的ANDROID实例代码库,希望对大家有用