1、查看摄像头属性
v4l2-ctl –list-formats
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Index : 1
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : MJPEG
2、检测摄像头
cd ~/ws/src
mkdir -p usb_cam
cd usb_cam
git clone https://github.com/bosch-ros-pkg/usb_cam.git
cd ~/ws
catkin_make
source ~/ws/devel/setup.bash
roscd usb_cam
运行并测试图像:
rosrun usb_cam usb_cam_node
rosrun image_view image_view image:=/usb_cam/image_raw
3、ubuntu14.04 LTS运行python时遇到 “No module named _sysconfigdata_nd”
ubuntu的一个bug,具体解决方法为创建一个软链接:
sudo ln /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py /usr/lib/python2.7/
然后问题解决了
4、问题描述
创建工作空间
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ cd ~/catkin_ws/
$ catkin_make
出错
#### Running command: "cmake /home/shuifu/catkin_mybot/src -DCATKIN_DEVEL_PREFIX=/home/shuifu/catkin_mybot/devel -DCMAKE_INSTALL_PREFIX=/home/shuifu/catkin_mybot/install -G Unix Makefiles" in "/home/shuifu/catkin_mybot/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/shuifu/catkin_mybot/devel
-- Using CMAKE_PREFIX_PATH: /home/shuifu/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/shuifu/catkin_ws/devel;/opt/ros/indigo
-- Using PYTHON_EXECUTABLE: /home/shuifu/anaconda2/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/shuifu/catkin_mybot/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
ImportError: "from catkin_pkg.package import parse_package" failed: No module named catkin_pkg.package
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
CMake Error at /opt/ros/indigo/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/home/shuifu/anaconda2/bin/python
"/opt/ros/indigo/share/catkin/cmake/parse_package_xml.py"
"/opt/ros/indigo/share/catkin/cmake/../package.xml"
"/home/shuifu/catkin_mybot/build/catkin/catkin_generated/version/package.cmake")
returned error code 1
Call Stack (most recent call first):
/opt/ros/indigo/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
/opt/ros/indigo/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
/opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:52 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/shuifu/catkin_mybot/build/CMakeFiles/CMakeOutput.log".
See also "/home/shuifu/catkin_mybot/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
解决过程
默认的Python编译器是anaconda2/bin/python
现将默认编译器改为系统自带的python2.7
重新打开终端,使更改生效,这时查看python –version
参考备注:
http://blog.exbot.net/