ROS 开发tips

这是我进行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消息开发

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

ROS消息开发参照:

]2

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

Tensorflow与Ros进行集成

这是一个可以参考的例子

还有一个例子是根据他人开发进行修改的,参见这里

通过这个例子,可以调用Tensorflow – object – detection – API。

【挖坑】

Ubuntu 16.04 install iai-kinect2

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

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/

[阅读全文]
cpp