分类目录归档:ROS

ROS 开发tips

点击量:6

这是我进行ros开发的几个比较有用但是ros-wiki中没有明确点出的。

使用catkin的清除命令

如果使用rosbuild进行此操作,可以使用:

rosmake --target=clean

如果使用catkin

$ cd ~/catkin_ws
$ rm -rf devel build install

执行以上命令后,可以像往常一下构建数据包

$ cd ~/catkin_ws
$ catkin_make
$ source devel/setup.zsh

重新构建单独的catkin包

$ cd ~/catkin_ws
$ catkin_make --pkg package_name

编译单独的包

catkin_make -DCATKIN_WHITELIST_PACKAGES='kinect2_viewer'

ROS image转换为cv::Mat格式,提供opencv使用

http://wiki.ros.org/cv_bridge/Tutorials/ConvertingBetweenROSImagesAndOpenCVImagesPython

参考

ROS消息开发

点击量:5

  • ROS常用的消息:http://wiki.ros.org/common_msgs
  • ROS消息wiki:http://wiki.ros.org/msg

ROS消息开发参照:

  • csdn
  • http://wiki.ros.org/cn/ROS/Tutorials
  • 定制自己的消息类型:csdn

开发自己的消息类型的时候要依据原本的消息类型来定义,定义消息的作用是,定义过的消息可以被python,以及cpp引入。进行开发的时候,可以参考给出的例子进行msg的开发。

Ubuntu 16.04 install iai-kinect2

点击量:5

install libfreenect2, choose the (other) and don’t forget to test bin/Pronect after install.

ATTENTION: I don’t have NVIDIA or AMD graph card. It might be different if you use them.

PROBLEM

when you face this problem

/usr/local/include/opencv2/flann/saving.h:113:63: error: exception handling disabled, use -fexceptions to enable
         throw FLANNException("Invalid index file, cannot read");

run

roscd kinect2_registrations

edit CMakeLists.txt, add

add_definitions( -fexceptions )

it will work.

Ros Kinect Configure Note

点击量:6

This blog for my kinect-v2 ros configure.

Environment

  • Thinkpad P70
  • Ubuntu 14.04
  • indigo

Reference to https://github.com/code-iai/iai_kinect2

Install

Before start, make sure the cuda, cudnn has been configured correctly.

First, you need to install libfreenect2.

I recommend to use export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 in your .zshrc or .bashrc (more professional, in bash_profile or .zshenv). You will avoid some problems about library error.

When installing libfreenect2, Use cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2 -DENABLE_CXX11=ON to generate Makeifle at build/

Then Install iai-Kinect

I use catkin_make -DCMAKE_BUILD_TYPE="Release" -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2 to Compile iai-Kinect because installing to $HOME/freenect2 before.

NOTE:

  1. enable C++11 by using cmake .. -DENABLE_CXX11=ON instead of cmake ..
  2. If something is not working, check out the latest stable release, for example git checkout v0.2.0.
  3. check your opencv version: pkg-config --modversion opencv.
  4. NEVER EVER use sudo prime-select intel.

Error

I missed sudo apt-get install beignet-dev; so I got this error:

Building CXX object iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge.dir/src/kinect2_bridge.cpp.o
Building CXX object iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/src/kinect2_bridge.cpp.o
[100%] Built target kinect2_viewer
/home/svtter/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘bool Kinect2Bridge::initPipeline(const string&, int32_t)’:
/home/svtter/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:427:28: error: expected type-specifier
       packetPipeline = new libfreenect2::OpenCLKdePacketPipeline(device);