Create a workspace lesson Feature Pack Lesson 9
Workspace
src: code space. xml file
build: Compile space, basically do not care about
devel: development of space,
install: the installation space
-
Create a workspace
mkdir -p ~ / catkin_ws / src
cd ~ / catkin_ws / src
catkin_init_workspace -
Compiler workspace
cd ~ / catkin_ws /
catkin_make (devel generate and build folders)
catkin_make install (produce install folder) -
Set the environment variable
source devel / setup.bash -
Check the environment variable
echo $ ROS_PACKAGE_PATH
Creating Feature Pack
catkin_creat_pkg (function package name) [1] [dependency dependent dependent 3] [2]
-
Creating Feature Pack
cd ~ / catkin_ws / src
catkin_create_pkg test_pkg std_msgs rospy roscpp -
Compilation package
CD ~ / catkin_ws
catkin_make
Source ~ / catkin_ws / devel / setup.bash
Under the same workspace, not allowed to have the same name as the function package, under different workspaces can have.
Lesson Ten publisher Publisher's programming
Creating Feature Pack
cd ~/catkin_ws/src
catkin_create_pkg learning_topic roscpp std_msgs geometry_msgs turtlesim
c ++ realize
1. Write a program
References in the velocity_publisher.cpp file.
2. At the end of the file plus CMakelist.txt
add_executable(velocity_publisher src/velocity_publisher.cpp)
target_link_libraries(velocity_publisher ${catkin_LIBRARIES})
3. Compile and run
~ CD / catkin_ws
catkin_make
Source devel / setup.bash
newly opened terminal roscore
new terminal rosrun turtlesim turtlesim_node opened
to open the terminal rosrun learning_topic velocity_publisher
python achieve
Look courseware Code