配置acados时出现“Segmentation fault,Exception: Rendering of main.in.c failed!”报错

问题描述

在安装acados后运行测试节点时出现错误:

 liangjunming @ XX ~/program/acados/examples/acados_python/getting_started on git:master o [11:49:11] C:1
$ python3.8 minimal_example_ocp.py

WARNING: Gauss-Newton Hessian approximation with EXTERNAL cost type not possible!
got cost_type_0: EXTERNAL, hessian_approx: 'GAUSS_NEWTON.'
GAUSS_NEWTON hessian is only supported for cost_types [NON]LINEAR_LS.
If you continue, acados will proceed computing the exact hessian for the cost term.
Note: There is also the option to use the external cost module with a numerical hessian approximation (see `ext_cost_num_hess`).
OR the option to provide a symbolic custom hessian approximation (see `cost_expr_ext_cost_custom_hess`).


WARNING: Gauss-Newton Hessian approximation with EXTERNAL cost type not possible!
got cost_type: EXTERNAL, hessian_approx: 'GAUSS_NEWTON.'
GAUSS_NEWTON hessian is only supported for cost_types [NON]LINEAR_LS.
If you continue, acados will proceed computing the exact hessian for the cost term.
Note: There is also the option to use the external cost module with a numerical hessian approximation (see `ext_cost_num_hess`).
OR the option to provide a symbolic custom hessian approximation (see `cost_expr_ext_cost_custom_hess`).


WARNING: Gauss-Newton Hessian approximation with EXTERNAL cost type not possible!
got cost_type_e: EXTERNAL, hessian_approx: 'GAUSS_NEWTON.'
GAUSS_NEWTON hessian is only supported for cost_types [NON]LINEAR_LS.
If you continue, acados will proceed computing the exact hessian for the cost term.
Note: There is also the option to use the external cost module with a numerical hessian approximation (see `ext_cost_num_hess`).
OR the option to provide a symbolic custom hessian approximation (see `cost_expr_ext_cost_custom_hess`).

Segmentation fault
Traceback (most recent call last):
  File "minimal_example_ocp.py", line 107, in <module>
    main()
  File "minimal_example_ocp.py", line 86, in main
    ocp_solver = AcadosOcpSolver(ocp, json_file = 'acados_ocp.json')
  File "/home/liangjunming/program/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 937, in __init__
    self.generate(acados_ocp, json_file=json_file, simulink_opts=simulink_opts, cmake_builder=cmake_builder)
  File "/home/liangjunming/program/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 856, in generate
    ocp_render_templates(acados_ocp, json_file, cmake_builder=cmake_builder, simulink_opts=simulink_opts)
  File "/home/liangjunming/program/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 743, in ocp_render_templates
    render_template(tup[0], tup[1], output_dir, json_path)
  File "/home/liangjunming/program/acados/interfaces/acados_template/acados_template/utils.py", line 241, in render_template
    raise Exception(f'Rendering of {in_file} failed!\n\nAttempted to execute OS command:\n{os_cmd}\n\n')
Exception: Rendering of main.in.c failed!

Attempted to execute OS command:
/home/liangjunming/program/acados/bin/t_renderer '/home/liangjunming/program/acados/interfaces/acados_template/acados_template/c_templates_tera/**/*' 'main.in.c' '/home/liangjunming/program/acados/examples/acados_python/getting_started/acados_ocp.json' 'main_pendulum_ode.c'

报错原因

只找到了一篇帖子是运行在arm架构下才出现这个问题,但我是跑在x86架构下的,所以原因还不清楚

解决方法

通过tera编译生成的t_renderer代替由make生成的错误版本

sudo git glone https://github.com/acados/tera_renderer.git
cargo build --verbose --release

(没有安装cargo的需要sudo apt-get install cargo,长时间卡在Updating crates.io index自行查询怎么更换国内cargo源)
替换t_renderer文件

cd target/release

将t_renderer文件拷贝到{acados安装目录}/bin目录下替换原有的文件
编译通过

参考

https://discourse.acados.org/t/problems-with-t-renderer/438/4

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值