ROS learning by Guangdong Industry University 01

在这里插入图片描述

headers are

from this :
/opt/ros/indigo/include/std_msgs

remapping

rosrun my_minimal_nodes minimal_publisher /miminal_nodes1/topic1:=topic1

 ros::NodeHandle n("miminal_nodes1"); 

using different namespace can change the topic form
and by using remapping to return
在这里插入图片描述

rostopic pub

can publish isolutely

rostopic pub -r 20  /topic2 std_msgs/Float64 '{data: 0.7}' 

rosed

rosed my_minimal_nodes minimal_publisher.cpp

ROS Tools: Catkin Simple

• CATKIN_SIMPLE simplifies catkin_make.
• Book code contains a script to create packages using catkin_simple.
• Create an alias in .bashrc

alias cs_create_pkg=‘~/ros/indigo/ros_ws/src/books/newman/learning_ros_external_packages/cs_create_pkg.py’

• Move to the correct folder location and create a new package as follows:

cs_create_pkg my_minimal_nodes2 roscpp std_msgs

• It will create appropriate CMakeLists.txt and packages.xml files.
• We also need only one command to compile and link!

cs_add_executable(minimal_publisher_3 src/minimal_publisher.cpp

单独编译|调试某包

调试

catkin_make -DCMAKE_BUILD_TYPE=Debug

单独编译

catkin_make -DCATKIN_WHITELIST_PACKAGES=“minimal_nodes"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值