ROS学习笔记(五)

来源:互联网 发布:58淘宝美工学徒新骗局 编辑:程序博客网 时间:2024/06/05 18:15

机器人定义:(来自Wikipedia)
A robot is a machine—especially one programmable by a computer— capable of carrying out a complex series of actions automatically.Robots can be guided by an external control device or the control may be embedded within. Robots may be constructed to take on human form but most robots are machines designed to perform a task with no regard to how they look.
概念回忆:
功能包、节点、主题和服务(主题是单向通信,服务是双向通信)、消息(消息是通信的内容)

ROS学习笔记(五) —— 程序包编译

编译程序包

一旦安装了所需的系统依赖项,我们就可以开始编译刚才创建的程序包了。
Note:如果你是通过apt或者其它软件包管理工具来安装ROS的,那么系统已经默认安装好所有依赖项。
$ source /opt/ros/indigo/setup.bash

  • 使用catkin_make
    catkin_make 是一个命令行工具,它简化了catkin的标准工作流程。你可以认为catkin_make是在CMake标准工作流程中依次调用了cmake 和 make。
    ros.rog对ros的介绍:catkin_make
    You should always call catkin_make in the root of your catkin workspace, assuming your catkin workspace is in ~/catkin_ws:
cd ~/catkin_wscatkin_make

The above command will build any packages located in ~/catkin_ws/src. The equivalent commands to do this manually would be:

$ cd ~/catkin_ws$ cd src$ catkin_init_workspace$ cd ..$ mkdir build$ cd build$ cmake ../src -DCMAKE_INSTALL_PREFIX=../install -DCATKIN_DEVEL_PREFIX=../devel$ make
  • 开始编译你的程序包
    -对于正要马上编译自己代码的读者,请同时看一下后面的(C++)/(Python)教程,因为你可能需要修改CMakeLists.txt文件
    catkin_make首先输出它所使用到的每个空间所在的路径。更多关于空间的信息,请参考REP128和catkin/workspaces。需要注意的是由于这些空间存在默认配置的原因,有几个文件夹已经在catkin工作空间自动生成了,使用ls查看:
    build 目录是build space的默认所在位置,同时cmake 和 make也是在这里被调用来配置并编译你的程序包。devel 目录是devel space的默认所在位置, 同时也是在你安装程序包之前存放可执行文件和库文件的地方。现在我们已成功编译了一个ROS程序包,接下来我们将介绍ROS节点.
原创粉丝点击