- ROS Robotics By Example
- Carol Fairchild Dr. Thomas L. Harman
- 252字
- 2021-07-14 11:14:05
Creating and building a ROS package
Before we begin to design and build our robot model in simulation, we should create our first ROS package. In Chapter 1, Getting Started with ROS, we created a ROS catkin workspace under /home/<username>/catkin_ws
. The structure of a catkin workspace looks like this:
catkin_ws/ -- WORKSPACE build/ -- BUILD SPACE devel/ -- DEVEL SPACE src/ -- SOURCE SPACE CMakeLists.txt -- 'Toplevel' CMake file, provided by catkin
Tip
Make sure that you have source ~/catkin_ws/devel/setup.bash
in your .bashrc
file, or this command is entered at the terminal window prompt.
We begin by moving to your catkin workspace source directory:
$ cd ~/catkin_ws/src
Now, let's create our first ROS package, ros_robotics
:
$ catkin_create_pkg ros_robotics
This command will create a /ros_robotics
directory under the ~/catkin_ws/src
directory. The /ros_robotics
directory will contain a package.xml
file and a CMakeLists.txt
file. These files contain information generated from the $ catkin_create_pkg
command execution.
Note
The catkin_create_pkg syntax
catkin_create_pkg
requires a unique package name and, optionally, a list of dependencies for the package. The command format to create it is as follows:
$ catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
[depend1]
, [depend2]
, and [depend3]
specify software packages that are required to be present for this software package to be made.
We will not identify any dependencies for our ros_robotics
package at this point.
Next, build the packages in the catkin workspace:
$ cd ~/catkin_ws $ catkin_make
After the workspace has been built to include the ros_robotics
package, the ~/catkin_ws/devel
subdirectory will have a structure similar to the structure under the /opt/ros/indigo
directory.
- 零基礎學Scratch少兒編程:小學課本中的Scratch創意編程
- C++面向對象程序設計(微課版)
- 從程序員到架構師:大數據量、緩存、高并發、微服務、多團隊協同等核心場景實戰
- 深入淺出Windows API程序設計:編程基礎篇
- AngularJS深度剖析與最佳實踐
- Python Network Programming Cookbook(Second Edition)
- Unity 3D腳本編程:使用C#語言開發跨平臺游戲
- Java Web從入門到精通(第3版)
- Raspberry Pi Robotic Projects(Third Edition)
- Oracle Data Guard 11gR2 Administration Beginner's Guide
- Mastering ArcGIS Server Development with JavaScript
- Manage Your SAP Projects with SAP Activate
- Scala編程(第4版)
- C語言程序設計實驗指導教程
- Isomorphic JavaScript Web Development