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

德宏网站建设公司网页美工设计招聘

德宏网站建设公司,网页美工设计招聘,采购网站建设,电子商务网站建设与管理的重要性【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/14258650/

相关文章:

  • 超凡网络网站房产网站门户系统
  • 贷款网站建设方案wordpress如何手动安装主题
  • 湖州网站建站如何更换网站服务商
  • 做请柬的网站微信采集wordpress
  • 做网站被用作非法用途cpa没有网站怎么做
  • 在网站做电子画册无锡网站建设团队
  • 昆明乐网网站建设网站由哪些部分组成
  • 怎么一个网站做的竞价莱芜在线广告信息
  • 专业的营销型网站制作音乐网站 模板
  • 建设鲜花网站前的市场分析百度推广代理商返点
  • 电商网站 开发费用军人运动会官方网站建设目标
  • 网站的规划与建设课程设计公司网站 域名
  • 广州网站备案公司一站式做网站设计
  • 铜仁市网站建设wordpress数据库版本号
  • 广州网站建设电话大全wordpress添加小工具
  • 理县网站建设大学生做静态网站
  • win8风格企业网站苏州 网站的公司哪家好
  • 上海做网站的公司排名网页制作流程及详细步骤
  • 电商网站建设技术外包谷歌网页版入口在线
  • 网站安全建设情况报告昆明抖音代运营
  • 做网站的内容资源怎样才能建立网站
  • 好的手机端网站模板下载seo技术手段
  • 旅游网站开发网站设计报告书服务器租用多少钱一月
  • 国外网站备案吗用html制作登录注册界面
  • 大庆开发网站公司怎么建设淘宝联盟的网站
  • 移动网站建设推荐怎么申请免费企业邮箱账号
  • 乐山市住房和城乡规划建设局网站网站建设的ppt模板下载
  • 网站浏览器不兼容怎么办建设网站遇到的问题
  • 公司网站制作流程2016南宁建站热搜
  • 网站项目开发的一般流程企业进行网站建设的方式有( )