trajopt代码使用

看完trajopt的文章,比较经典,想跑跑看其开源代码


trajopt  is a software framework for generating robot trajectories by local optimization
调试Motion Planning Benchmarks

OpenRAVE有可能要装0.9    现在是0.8
安装OpenRAVE 
Open Robotics Automation Virtual Environment
OpenRAVE 提供测试环境,开发和部署在现实世界中的机器人应用运动规划算法。主要的重点是运动规划运动学和几何信息的模拟和分析。 OpenRAVE的独立性质允许,可以很容易地集成到现有的机器人系统。

有的时候,在 Ubuntu 下使用sudo apt-get install可能导致意想不到的错误,尤其是中途中断了安装时,错误信息为:
安装Openrave时出错
Errors were encountered while processing:
/var/cache/apt/archives/libbullet2.80_2.80.2-ubuntu1~precise1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

查软件版本 openrave --version

检查 输入python 打开Python交互环境
import openravepy
print openravepy.__version__


sudo apt-get install python-nltk 

  • Various Python packages: NumPy, YAML, JSON
sudo apt-get install python-scipy  记得安装!!!
查询软件是否成功安装 dpkg  - s python-numpy

安装 JSON  sudo  apt-get install libjson0-dev libjson0

出错:
E:Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)

    E:Unable to lock the administration directory (/var/lib/dpkg/),are you root? 

    解决方案:

    sudo rm -rf /var/lib/dpkg/lock

    sudo rm -rf /var/cache/apt/archives/lock

    sudo apt-get update

    最后运行:sudo dpkg --configure -a  重新配置(系统会提醒) 。

其实错误是因为没有加sudo!!!


GUROBI
一个优化工具

下载gurobi6.0.5
放到/opt
tar xvfz gurobi6.0.0_linux64.tar.gz
修改环境变量
export GUROBI_HOME="/opt/gurobi605/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
grbgetkey b3a3ad84-f700-c014-85d1-565bf82e2231
修改环境变量
export GRB_LICENSE_FILE=/home/cwx/gurobi.lic
测试 gurobi.sh

使用502版本会出错
-----------------------------------------------
Contacting academic domain validation server...
-----------------------------------------------

Unable to contact key server 'apps.gurobi.com'


gedit ~/.bashrc改环境变量

安装 环境变量出问题

如果你想查看某一个名称的环境变量,命令是: echo $环境变量名

每次修改.bashrc后,使用source ~/.bashrc  是修改立即生效

Gurobi found
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GUROBI_LIBRARY (ADVANCED)
    linked by target "sco" in directory /home/cwx/build_trajopt/trajopt-master/src/sco

-- Configuring incomplete, errors occurred!
改用gurobi6.0.5就解决


cmake



make -j
-j 可以指定用几个进程同时编译,建议小于或等于你的cpu个数。
一般 make -j 2

设置PYTHONPATH路径
export PYTHONPATH="${PYTHONPATH}:/home/cwx/trajopt-master:/home/cwx/trajopt-master/build/lib"

make -j遇到错误
[ 80%] Building CXX object ext/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [src/trajopt/CMakeFiles/trajopt.dir/kinematic_terms.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [src/trajopt/CMakeFiles/trajopt.dir/utils.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [src/trajopt/CMakeFiles/trajopt.dir/rave_utils.cpp.o] Error 4
Linking CXX static library ../../lib/libgtest_main.a
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [src/trajopt/CMakeFiles/trajopt.dir/collision_terms.cpp.o] Error 4
virtual memory exhausted: Cannot allocate memory
make[2]: *** [src/trajopt/CMakeFiles/trajopt.dir/bullet_collision_checker.cpp.o] Error 1
[ 80%] Built target gtest_main
Scanning dependencies of target sco-unit
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [src/trajopt/CMakeFiles/trajopt.dir/plot_callback.cpp.o] Error 4
[ 88%] [ 88%] [ 85%] Building CXX object src/sco/test/CMakeFiles/sco-unit.dir/unit.cpp.o
Building CXX object src/sco/test/CMakeFiles/sco-unit.dir/small-problems-unit.cpp.o
Building CXX object src/sco/test/CMakeFiles/sco-unit.dir/solver-interface-unit.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[2]: *** [src/trajopt/CMakeFiles/trajopt.dir/traj_plotter.cpp.o] Error 4
Linking CXX executable ../../../bin/sco-unit
[ 88%] Built target sco-unit
make[1]: *** [src/trajopt/CMakeFiles/trajopt.dir/all] Error 2
make: *** [all] Error 2

make -j 过程中死机 主机也比较卡 占资源
解决:开大内存和处理器核数

ctest错误


找文件
find /usr -name "*libopenrave*.so"

man find 找find命令的说明文档

修改 LD_LIBRARY_PATH=/usr/local/lib

运行python文件 python 文件路径

终端运行终止 ctrl+c

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WX Chen

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值