既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上物联网嵌入式知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、电子书籍、讲解视频,并且后续会持续更新
需要这些体系化资料的朋友,可以加我V获取:vip1024c (备注嵌入式)
$ echo $ROS\_PACKAGE\_PATH
/home/youruser/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
Now that your environment is setup
Creating a catkin Package
This tutorial will demonstrate how to use the catkin_create_pkg script to create a new catkin package, and what you can do with it after it has been created.
First change to the source space directory of the catkin workspace you created in theCreating a Workspace for catkin tutorial:
# You should have created this in the Creating a Workspace Tutorial
$ cd ~/catkin\_ws/src
Now use the catkin_create_pkg script to create a new package called ‘beginner_tutorials’ which depends on std_msgs, roscpp, and rospy:
$ catkin\_create\_pkg beginner\_tutorials std\_msgs rospy roscpp
This will create a beginner_tutorials folder which contains apackage.xml and aCMakeLists.txt, which have been partially filled out with the information you gavecatkin_create_pkg.
catkin_create_pkg requires that you give it apackage_name and optionally a list of dependencies on which that package depends:
# This is an example, do not try to run this
# catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
catkin_create_pkalities which is described incatkin/commands/catkin_create_pkg.
Building a catkin workspace and sourcing the setup file
Now you need to build the packages in the catkin workspace:
$ cd ~/catkin\_ws
$ catkin\_make
After the workspace has been built it has created a similar structure in thedevel subfolder as you usually find under/opt/ros/$ROSDISTRO_NAME.
To add the workspace to your ROS environment you need to source the generated setup file:
$ . ~/catkin\_ws/devel/setup.bash
创建hello_world.cpp
cd ~/catkin\_ws/src/beginner\_tutorials/src
gedit hello_world.cpp
代码如下:
[cpp]
view plain
copy
print
?
- #include <ros/ros.h>
- int main(int argc, char** argv)
- {
- ros::init(argc, argv, “hello_meta_package_node”);
- ros::NodeHandle nh;
- ROS_INFO(“Hello ROS!”);
- ros::spin();
- }
CMakeLists.txt加入
add_executable(hello_world src/hello_world.cpp)
target_link_libraries(hello_world ${catkin_LIBRARIES} )
编译cpp即节点
cd ~/catkin_ws
catkin_make
运行
rosrun beginner_tutorials hello_world
PS:若出现错误[rospack] Error: stack/package beginner_tutorials not found
类似错误都可以这样解决
source devel/setup.bash
或者
$ cd ~
$gedit .bashrc
再后面加入两行
source /opt/ros/hydro/setup.bash
source /工作空间/devel/setup.bash
使用launch文件
$ roscdbeginner_tutorials
$ mkdir launch
$ cd launch
$gedit hello_world.launch
hello_world.launch内容:
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上物联网嵌入式知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、电子书籍、讲解视频,并且后续会持续更新
需要这些体系化资料的朋友,可以加我V获取:vip1024c (备注嵌入式)
提升的进阶课程,涵盖了95%以上物联网嵌入式知识点,真正体系化!**
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、电子书籍、讲解视频,并且后续会持续更新
需要这些体系化资料的朋友,可以加我V获取:vip1024c (备注嵌入式)