当前位置: 首页 > news >正文

青海做网站找谁源代码怎么做网站

青海做网站找谁,源代码怎么做网站,15个网页设计的案例,搭建什么网站能盈利【VS2022 配置 ACADOS求解 NLP问题】 1. 前言1.1 来回扁椭圆1.2 椭圆轨迹1.3 月牙形轨迹 2. Cmake配置3. 下载acados的源码4. 组合编译Acados5. 测试ACADOS5.1 配置getting_started.c5.2 启动getting_started.c5.3 附加依赖项 6 总结 1. 前言 最近在研究 船舶NMPC 控制时… 【VS2022 配置 ACADOS求解 NLP问题】 1. 前言1.1 来回扁椭圆1.2 椭圆轨迹1.3 月牙形轨迹 2. Cmake配置3. 下载acados的源码4. 组合编译Acados5. 测试ACADOS5.1 配置getting_started.c5.2 启动getting_started.c5.3 附加依赖项 6 总结 1. 前言 最近在研究 船舶NMPC 控制时主要是非线性约束的凸二次优化问题属于NLP问题找到了 casadi 这个求解库后面读了许多论文发现Acados求解速度比Casadi还要快许多所以就来试试呗但是团队现在软件是基于Visual Studio From架构设计的测试软件之后再系统的移植过去。 https://github.com/acados/acados https://docs.acados.org/ 仔细阅读安装教程发现支持msvc只是需要安装Cmake配置环境 开发工具Visual Studio 2022.NET Framework 4.7.2环境搭建参考博客【VS2019安装QT配置】配置工具Cmake 4.0.2 给大家看看PID控制小船跑的几种常见轨迹后续会更新其他控制效果 源码地址 1.1 来回扁椭圆 1.2 椭圆轨迹 1.3 月牙形轨迹 2. Cmake配置 只是需要安装Cmake配置环境 https://cmake.org/download/ 一路直接安装注意需要勾选自动配置环境变量 3. 下载acados的源码 在 acados的 github 官方仓库中找到适合的版本下载对应的 Source Code 压缩包即可 或者git git clone https://github.com/acados/acados.git cd acados git submodule update --recursive --init4. 组合编译Acados 使用 Microsoft Visual C 编译器 MSVC 的工作流 注意此工作流程是初步的未经全面测试。 于 2025 年 6 月使用 MSVC 2022 测试一次 然后在 Acados 的目录下新建一个 build下使用 、导航到acados_root_folder/build并运行Developer Command Prompt for VS cmake -G Visual Studio 17 2022 -DBLASFEO_TARGETGENERIC -DACADOS_INSTALL_DIR.. -DBUILD_SHARED_LIBSOFF .. # respectively for MVSC 2019 # cmake -G Visual Studio 16 2019 -DBLASFEO_TARGETGENERIC -DACADOS_INSTALL_DIR.. -DBUILD_SHARED_LIBSOFF .. cmake --build . -j10 --target INSTALL --config Release cmake --install build后面demo只支持Release x64版本进行二次封装可以解除版本限制就可以支持Debug x64版本 如果编译报错 D:\code\Cplusplus\acados\buildcmake -G Visual Studio 17 2022 -DBLASFEO_TARGETGENERIC -DACADOS_INSTALL_DIR.. -DBUILD_SHARED_LIBSOFF .. CMake Deprecation Warning at CMakeLists.txt:32 (cmake_minimum_required):Compatibility with CMake 3.10 will be removed from a future version ofCMake.Update the VERSION argument min value. Or, use the min...max syntaxto tell CMake that the project requires at least min but has been updatedto work with policies introduced by max or earlier.-- The C compiler identification is MSVC 19.40.33812.0 -- The CXX compiler identification is MSVC 19.40.33812.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: E:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: E:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Build type is Release -- ACADOS_WITH_OPENMP: OFF CMake Error at external/blasfeo/CMakeLists.txt:36 (cmake_minimum_required):Compatibility with CMake 3.5 has been removed from CMake.Update the VERSION argument min value. Or, use the min...max syntaxto tell CMake that the project requires at least min but has been updatedto work with policies introduced by max or earlier.Or, add -DCMAKE_POLICY_VERSION_MINIMUM3.5 to try configuring anyway.-- Configuring incomplete, errors occurred!解决方法 根据cmake的提示 CMakeLists.txt 中 cmake_minimum_required (VERSION 2.8.12)的版本要求太低了可能无法兼容将最小版本要求更新或者添加一个区间即可。 修改报错文件中的版本声明后解决 //修改前 cmake_minimum_required (VERSION 2.8.12)//查看系统cmake版本, cmake --version cmake version 4.0.2//修改后 cmake_minimum_required (VERSION 3.8.0) 或者 cmake_minimum_required (VERSION 2.8.12...4.0.2)之后双击运行等待其编译结束中间会出现许多警告 编译成功后会生成Visual studio的项目文件 5. 测试ACADOS 打开上面编译好的项目文件acados.sln 这里面有许多测试demo大家有兴趣自行测试 5.1 配置getting_started.c 我们将getting_started项目右键设置为启动项目 /************************************************************************************************** * * * This file is part of BLASFEO. * * * * BLASFEO -- BLAS For Embedded Optimization. * * Copyright (C) 2019 by Gianluca Frison. * * Developed at IMTEK (University of Freiburg) under the supervision of Moritz Diehl. * * All rights reserved. * * * * The 2-Clause BSD License * * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice, this * * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * * this list of conditions and the following disclaimer in the documentation * * and/or other materials provided with the distribution. * * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND * * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * * Author: Gianluca Frison, gianluca.frison (at) imtek.uni-freiburg.de * * * **************************************************************************************************/#include stdlib.h #include stdio.h#include blasfeo.hint main(){printf( Testing processor\n );char supportString[50];blasfeo_processor_library_string( supportString );printf( Library requires processor features:%s\n, supportString );int features 0;int procCheckSucceed blasfeo_processor_cpu_features( features );blasfeo_processor_feature_string( features, supportString );printf( Processor supports features:%s\n, supportString );if( !procCheckSucceed ){printf(Current processor does not support the current compiled BLASFEO library.\n);printf(Please get a BLASFEO library compatible with this processor.\n);exit(3);}int ii; // loop indexint n 12; // matrix size// Astruct blasfeo_dmat sA; // matrix structureblasfeo_allocate_dmat(n, n, sA); // allocate and assign memory needed by A// Bstruct blasfeo_dmat sB; // matrix structureint B_size blasfeo_memsize_dmat(n, n); // size of memory needed by Bvoid *B_mem_align;v_zeros_align(B_mem_align, B_size); // allocate memory needed by Bblasfeo_create_dmat(n, n, sB, B_mem_align); // assign aligned memory to struct// Cstruct blasfeo_dmat sC; // matrix structureint C_size blasfeo_memsize_dmat(n, n); // size of memory needed by CC_size 64; // 64-bytes alignmentvoid *C_mem malloc(C_size);//void *C_mem_align (void *) ((((unsigned long long) C_mem)63)/64*64); // align memory pointervoid *C_mem_align;blasfeo_align_64_byte(C_mem, C_mem_align); // align memory pointerblasfeo_create_dmat(n, n, sC, C_mem_align); // assign aligned memory to struct// Adouble *A malloc(n*n*sizeof(double));for(ii0; iin*n; ii)A[ii] ii;int lda n;blasfeo_pack_dmat(n, n, A, lda, sA, 0, 0); // convert from column-major to BLASFEO dmatfree(A);// Bblasfeo_dgese(n, n, 0.0, sB, 0, 0); // set B to zerofor(ii0; iin; ii)BLASFEO_DMATEL(sB, ii, ii) 1.0; // set B diagonal to 1.0 accessing dmat elements// Cblasfeo_dgese(n, n, -1.0, sC, 0, 0); // set C to -1.0blasfeo_dgemm_nt(n, n, n, 1.0, sA, 0, 0, sB, 0, 0, 0.0, sC, 0, 0, sC, 0, 0);printf(\nC \n);blasfeo_print_dmat(n, n, sC, 0, 0);blasfeo_free_dmat(sA);v_free_align(B_mem_align);free(C_mem);return 0;} 5.2 启动getting_started.c 点击调试运行getting_started.cdemo 会输出如下内容 Testing processor Library requires processor features: Processor supports features:C 0.00000 12.00000 24.00000 36.00000 48.00000 60.00000 72.00000 84.00000 96.00000 108.00000 120.00000 132.000001.00000 13.00000 25.00000 37.00000 49.00000 61.00000 73.00000 85.00000 97.00000 109.00000 121.00000 133.000002.00000 14.00000 26.00000 38.00000 50.00000 62.00000 74.00000 86.00000 98.00000 110.00000 122.00000 134.000003.00000 15.00000 27.00000 39.00000 51.00000 63.00000 75.00000 87.00000 99.00000 111.00000 123.00000 135.000004.00000 16.00000 28.00000 40.00000 52.00000 64.00000 76.00000 88.00000 100.00000 112.00000 124.00000 136.000005.00000 17.00000 29.00000 41.00000 53.00000 65.00000 77.00000 89.00000 101.00000 113.00000 125.00000 137.000006.00000 18.00000 30.00000 42.00000 54.00000 66.00000 78.00000 90.00000 102.00000 114.00000 126.00000 138.000007.00000 19.00000 31.00000 43.00000 55.00000 67.00000 79.00000 91.00000 103.00000 115.00000 127.00000 139.000008.00000 20.00000 32.00000 44.00000 56.00000 68.00000 80.00000 92.00000 104.00000 116.00000 128.00000 140.000009.00000 21.00000 33.00000 45.00000 57.00000 69.00000 81.00000 93.00000 105.00000 117.00000 129.00000 141.0000010.00000 22.00000 34.00000 46.00000 58.00000 70.00000 82.00000 94.00000 106.00000 118.00000 130.00000 142.0000011.00000 23.00000 35.00000 47.00000 59.00000 71.00000 83.00000 95.00000 107.00000 119.00000 131.00000 143.00000D:\code\Cplusplus\acados\build\external\blasfeo\examples\Debug\getting_started.exe (进程 20572)已退出代码为 0。 要在调试停止时自动关闭控制台请启用“工具”-“选项”-“调试”-“调试停止时自动关闭控制台”。 按任意键关闭此窗口. . .到此为止我们就完成VS2022 配置 ACADOS环境了 5.3 附加依赖项 如果你想生成静态库进行二次调用需要将INSTALL设置为启动项目 系统就会生成acados静态库方便你二次调用 6 总结 恭喜你学习了VS2022 配置 ACADOS环境从而实现对外部世界进行感知充分认识这个有机与无机的环境科学地合理地进行创作和发挥效益然后为人类社会发展贡献一点微薄之力。 我会持续更新对应专栏博客非常期待你的三连如果鹏鹏有哪里说的不妥还请大佬多多评论指教下面有我的群推广欢迎志同道合的朋友们加入期待与你的思维碰撞 参考文献VS2022 配置 ACADOS环境
http://www.hkea.cn/news/14458116/

相关文章:

  • 新乡网站建设方案个人网站备案名和运营
  • 网站建设优化服务市场遵义市网站建设
  • 网站的特效代码广州外贸推广
  • 网站js文件夹网站建设模板哪里下载
  • 秦皇岛pc端网站建设百度关键词关键词大全
  • 建网站的公司价格中建八局一公司总部
  • 网站集约化建设工作汇报四川外国语大学网站建设系
  • 阿里服务器怎么做网站服务器吗抖音代运营工作内容
  • 教育网站的建设男女在床上做羞羞的事的网站
  • 淘宝客网站建设任务舆情系统是什么
  • 天津小程序网站开发公司西安专业做网站建设费用
  • 做企业网站的字体大小要求免费服务器领取
  • 汕头企业做网站沈阳的网站建设
  • 星沙网站建设中国建筑装饰网网址
  • 电子商务网站建设是学什么云浮市住房城乡建设信息网网站
  • 网站的建设分析及意义谷歌seo搜索引擎下载
  • 网站开发是前端还是后台js建设网站
  • 网站长春网站建设网站搜索不出来
  • 公司注销 网站备案申请表电子商务网站怎么建设
  • 微网站建设及微信推广方案ppt模板杭州市建设网站
  • 建设网站需要客户提供什么资料小程序商城哪家好经销商
  • 做服装商城网站wordpress固定链接域名
  • 怎么做百度网站会显示图片在旁边北京商务网站建设
  • 建设部网站取消园林资质如何破解wordpress数据库
  • 宝安多屏网站建设公司好吗公司网站文化活动备案
  • 安阳做网站优化大连网站开发平台
  • 深圳在线制作网站芜湖灵创网站建设
  • 网站引导页下载泉州英文网站建设
  • 网站和微网站机器人软件开发平台
  • 微擎做网站费用怎么做网页游戏的托