2015.11.02
一.
安装BagFromImages,之前在安装的时候在cmake .. 步骤出错,现在解决,估计是 工作空间 和 环境变量 的的问题,可能是开启终端时没有配置,在运行git clone https://github.com/raulmur/BagFromImages.git BagFromImages步骤前,
1.首先执行cd ~/catkin_ws 进入catkin_ws目录;
注:前提是已经创建了catkin 工作空间,如果没有,可以参考:http://wiki.ros.org/cn/ROS/Tutorials/InstallingandConfiguringROSEnvironment
2.source devel/setup.bash sourcez这个文件可以将当前工作空间设置在ROS工作环境的最顶层;
注:然后可以通过echo $ROS_PACKAGE_PATH查看确认当前工作空间,结果应该为/home/zhangxiwu/catkin_ws/src:/opt/ros/hydro/share:/opt/ros/hydro/stacks
3.执行cd src 进入ros工作空间,即/home/zhangxiwu/catkin_ws/src
4.执行git clone...
......
执行cmake ..
执行make
没有报错。
以下是运行的记录:
[email protected]:~$ source devel/setup.bash
bash: devel/setup.bash: 没有那个文件或目录
[email protected]:~$ cd ~/catkin_ws
[email protected]:~/catkin_ws$ echo $ROS_PACKAGE_PATH
/opt/ros/hydro/share:/opt/ros/hydro/stacks
[email protected]:~/catkin_ws$ source devel/setup.bash
[email protected]:~/catkin_ws$ echo $ROS_PACKAGE_PATH
/home/zhangxiwu/catkin_ws/src:/opt/ros/hydro/share:/opt/ros/hydro/stacks
[email protected]:~/catkin_ws$ cd src
[email protected]:~/catkin_ws/src$ git clone https://github.com/raulmur/BagFromImages.git BagFromImages
Cloning into ‘BagFromImages‘...
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 24 (delta 6), reused 24 (delta 6), pack-reused 0
Unpacking objects: 100% (24/24), done.
[email protected]:~/catkin_ws/src$ cd BagFromImages
[email protected]:~/catkin_ws/src/BagFromImages$ mkdir buils
[email protected]:~/catkin_ws/src/BagFromImages$ mkdir build
[email protected]:~/catkin_ws/src/BagFromImages$ cd build
[email protected]:~/catkin_ws/src/BagFromImages/build$ cmake ..
-- Found PythonInterp: /usr/bin/python (found version "2.7.3")
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
[rosbuild] Building package BagFromImages
[rosbuild] Cached build flags older than manifests; calling rospack to get flags
-- Using CATKIN_DEVEL_PREFIX: /home/zhangxiwu/catkin_ws/src/BagFromImages/build/devel
-- Using CMAKE_PREFIX_PATH: /home/zhangxiwu/catkin_ws/devel;/opt/ros/hydro
-- This workspace overlays: /home/zhangxiwu/catkin_ws/devel;/opt/ros/hydro
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Python version: 2.7
-- Using Debian Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Skip enable_testing() for dry packages
-- Using CATKIN_TEST_RESULTS_DIR: /home/zhangxiwu/catkin_ws/src/BagFromImages/build/test_results
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found gtest sources under ‘/usr/src/gtest‘: gtests will be built
-- catkin 0.5.90
-- Using these message generators: gencpp;genlisp;genpy
[rosbuild] Including /opt/ros/hydro/share/roslisp/rosbuild/roslisp.cmake
[rosbuild] Including /opt/ros/hydro/share/roscpp/rosbuild/roscpp.cmake
[rosbuild] Including /opt/ros/hydro/share/rospy/rosbuild/rospy.cmake
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zhangxiwu/catkin_ws/src/BagFromImages/build
[email protected]:~/catkin_ws/src/BagFromImages/build$ make
Scanning dependencies of target rospack_genmsg_libexe
[ 0%] Built target rospack_genmsg_libexe
Scanning dependencies of target rosbuild_precompile
[ 0%] Built target rosbuild_precompile
Scanning dependencies of target BagFromImages
[ 50%] Building CXX object CMakeFiles/BagFromImages.dir/main.cc.o
[100%] Building CXX object CMakeFiles/BagFromImages.dir/Thirdparty/DLib/FileFunctions.cpp.o
Linking CXX executable ../bin/BagFromImages
[100%] Built target BagFromImages
[email protected]:~/catkin_ws/src/BagFromImages/build$
二. 此时BagFromImages工具应该在ROS的工作空间下面了?
2015.11.03
一. BagFromImages终于可以正确运行了
步骤:
开启终端执行:
1. roscore 启动roscore服务;
在新的终端执行:
1. export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/home/zhangxiwu/BagFromImages 添加环境变量;
2. cd BagFromImages 进入BagFromImages文件夹;
3. rosrun BagFromImages BagFromImages test .jpg 30 test1 注意最后的一个文件名不要和之前的文件夹名重复,要不然还是会出现(核心已转储)的错误;
总结: 待生成的图像的存放在BagFromImages文件夹内;
之前出错应该是文件夹设置的太复杂了,导致出现(核心已转储)的错误,
还有,用的就是在主文件夹下面BagFromImages,
以后安装文件工具应该也安装在主文件夹下面;